1. wxEuphoria v0.11 - wxButton on a child window

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?

new topic     » topic index » view message » categorize

2. Re: wxEuphoria v0.11 - wxButton on a child window

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: wxEuphoria v0.11 - wxButton on a child window

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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: wxEuphoria v0.11 - wxButton on a child window

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: wxEuphoria v0.11 - wxButton on a child window

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu