#!/usr/bin/env lisp
;;;
;;; generated by wxGlade
;;;

(asdf:operate 'asdf:load-op 'wxcl)
(use-package "FFI")
(ffi:default-foreign-language :stdc)


;;; begin wxGlade: dependencies
(use-package :wxButton)
(use-package :wxCL)
(use-package :wxColour)
(use-package :wxEvent)
(use-package :wxEvtHandler)
(use-package :wxFrame)
(use-package :wxSizer)
(use-package :wxWindow)
(use-package :wx_main)
(use-package :wx_wrapper)
;;; end wxGlade

;;; begin wxGlade: extracode
# frame extra code
# dialog extra code
;;; end wxGlade


(defclass MyFrame()
        ((top-window :initform nil :accessor slot-top-window)
        (sizer-1 :initform nil :accessor slot-sizer-1)))

(defun make-MyFrame ()
        (let ((obj (make-instance 'MyFrame)))
          (init obj)
          (set-properties obj)
          (do-layout obj)
          obj))

(defmethod init ((obj MyFrame))
"Method creates the objects contained in the class."
        ;;; begin wxGlade: MyFrame.__init__
        # frame extra code before
        (setf (slot-top-window obj) (wxFrame_create nil wxID_ANY "" -1 -1 -1 -1 wxDEFAULT_FRAME_STYLE))
        (slot-top-window obj).wxWindow_SetSize((400, 300))
        (wxFrame_SetTitle (slot-top-window obj) "frame")
        
        (setf (slot-sizer-1 obj) (wxBoxSizer_Create wxVERTICAL))
        
        (wxSizer_AddWindow (slot-sizer-1 obj) ((0, 0) obj) 0 0 0 nil)
        
        (wxWindow_SetSizer (slot-top-window obj) (slot-sizer-1 obj))
        
        (wxFrame_layout (slot-frame self))
        # frame extra code after

        (wxEvtHandler_Connect (slot-top-window obj) obj (expwxEVT_CLOSE)
        (wxClosure_Create #'on_close_frame obj))
        (wxEvtHandler_Connect (slot-top-window obj) obj (expwxEVT_MENU_CLOSE)
        (wxClosure_Create #'on_menu_close_frame obj))
        ;;; end wxGlade
        )

(defun on_close_frame (function data event) ;;; wxGlade: MyFrame.<event_handler>
        (print "Event handler 'on_close_frame' not implemented!")
        (when event
                (wxEvent:wxEvent_Skip event)))

(defun on_menu_close_frame (function data event) ;;; wxGlade: MyFrame.<event_handler>
        (print "Event handler 'on_menu_close_frame' not implemented!")
        (when event
                (wxEvent:wxEvent_Skip event)))

;;; end of class MyFrame



(defclass MyDialog()
        ((top-window :initform nil :accessor slot-top-window)
        (sizer-1 :initform nil :accessor slot-sizer-1)
        (sizer-1 :initform nil :accessor slot-sizer-1)))

(defun make-MyDialog ()
        (let ((obj (make-instance 'MyDialog)))
          (init obj)
          (set-properties obj)
          (do-layout obj)
          obj))

(defmethod init ((obj MyDialog))
"Method creates the objects contained in the class."
        ;;; begin wxGlade: MyDialog.__init__
        # dialog extra code before
        (setf (slot-top-window obj) (wxDialog_create nil wxID_ANY "" -1 -1 -1 -1 wxDEFAULT_DIALOG_STYLE))
        (wxWindow_SetTitle (slot-dialog self) "dialog")
        
        (setf (slot-sizer-1 obj) (wxBoxSizer_Create wxVERTICAL))
        
        (wxSizer_AddWindow (slot-sizer-1 obj) ((0, 0) obj) 0 0 0 nil)
        
        (wxWindow_SetSizer (slot-top-window obj) (slot-sizer-1 obj))
        (wxSizer_Fit (slot-sizer-1 obj) (slot-top-window obj))
        
        (wxWindow_layout (slot-dialog self))
        # dialog extra code after

        (wxEvtHandler_Connect (slot-top-window obj) obj (expwxEVT_CLOSE)
        (wxClosure_Create #'on_close_dialog obj))
        ;;; end wxGlade
        )

(defun on_close_dialog (function data event) ;;; wxGlade: MyDialog.<event_handler>
        (print "Event handler 'on_close_dialog' not implemented!")
        (when event
                (wxEvent:wxEvent_Skip event)))

;;; end of class MyDialog



(defclass MyMenuBar()
        ((top-window :initform nil :accessor slot-top-window)
        (sizer-1 :initform nil :accessor slot-sizer-1)
        (sizer-1 :initform nil :accessor slot-sizer-1)))

(defun make-MyMenuBar ()
        (let ((obj (make-instance 'MyMenuBar)))
          (init obj)
          (set-properties obj)
          (do-layout obj)
          obj))

(defmethod init ((obj MyMenuBar))
"Method creates the objects contained in the class."
        ;;; begin wxGlade: MyMenuBar.__init__
        # menubar extracode before
        # menubar extracode after
        ;;; end wxGlade
        )

;;; end of class MyMenuBar



(defclass wxToolBar()
        ((top-window :initform nil :accessor slot-top-window)
        (sizer-1 :initform nil :accessor slot-sizer-1)
        (sizer-1 :initform nil :accessor slot-sizer-1)))

(defun make-wxToolBar ()
        (let ((obj (make-instance 'wxToolBar)))
          (init obj)
          (set-properties obj)
          (do-layout obj)
          obj))

(defmethod init ((obj wxToolBar))
"Method creates the objects contained in the class."
        ;;; begin wxGlade: wxToolBar.__init__
        # toolbar extracode before
        (wxToolBar_Realize (slot-toolbar obj))
        # toolbar extracode after
        ;;; end wxGlade
        )

;;; end of class wxToolBar



(defclass MyDialog1()
        ((top-window :initform nil :accessor slot-top-window)
        (sizer-1 :initform nil :accessor slot-sizer-1)
        (sizer-1 :initform nil :accessor slot-sizer-1)
        (sizer-1 :initform nil :accessor slot-sizer-1)))

(defun make-MyDialog1 ()
        (let ((obj (make-instance 'MyDialog1)))
          (init obj)
          (set-properties obj)
          (do-layout obj)
          obj))

(defmethod init ((obj MyDialog1))
"Method creates the objects contained in the class."
        ;;; begin wxGlade: MyDialog1.__init__
        # panel extracode before
        
        (setf (slot-sizer-1 obj) (wxBoxSizer_Create wxVERTICAL))
        
        (wxSizer_AddWindow (slot-sizer-1 obj) ((0, 0) obj) 0 0 0 nil)
        
        (wxWindow_SetSizer (slot-top-window obj) (slot-sizer-1 obj))
        (wxSizer_Fit (slot-sizer-1 obj) (slot-top-window obj))
        
        (wxPanel_layout (slot-panel self))
        # panel extracode after
        ;;; end wxGlade
        )

;;; end of class MyDialog1


(defun init-func (fun data evt)
        (let ((frame (make-MyFrame)))
        (ELJApp_SetTopWindow (slot-top-window frame))
        (wxWindow_Show (slot-top-window frame))))
;;; end of class MyApp


(unwind-protect
    (Eljapp_initializeC (wxclosure_Create #'init-func nil) 0 nil)
    (ffi:close-foreign-library "../miscellaneous/wxc-msw2.6.2.dll"))
