1. wxEuphoria v0.11 - wxButton on a child window
- Posted by Jerry Story <story.jerry at g?ail.c?m> Dec 10, 2007
- 530 views
This is the code.
constant frmHtml = create(wxFrame,{Win,-1,"DMAK - documentation"}), pnlHtml = create(wxPanel,{frmHtml}), boxHtml = create(wxBoxSizer,{wxVERTICAL}), btnHtml = create(wxButton,{Win,-1, "Click here or Press ESC to exit to main; <- -> arrows to navigate."}), winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. set_sizer(pnlHtml,boxHtml) set_size(btnHtml,win_width,50) set_size(winHtml,win_width,win_height-100) add_window_to_sizer(boxHtml,btnHtml,1,wxGROW,0) add_window_to_sizer(boxHtml,winHtml,1,wxGROW,1)
What it is supposed to do and what it did on v0.9: It is supposed to make a wide button and a wxHtmlWindow. Both are on a child window. What it does on v0.11: It makes the wxHtmlWindow, but no button. Instead of a button, there is a space the size and shape of the button and the parent window shows thru the space. How can I get the button back?
2. Re: wxEuphoria v0.11 - wxButton on a child window
- Posted by Matt Lewis <matthewwalkerlewis at g?ail.?om> Dec 10, 2007
- 524 views
Jerry Story wrote: > > This is the code. > > }}} <eucode> > > constant > frmHtml = create(wxFrame,{Win,-1,"DMAK - documentation"}), > pnlHtml = create(wxPanel,{frmHtml}), > boxHtml = create(wxBoxSizer,{wxVERTICAL}), > btnHtml = create(wxButton,{Win,-1, > "Click here or Press ESC to exit to main; <- -> arrows to navigate."}), > winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. > > set_sizer(pnlHtml,boxHtml) > set_size(btnHtml,win_width,50) > set_size(winHtml,win_width,win_height-100) > add_window_to_sizer(boxHtml,btnHtml,1,wxGROW,0) > add_window_to_sizer(boxHtml,winHtml,1,wxGROW,1) > > </eucode> {{{ > > What it is supposed to do and what it did on v0.9: > It is supposed to make a wide button and a wxHtmlWindow. > Both are on a child window. > > What it does on v0.11: > It makes the wxHtmlWindow, but no button. > Instead of a button, there is a space the size and shape of the button and the > parent window shows thru the space. > > How can I get the button back? I'm surprised that this worked in v0.9. I don't understand the relationships you've created here. I don't know what Win is, but you have the button and the wxHtmlWindow with Win as their parents. But then you add it to a sizer associated with frmHtml. I'd say that if you want the html and the button to be on frmHtml, then that should be their parent, too. Matt
3. Re: wxEuphoria v0.11 - wxButton on a child window
- Posted by Jerry Story <story.jerry at gma?l.co?> Dec 10, 2007
- 496 views
- Last edited Dec 11, 2007
Matt Lewis wrote: > > Jerry Story wrote: > > > > This is the code. > > > > }}} <eucode> > > > > constant > > frmHtml = create(wxFrame,{Win,-1,"DMAK - documentation"}), > > pnlHtml = create(wxPanel,{frmHtml}), > > boxHtml = create(wxBoxSizer,{wxVERTICAL}), > > btnHtml = create(wxButton,{Win,-1, > > "Click here or Press ESC to exit to main; <- -> arrows to navigate."}), > > winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. > > > > set_sizer(pnlHtml,boxHtml) > > set_size(btnHtml,win_width,50) > > set_size(winHtml,win_width,win_height-100) > > add_window_to_sizer(boxHtml,btnHtml,1,wxGROW,0) > > add_window_to_sizer(boxHtml,winHtml,1,wxGROW,1) > > > > </eucode> {{{ > > > > What it is supposed to do and what it did on v0.9: > > It is supposed to make a wide button and a wxHtmlWindow. > > Both are on a child window. > > > > What it does on v0.11: > > It makes the wxHtmlWindow, but no button. > > Instead of a button, there is a space the size and shape of the button and > > the > > parent window shows thru the space. > > > > How can I get the button back? > > I'm surprised that this worked in v0.9. I don't understand the relationships > you've created here. I don't know what Win is, but you have the button and > > the wxHtmlWindow with Win as their parents. But then you add it to a > sizer associated with frmHtml. > > I'd say that if you want the html and the button to be on frmHtml, then > that should be their parent, too. > > Matt Win is the main wxPanel. When I change 'Win' (the main wxPanel) to 'pnlHtml' (a wxPanel) like this btnHtml = create(wxButton,{Win,-1, winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. btnHtml = create(wxButton,{pnlHtml,-1, winHtml = create(wxHtmlWindow,{pnlHtml,-1,-1,50}) -- This is the main part. then nothing happens. Also when I change to 'frmHtml' (a wxFrame) nothing happens. btnHtml = create(wxButton,{frmHtml,-1, winHtml = create(wxHtmlWindow,{frmHtml,-1,-1,50}) -- This is the main part. Child windows and wxPanels and wxFrames confuse me. I usually fiddle with them without completely knowing what I'm doing until something works.
4. Re: wxEuphoria v0.11 - wxButton on a child window
- Posted by Matt Lewis <matthewwalkerlewis at ?mail.co?> Dec 11, 2007
- 523 views
Jerry Story wrote: > > Win is the main wxPanel. > > When I change 'Win' (the main wxPanel) to 'pnlHtml' (a wxPanel) like this > > btnHtml = create(wxButton,{Win,-1, > winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. > > btnHtml = create(wxButton,{pnlHtml,-1, > winHtml = create(wxHtmlWindow,{pnlHtml,-1,-1,50}) -- This is the main part. > > then nothing happens. > > Also when I change to 'frmHtml' (a wxFrame) nothing happens. > > btnHtml = create(wxButton,{frmHtml,-1, > winHtml = create(wxHtmlWindow,{frmHtml,-1,-1,50}) -- This is the main part. > > Child windows and wxPanels and wxFrames confuse me. I usually fiddle with them > without completely knowing what I'm doing until something works. For most controls, their parents are the windows in which they appear. wxFrames are a little different, since they float on their own. They don't necessarily need a parent. Changing the parents to other than the window where the controls should appear is likely to give weird results (and probably different by platform). Matt
5. Re: wxEuphoria v0.11 - wxButton on a child window
- Posted by Jerry Story <story.jerry at ?mai?.com> Dec 11, 2007
- 500 views
Jerry Story wrote: > > This is the code. > > }}} <eucode> > > constant > frmHtml = create(wxFrame,{Win,-1,"DMAK - documentation"}), > pnlHtml = create(wxPanel,{frmHtml}), > boxHtml = create(wxBoxSizer,{wxVERTICAL}), > btnHtml = create(wxButton,{Win,-1, > "Click here or Press ESC to exit to main; <- -> arrows to navigate."}), > winHtml = create(wxHtmlWindow,{Win,-1,-1,50}) -- This is the main part. > > set_sizer(pnlHtml,boxHtml) > set_size(btnHtml,win_width,50) > set_size(winHtml,win_width,win_height-100) > add_window_to_sizer(boxHtml,btnHtml,1,wxGROW,0) > add_window_to_sizer(boxHtml,winHtml,1,wxGROW,1) > > </eucode> {{{ The above code doesn't show the button. Putting the button on pnlHtml didn't work either. Strange. The below code shows the button.
constant frmHtml = create(wxFrame,{Win,-1,"DMAK - documentation"}), pnlHtml = create(wxPanel,{frmHtml}), boxHtml = create(wxBoxSizer,{wxVERTICAL}), winHtml = create(wxHtmlWindow,{Win}), -- This is the main part. btnHtml = create(wxButton,{winHtml,-1, "Click here or Press ESC to exit to main; <- -> arrows to navigate."}) set_sizer(pnlHtml,boxHtml) set_size(btnHtml,win_width,50) set_size(winHtml,win_width,win_height)
I put the button on the HtmlWindow.