]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
add-item! add-window! <gui-window>
authorJavier Sancho <jsf@jsancho.org>
Tue, 26 May 2020 09:09:44 +0000 (11:09 +0200)
committerJavier Sancho <jsf@jsancho.org>
Tue, 26 May 2020 09:09:44 +0000 (11:09 +0200)
irrlicht.scm
irrlicht/gui.scm
src/gui-element.cpp
src/gui-environment.cpp

index 24a3a132880a0fd88e6837932000198084f575f7..5dd508ed33c2f40f1c51dd763e71c14fe21c91a1 100644 (file)
@@ -50,6 +50,7 @@
                <gui-scrollbar>
                <gui-skin>
                <gui-static-text>
+               <gui-window>
                <irrlicht-device>
                <key-map>
                <material>
                add-file-archive!
                add-image!
                add-internal-point!
+               add-item!
                add-listbox!
                add-octree-scene-node!
                add-scrollbar!
                add-sphere-scene-node!
                add-static-text!
+               add-window!
                begin-scene
                close-device
                create-device
index 597032a7f89dd4da2f0382a6a5e8922ec2e39a08..4708d371a3c706f0ca65f439e9d33c809830235f 100644 (file)
                                        id fill-background)))
       (mem-wrapped static-text))))
 
+(define-method (add-window! (gui-environment <gui-environment>) rectangle . rest)
+  (let-keywords rest #f
+        ((modal #f)
+         (text "")
+         (parent (make <gui-element>))
+         (id -1))
+    (let* ((addWindow (get-irrlicht-proc "addWindow" gui-environment parent))
+           (window (addWindow gui-environment rectangle modal text parent id)))
+      (mem-wrapped window))))
+
 (define-method (draw-all (gui-environment <gui-environment>))
   ((get-irrlicht-proc "drawAll" gui-environment)
    gui-environment))
     (getSkin gui-environment)))
 
 (export <gui-environment> add-button! add-editbox! add-image! add-listbox! add-scrollbar!
-        add-static-text! draw-all get-built-in-font get-font get-skin)
+        add-static-text! add-window! draw-all get-built-in-font get-font get-skin)
 
 
 ;; IGUIStaticText
 (define-class <gui-listbox> (<gui-element>)
   (irr-class #:init-value "IGUIListBox"))
 
-(export <gui-listbox>)
+(define-method (add-item! (listbox <gui-listbox>) text)
+  (let ((addItem (get-irrlicht-proc "addItem" listbox)))
+    (addItem listbox text)))
+
+(export <gui-listbox> add-item!)
 
 
 ;; IGUIEditBox
   (irr-class #:init-value "IGUIEditBox"))
 
 (export <gui-editbox>)
+
+
+;; IGUIWindow
+(define-class <gui-window> (<gui-element>)
+  (irr-class #:init-value "IGUIWindow"))
+
+(export <gui-window>)
index 6ee3dccc3dd395434ee5c51b0e78d7dd92cb0574..af02ea6e499aaab4e13b0e399b3b9a939aaa4350 100644 (file)
@@ -45,4 +45,5 @@ init_gui_element (void)
   DEFINE_GSUBR ("IGUIListBox_getID", 1, 0, 0, IGUIElement_getID<gui::IGUIListBox*>);
   DEFINE_GSUBR ("IGUIScrollBar_getID", 1, 0, 0, IGUIElement_getID<gui::IGUIScrollBar*>);
   DEFINE_GSUBR ("IGUIStaticText_getID", 1, 0, 0, IGUIElement_getID<gui::IGUIStaticText*>);
+  DEFINE_GSUBR ("IGUIWindow_getID", 1, 0, 0, IGUIElement_getID<gui::IGUIWindow*>);
 }
index d29750ffa88e3a0c5be0d3bb92baa9124f7d5752..33a03e4dfb8d276e3e0046aa0342f1a763141ecd 100644 (file)
@@ -236,6 +236,8 @@ init_gui_environment (void)
                 IGUIEnvironment_addScrollBar<gui::IGUIElement*>);
   DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIElement", 8, 0, 0,
                 IGUIEnvironment_addStaticText<gui::IGUIElement*>);
+  DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIWindow", 8, 0, 0,
+                IGUIEnvironment_addStaticText<gui::IGUIWindow*>);
   DEFINE_GSUBR ("IGUIEnvironment_addWindow_IGUIElement", 6, 0, 0,
                 IGUIEnvironment_addWindow<gui::IGUIElement*>);
   DEFINE_GSUBR ("IGUIEnvironment_drawAll", 1, 0, 0, IGUIEnvironment_drawAll);