From: Javier Sancho Date: Tue, 26 May 2020 09:09:44 +0000 (+0200) Subject: add-item! add-window! X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=7611ebfeeae5ed59751f108214ee7a00aea20b7b;p=guile-irrlicht.git add-item! add-window! --- diff --git a/irrlicht.scm b/irrlicht.scm index 24a3a13..5dd508e 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -50,6 +50,7 @@ + @@ -75,11 +76,13 @@ 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 diff --git a/irrlicht/gui.scm b/irrlicht/gui.scm index 597032a..4708d37 100644 --- a/irrlicht/gui.scm +++ b/irrlicht/gui.scm @@ -111,6 +111,16 @@ id fill-background))) (mem-wrapped static-text)))) +(define-method (add-window! (gui-environment ) rectangle . rest) + (let-keywords rest #f + ((modal #f) + (text "") + (parent (make )) + (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 )) ((get-irrlicht-proc "drawAll" gui-environment) gui-environment)) @@ -131,7 +141,7 @@ (getSkin gui-environment))) (export 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 @@ -210,7 +220,11 @@ (define-class () (irr-class #:init-value "IGUIListBox")) -(export ) +(define-method (add-item! (listbox ) text) + (let ((addItem (get-irrlicht-proc "addItem" listbox))) + (addItem listbox text))) + +(export add-item!) ;; IGUIEditBox @@ -218,3 +232,10 @@ (irr-class #:init-value "IGUIEditBox")) (export ) + + +;; IGUIWindow +(define-class () + (irr-class #:init-value "IGUIWindow")) + +(export ) diff --git a/src/gui-element.cpp b/src/gui-element.cpp index 6ee3dcc..af02ea6 100644 --- a/src/gui-element.cpp +++ b/src/gui-element.cpp @@ -45,4 +45,5 @@ init_gui_element (void) DEFINE_GSUBR ("IGUIListBox_getID", 1, 0, 0, IGUIElement_getID); DEFINE_GSUBR ("IGUIScrollBar_getID", 1, 0, 0, IGUIElement_getID); DEFINE_GSUBR ("IGUIStaticText_getID", 1, 0, 0, IGUIElement_getID); + DEFINE_GSUBR ("IGUIWindow_getID", 1, 0, 0, IGUIElement_getID); } diff --git a/src/gui-environment.cpp b/src/gui-environment.cpp index d29750f..33a03e4 100644 --- a/src/gui-environment.cpp +++ b/src/gui-environment.cpp @@ -236,6 +236,8 @@ init_gui_environment (void) IGUIEnvironment_addScrollBar); DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIElement", 8, 0, 0, IGUIEnvironment_addStaticText); + DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIWindow", 8, 0, 0, + IGUIEnvironment_addStaticText); DEFINE_GSUBR ("IGUIEnvironment_addWindow_IGUIElement", 6, 0, 0, IGUIEnvironment_addWindow); DEFINE_GSUBR ("IGUIEnvironment_drawAll", 1, 0, 0, IGUIEnvironment_drawAll);