Re: Win32lib bug - Checkboxes become visible inside TabItems.

new topic     » goto parent     » topic index » view thread      » older message » newer message
marky1124 said...

Thank you both, Dan & Don, for your examples. They both work for me. The key workaround technique being to use the onClick event on the TabItem to hide the checkboxes that the win32lib will have incorrectly made visible. I incorporated the setVisible() calls into my example and it works now, although the example reveals another redraw problem. When toggling the checkboxes from visible to invisible the checkbox inside the group does not disappear until you switch tab. I've had redraw issues with controls inside groups before. I think this is another problem within Win32lib.

<snip>

Doing a repaintWindow(Window1) at the end of the PushButton Onclick routine causes other elements to disappear, the group border lines and the "There's a checkbox below here" label.

Cheers,
Mark

You're right again; a simple and effective work around is to include a "setVisible,0" and then a "setVisible,1" for the GROUP containing the checkbox at the same time as setting the checkbox invisible.

That work-around is in the pushbutton click event.

code follows:

--  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 but tabs selected. 
--  solution is to make them invisible on entry and whenever 
--  selected. 
 
-- now also works around check box in GROUP not being made invisible 
-- until click other tab, by making group vis and then invis at same time 
-- as making checkbox invis. 
-------------------------------------------------------------------------------- 
--  Window Window1 
constant Window1 = createEx( Window, "Window1", 0, 76, 92, 557, 300, 0, 0 ) 
constant TabControl9 = createEx( TabControl, "TabControl9", Window1, 64, 44, 472, 144, 0, 0 ) 
constant TabItem1 = createEx( TabItem, "TabItem1", TabControl9, 0, 0, 0, 0, 0, 0 ) 
constant Group21 = createEx( Group, "Group21", TabItem1, 280, 48, 158, 60, 0, 0 ) 
constant CheckBox3 = createEx( CheckBox, "CheckBox3", Group21, 20, 20, 118, 20, 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) 
       setVisible(CheckBox3, 0) 
end procedure 
setHandler( Window1, w32HActivate, routine_id("Window1_onActivate")) 
-------------------------------------------------------------------------------- 
procedure TabItem1_onClick (integer self, integer event, sequence params)--params is () 
   setVisible(CheckBox1, 0) 
   setVisible(CheckBox3, 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) 
  	 setVisible(CheckBox3, 0) 
  	 setVisible(Group21,0)  -- <-- first change 
  	 setVisible(Group21,1)  -- <-- second change	 
  else 
     setVisible(CheckBox1, 1) 
     setVisible(CheckBox3, 1) 
  end if 
end procedure 
setHandler( PushButton20, w32HClick, routine_id("PushButton20_onClick")) 
 
 
WinMain( Window1,Normal ) 

DanM

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

Search



Quick Links

User menu

Not signed in.

Misc Menu