Re: setVisible on tab pages
- Posted by ZNorQ <znorq at holhaug.com> May 07, 2005
- 449 views
Pete Lomax wrote: > > On Thu, 28 Apr 2005 04:05:19 -0700, ZNorQ <guest at RapidEuphoria.com> > wrote: > > I think you need additional tests around the setVisible call: > }}} <eucode> > include win32lib.ew > constant main=create(Window,"Title",0,410,0,400,350,0) > constant > TabControl56=create(TabControl,"TabControl",main,32,30,200,283,0) > constant TabItem57=create(TabItem,"TabItem",TabControl56,0,0,0,0,0) > constant TabItem58=create(TabItem,"TabItem",TabControl56,0,0,0,0,0) > constant Label58=create(Label,"Label",TabItem57,26,44,169,20,0) > constant Button59=create(Button,"Button",main,277,69,75,30,0) > procedure bh(integer self, integer event, sequence params) > if self or event or sequence(params) then end if > if getTabItem(TabControl56)=TabItem57 then > setVisible(Label58,not isVisible(Label58)) > end if > end procedure > setHandler(Button59,w32HClick,routine_id("bh")) > WinMain(main,Normal) > </eucode> {{{ > > Regards, > Pete > > Pete, First you really gotta explain the -
if self or event or sequence(params) then end if
What would this accomplish? As I understand it, procedure "bh" will only be executed when the button is clicked, alas there WILL be contents in atleast two of those variables (self and event) - and probably params too? Since there is nothing to be executed between "then" and "end if", I really don't get it - and even if there where code between "then" and "end if", it would still be executed every time, am I wrong? Please enlighten me! :D Anyway, I don't think your code would be sufficient, as we gotta consider two criterias here - either is the "general" tab in focus - or not. If it is, I could use Derek's code to test this when the right conditions for the field to be visible is met. But if the "general" tab isn't in focus, I'd have to wait till it is.. The control I'm using to verify the conditions of the field is a set of radio buttons (as childs of a group - which again is a child of the form itself..) ONE of those radio buttons shows the field, the rest hides it. So, if I press the radio button that hides it, but the tab page isn't active - how would I go about showing it when the page is activated (got focus) at a later stage? I guess I'd have to combine it with a setHandler that activates when the user clicks the "general" tab too? Maybe throw in a variable that is either TRUE or FALSE - depending on if the field is supposed to be shown or not? Don't know if I'm way off here, but thanks for the replies anyway. Kenneth / ZNorQ