Re: wxEuphoria - wxHtmlWindow vs Vista
Matt Lewis wrote:
>
> Jerry Story wrote:
> >
> > Here it is.
>
> This is very strange. What is the point of frmHtml and pnlHtml? I don't
> understand why winHtml gets added to the sizer for pnlHtml, even though
> it's not a child of pnlHtml.
That shows how confused I am about wxFrames and wxPanels and sizers.
Here is a revised version without those useless things.
constant
PROGRAM_TITLE = "This is a test of wxHtmlWindow, revised."
include wxeud.e
constant
win_width = 500,
win_height = 500,
frmWin = create(wxFrame,{0,-1, PROGRAM_TITLE, 0, 0, win_width, win_height}),
Win = create( wxPanel, {frmWin}),
boxMain = create(wxBoxSizer,{wxVERTICAL})
set_sizer(Win,boxMain)
constant
btnShowHtml = create(wxButton,{Win,-1,"Click on this to show the html
window."}),
lblJunk = create(wxStaticText,{Win,-1,"This is a label."}),
txtJunk =create(wxTextCtrl,{Win,-1,"This is a text control."})
add_window_to_sizer(boxMain,btnShowHtml,1,wxGROW,0)
add_window_to_sizer(boxMain,lblJunk,1,wxGROW,0)
add_window_to_sizer(boxMain,txtJunk,1,wxGROW,0)
constant
winHtml = create(wxHtmlWindow,{Win})
set_size(winHtml,win_width,win_height)
procedure show_doc(integer display)
if (display = 1) then
html_append (winHtml,"<P align= \"center\" >"
& "ESC or SPACE or click to exit"
& "<br> "
& "<br><br>")
end if
show_window(winHtml,display)
end procedure -- show_doc()
show_doc(0)
procedure closeHtmlESC(atom this, atom event_type, atom id, atom event)
show_window(winHtml,0)
end procedure
set_event_handler(winHtml,-1,wxEVT_CHAR, routine_id("closeHtmlESC"))
set_event_handler(winHtml,-1,wxEVT_LEFT_UP, routine_id("closeHtmlESC"))
procedure load_html_stuff()
sequence mess
mess = "<html>"
& "<body bgcolor=\"#ffffbb\" text=\"#000055\">"
& "<B>"
& "<FONT size = 3 >"
& "<P align= \"center\" >"
& "<FONT size= 5 color= \"#aa5511\">This is the wxHtmlWindow.</FONT>"
& "<P align= \"left\" >"
& "<br><br> On Ubuntu, this works correctly."
& "<br> <br> On Vista, clicking on this does not work correctly."
& "<br>"
& "</B>"
& "</body></html>"
set_html_page(winHtml,mess)
show_doc(1)
set_focus(winHtml)
end procedure
procedure showHtml(atom this, atom event_type, atom id, atom event)
load_html_stuff()
end procedure
set_event_handler(btnShowHtml,-1,wxEVT_COMMAND_BUTTON_CLICKED,
routine_id("showHtml"))
wxMain(frmWin)
> The problem with the event is that the widgets underneath the html window
> are getting the clicks. I think the solution is probably to have a main
> sizer for the Win panel, and have a sizer for the widgets, and a sizer for
> the html window. Then you can probably use the wxSizer::Hide() routine (not
> wrapped yet) to get the effect you desire.
>
> I'll have to fill out the sizer wrappers. There is a fair amount of
> functionality to be added in that area.
>
> Matt
|
Not Categorized, Please Help
|
|