Re: Win32lib bug - Checkboxes become visible inside TabItems.

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

Mark,

I think you're right about the bug, though your example worked slightly differently on my system, different Win32Lib version.

Here's a work-around:
set all desired checkboxes invisible in the "Window1_onActivate" event, and then also set each tabs desired continued invisible checkboxes invisible in that tabs "onClick" event. And of course, provide for making the checkboxes visible when desired.

Example follows. Hope it works with your version Win32Lib

DanM

--  code generated by Win32Lib IDE v0.20.1 
 
  
include Win32Lib.ew 
without warning 
 
-- intent is to test/solve problem with check box on tab 
-- not being invisible when set invisible initially, but tabs subsequently selected. 
--  solution is to make them invisible on program entry and whenever tab is 
--  selected. 
-------------------------------------------------------------------------------- 
--  Window Window1 
constant Window1 = createEx( Window, "Window1", 0, 76, 92, 400, 300, 0, 0 ) 
constant TabControl9 = createEx( TabControl, "TabControl9", Window1, 60, 44, 288, 144, 0, 0 ) 
constant TabItem1 = createEx( TabItem, "TabItem1", TabControl9, 0, 0, 0, 0, 0, 0 ) 
constant CheckBox1 = createEx( CheckBox, "CheckBox1", TabItem1, 20, 68, 148, 20, 0, 0 ) 
constant LText13 = createEx( LText, "INVISIBLE CHECK BOX BELOW", TabItem1, 16, 48, 184, 20, 0, 0 ) 
constant CheckBox16 = createEx( CheckBox, "CheckBox16", Window1, 848, 128, 148, 20, 0, 0 ) 
constant TabItem2 = createEx( TabItem, "TabItem2", TabControl9, 0, 0, 0, 0, 0, 0 ) 
constant CheckBox2 = createEx( CheckBox, "CheckBox2", TabItem2, 20, 68, 148, 20, 0, 0 ) 
constant LText19 = createEx( LText, "invisible check box below", TabItem2, 16, 48, 148, 20, 0, 0 ) 
constant PushButton20 = createEx( ToggleButton, "CLICK to make CheckBox vis or invis", TabItem1, 16, 92, 204, 28, 0, 0 ) 
--------------------------------------------------------- 
-------------------------------------------------------------------------------- 
procedure Window1_onActivate (integer self, integer event, sequence params)--params is () 
       setVisible(CheckBox1, 0) 
       setVisible(CheckBox2, 0) 
end procedure 
setHandler( Window1, w32HActivate, routine_id("Window1_onActivate")) 
-------------------------------------------------------------------------------- 
procedure TabItem1_onClick (integer self, integer event, sequence params)--params is () 
   setVisible(CheckBox1, 0) 
end procedure 
setHandler( TabItem1, w32HClick, routine_id("TabItem1_onClick")) 
-------------------------------------------------------------------------------- 
procedure TabItem2_onClick (integer self, integer event, sequence params)--params is () 
  setVisible(CheckBox2, 0) 
end procedure 
setHandler( TabItem2, w32HClick, routine_id("TabItem2_onClick")) 
-------------------------------------------------------------------------------- 
procedure PushButton20_onClick (integer self, integer event, sequence params)--params is () 
  if isVisible(CheckBox1) then 
  	 setVisible(CheckBox1, 0) 
  else 
     setVisible(CheckBox1, 1) 
  end if 
end procedure 
setHandler( PushButton20, w32HClick, routine_id("PushButton20_onClick")) 
 
 
WinMain( Window1,Normal ) 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu