1. wxScrollBox in Delphi, what is the equivalent in EU... & other ??
- Posted by vmars Jun 06, 2009
- 927 views
WindowsXp wxEuphoria: There is a control called ScrollBox in Delphi, what is the equivalent in EUphoria. In EU I see a wxScrollBar & wxScrolledWindow.
1) I want to put a bunch of buttons on *Scroll*. So it will need to scroll to show them all. Please, what control should I use for this?
2) Also, I don't see colored buttons in EU pgms. Can some controls be colored within the wx framework?.
3) I am using wxIde with Eu.3, with no probs so far. What potholes can I expect?. If probs show up, is Eu.4 fairly stable?.
4) I don't yet see how to use TABS (like at top of page) vs Buttons.
Thanks! ...Vern
2. Re: wxScrollBox in Delphi, what is the equivalent in EU... & other ??
- Posted by ghaberek (admin) Jun 09, 2009
- 977 views
Sounds like that control is something custom written for Delphi. You should be able to accomplish the same thing with a wxScrolledWindow and a vertical wxBoxSizer. Here's an example:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Scrolled Window Demo", -1, -1, 400, 300} ), scrollwin = create( wxScrolledWindow, {main, new_id(), -1, -1, -1, -1, 0} ), scrollbox = create( wxBoxSizer, {wxVERTICAL} ) set_sizer( scrollwin, scrollbox ) set_scrollbars( scrollwin, 0, 20, 0, 50, 0, 0, 0 ) -- fill the window with some buttons atom tempbtn for i = 1 to 20 do tempbtn = create( wxButton, {scrollwin, -1, sprintf("Button %d", i), 0, 0, 90, 60} ) add_window_to_sizer( scrollbox, tempbtn, 0, wxGROW, 0 ) end for wxMain( main )
2) Also, I don't see colored buttons in EU pgms. Can some controls be colored within the wx framework?.
You can apply foreground and background colors to buttons. It's not the most elegant method, but it certainly works. I will see if I can get flat buttons working. Right now, wxNO_BORDER does not produce a flat button, as the wxWidgets documentation seems to indicate. (This may be a feature of versions above 2.8.7.) Here is another example:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Color Buttons Demo", -1, -1, 400, 300} ), panel = create( wxPanel, {main} ), redbtn = create( wxButton, {panel, -1, "Red", 10, 10, 90, 30} ), greenbtn = create( wxButton, {panel, -1, "Green", 110, 10, 90, 30} ), bluebtn = create( wxButton, {panel, -1, "Blue", 210, 10, 90, 30} ) -- set button colors set_back_color( redbtn, create(wxColour, {#FF,#00,#00}) ) set_fore_color( redbtn, create(wxColour, {#FF,#FF,#FF}) ) set_back_color( greenbtn, create(wxColour, {#00,#CC,#00}) ) set_fore_color( greenbtn, create(wxColour, {#FF,#FF,#FF}) ) set_back_color( bluebtn, create(wxColour, {#00,#00,#FF}) ) set_fore_color( bluebtn, create(wxColour, {#FF,#FF,#FF}) ) wxMain( main )
3) I am using wxIde with Eu.3, with no probs so far. What potholes can I expect?. If probs show up, is Eu.4 fairly stable?.
Matt recently updated the library to prevent any collisions with Eu 4.0 keywords. As far as stability goes... it's still in an "alpha" state, so anything goes. We'll be working on more Eu 4.0 oriented version of wxEuphoria once Eu 4.0 begins moving into beta and official release states.
4) I don't yet see how to use TABS (like at top of page) vs Buttons.
Tab controls are called "books" in wxWidgets. This is because a "book" isn't bound to using just tabs (they're referred to as "pages" instead). It can use other controls to select the "tabs" including tabs (wxNotebook), list box (wxListbook), drop-down list (wxChoicebook), tree view (wxTreebook), or tool bar (wxToolbook). See wxBookCtrl for more details. Here is an example of a basic tabbed notebook:
include wxeud.e without warning constant main = create( wxFrame, {0, -1, "Tab Notebook Demo", -1, -1, 400, 300} ), tabs = create( wxNotebook, {main} ) -- fill the notebook with some tab pages atom panel for i = 1 to 5 do panel = create( wxPanel, {tabs} ) add_page( tabs, panel, sprintf("Tab %d", i), wxFalse, 0 ) end for wxMain( main )
-Greg
3. Re: wxScrollBox in Delphi, what is the equivalent in EU... & other ??
- Posted by vmars Jun 09, 2009
- 824 views
Greg, Thank you very much! Those examples are a real gift.
...Vern