Re: wxEuphoria - wxHtmlWindow vs Vista

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matt Lewis wrote:
> 
> I think that the problem is that the parent-child relationships are 
> incorrect.  winHtml is parented to Win, but it's put into the sizer for
> pnlHtml, which is the panel for a different frame.
> 
> In any case, this code doesn't run.  If fixing the parent-child relationship
> (or maybe putting it into a different sizer) don't help, then please
> refactor this into a working, minimal program that displays the problem
> behavior, and I'll take another look at it.
> 
> Matt


Here it is.

constant
 PROGRAM_TITLE = "This is a test of wxHtmlWindow."

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
 frmHtml = create(wxFrame,{Win,-1,"Test wxHtmlWindow"}),
 pnlHtml = create(wxPanel,{frmHtml}),
 boxHtml = create(wxBoxSizer,{wxVERTICAL}),
 winHtml = create(wxHtmlWindow,{Win})

set_sizer(pnlHtml,boxHtml)
set_size(winHtml,win_width,win_height)
add_window_to_sizer(boxHtml,winHtml,1,wxGROW,0)


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)


new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu