| View previous topic :: View next topic |
| Author |
Message |
Teamgreentech Valued Newbie
Joined: 07 Dec 2010 Posts: 46 Location: Somerset
|
Posted: Mon Feb 21, 2011 11:20 pm Post subject: Problem with Hiding one TAB dialog and Showing another |
|
|
Hi All, here's a wierd one, I'm trying to hide a group of dialog elements by using Dialog Hide TAB1 and then Dialog Show, TAB2 which will have a number of different elements on it but when I run the script or compile and run the exe, The TAB1 hide and all the elements but
No TAB2 shows or any elements that were created after TAB2 was created.
Can anyone advise what I might be doing wrong or if my approach is wrong ?
Many thanks for any help that can be offered.... _________________ Many thanks
Andy @ Team Green Technology |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Feb 22, 2011 5:17 am Post subject: |
|
|
I seem to remember something about having to use the LINE or GROUP element with Tabs due to the issue you just described.
Note: You don't have to use groups but you will have to use a Dialog Show or Hide for every element in the Tab if you don't.
Maybe you are using two Tab elements when you should be using one.
You don't add a TAB element for each tab in a set. The tabs themselves are defined in the Tab element separated by vertical bars "|"
Here is a sort of template for ya...
| Code: | DIALOG ADD,TAB,<name>,<top>,<left>,<width>,<height>,<tabs [TabName1|TabName2|etc..]>,<tooltip>,<styles>
DIALOG ADD,GROUP,TabName1Group,<top>,<left>,<width>,<height>,<caption>,<tooltip>,<styles>
#Add TabName1Group elements next
DIALOG ADD,GROUP,TabName2Group,<top>,<left>,<width>,<height>,<caption>,<tooltip>,<styles>
#Add TabName2Group elements next
#etc...
#Tab Click Events
:<TabName1>CLICK
Dialog hide,TabName2Group
Dialog show,TabName1Group
goto evloop
:<TabName2>CLICK
Dialog hide,TabName1Group
Dialog show,TabName2Group
goto evloop |
Hope this helps  |
|
| Back to top |
|
 |
Teamgreentech Valued Newbie
Joined: 07 Dec 2010 Posts: 46 Location: Somerset
|
Posted: Tue Feb 22, 2011 9:29 am Post subject: |
|
|
Hi Aslan, many thanks for getting backj to me so quickly that's magic and I kinda thought there would be an issue with using Group elements to sort this
I've done plenty of mini dialog scripts in the past with TAB elements but only needing one and yes I understand how to construct them but appreciate your thoughts to cover the issue there
This is the first sort of attempt to create two very separate area's one for Admin and configs etc and so want to have a group of elements on Tabs that are completely separate and not visable to the user so to speak
Your answer should give me enough to sort this but if you can think of any other useful tips they will all be appreciated. _________________ Many thanks
Andy @ Team Green Technology |
|
| Back to top |
|
 |
Teamgreentech Valued Newbie
Joined: 07 Dec 2010 Posts: 46 Location: Somerset
|
Posted: Tue Feb 22, 2011 10:23 am Post subject: |
|
|
Okay, so I've played around with this idea and basically could not get it to work at all
So I'm thinking maybe create a child window ?
Do you know whether there is a good example I could work from..
Don't get me wrong I would much prefer to use Group & Tab to create new screens so to speak than all that looping around to create child windows
Thanks in advance for any advice and suggestions on this.... _________________ Many thanks
Andy @ Team Green Technology |
|
| Back to top |
|
 |
Teamgreentech Valued Newbie
Joined: 07 Dec 2010 Posts: 46 Location: Somerset
|
Posted: Tue Feb 22, 2011 11:16 am Post subject: |
|
|
Hi Aslan and anyone else who might be able to help, here's a snipet of code I am working on for this problem.
Perhaps there is something obvious here I just can't see
---Start Snippet-----
DIALOG ADD,GROUP,TAB1GROUP,93,2,1237,768
DIALOG ADD,TAB,TAB1,94,4,1237,768,Home|Packing|Rejections|Dispatch|Inwards|Packing Updates|Orders|Advanced Analytics|Live Statistics|Spray Records,,STYLE1,HAND
DIALOG ADD,BROWSER,Home,129,4,1229,727,http://domain/pms.php
DIALOG ADD,STATUS,STATUS1,Home Page
DIALOG ADD,BROWSER,Packing,333,6,1227,524,About:Blank
DIALOG ADD,BROWSER,PackHeader,120,6,1227,214,About:Blank
DIALOG ADD,BROWSER,Rejections,122,5,1233,737,About:Blank
DIALOG ADD,BROWSER,DispHeader,123,6,1227,207,About:Blank
DIALOG ADD,BROWSER,Dispatch,331,6,1227,576,About:Blank
DIALOG ADD,BROWSER,Inwards,121,3,1234,740,About:Blank
DIALOG ADD,BROWSER,PackingUpdates,123,7,1229,737,About:Blank
DIALOG ADD,BROWSER,Orders,124,8,1229,735,About:Blank
DIALOG ADD,BROWSER,AdvancedAnalytics,121,5,1233,737,About:Blank
DIALOG ADD,BROWSER,Statistics,122,6,1229,737,About:Blank
DIALOG ADD,BROWSER,SprayRecords,127,7,1229,732,About:Blank
DIALOG ADD,MENU,File,Open,Save,Save As,Print,Exit
DIALOG ADD,MENU,Settings,Administration,Users,Security,Variables,Exit
DIALOG ADD,BITMAP,Greenhouses,3,4,190,85,C:\TGTPMS\Images\Greenhouses.bmp,,STRETCH
DIALOG ADD,BITMAP,Trucks,3,1069,169,86,C:\TGTPMS\Images\TGG-Trucks.bmp,,STRETCH
DIALOG ADD,BITMAP,Teamgreen,3,441,383,79,C:\TGTPMS\Images\TeamGreen.bmp,,STRETCH
DIALOG ADD,BITMAP,Packline,4,896,169,84,C:\TGTPMS\Images\Packline.bmp,,STRETCH
DIALOG ADD,BITMAP,Strawbs,4,200,159,84,C:\TGTPMS\Images\Strawbs.bmp,,STRETCH
DIALOG ADD,GROUP,TAB2GROUP,141,70,1113,651
DIALOG ADD,TAB,TAB2,151,78,1097,628,Users|Administration|Security|Variables|Settings,,STYLE1,HAND
DIALOG ADD,BROWSER,Admin,227,95,1064,524,About:Blank
DIALOG SHOW
Dialog Hide,TAB2
Dialog Hide,TAB2GROUP
Dialog Hide,Packing
Dialog Hide,PackHeader
Dialog Hide,Rejections
Dialog Hide,Dispatch
Dialog Hide,DispHeader
Dialog Hide,Inwards
Dialog Hide,PackingUpdates
Dialog Hide,Orders
Dialog Hide,AdvancedAnalytics
Dialog Hide,Statistics
Dialog Hide,SprayRecords
Dialog Set,TAB1,Home
:Timer
%A = @Datetime(hh:nn:ss)
Dialog Set,Status1,%A %%Copyright
:Evloop
wait event,1
%E = @event()
If @null(%E)
Goto Timer
Else
Goto %E
:Administrationmenu
Dialog Hide,TAB1GROUP
Dialog Hide,TAB1
Dialog Show,TAB2GROUP
Dialog Show,TAB2
Dialog Set,TAB2,Administration
Dialog Show,Admin
Dialog Set,Admin,Http://Domain/blahblah.php
goto evloop
:AdministrationClick
%%Browser = "Administration"
Dialog Show,Administration
Dialog Set,TAB2,Admin
Dialog Set,Admin,Http://Domain/blahblah.php
goto evloop
-----End Snippet ----------
When I click on the Administration Menu, the menu click event runs and hids TAB1GROUP and TAB2GROUP is shown but the Browser element "Admin" does not show  _________________ Many thanks
Andy @ Team Green Technology |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Feb 22, 2011 3:18 pm Post subject: |
|
|
Ok, looking at your example, you can't create the second tab element inside the first one because the TAB element will act like a GROUP element as far as the elements contained in it. Create the second tab and its elements the outside the boundaries of the first making sure you place the elements inside the boundaries of the second tab then use "DIALOG SETPOS" to realign the second tab and the elements contained in it. You would use this same principal with GROUPS that you need in the same space on the dialog.
I modified your example (changed browser elements to lists for dialog designer purposes). Notice where I originally placed TAB2 and ADMIN then you will see where I reset the position with "DIALOG SETPOS".
Note: I didn't use groups since there is only one element on each tab.
| Code: | TITLE TEST
DIALOG CREATE,TAB TEST,-1,0,1255,892
DIALOG ADD,STATUS,STATUS1,Home Page
DIALOG ADD,TAB,TAB1,93,9,1237,768,Home|Packing|Rejections|Dispatch|Inwards|Packing Updates|Orders|Advanced Analytics|Live Statistics|Spray Records,,HAND
DIALOG ADD,LIST,Home,125,19,1216,724,Home
DIALOG ADD,LIST,Packing,125,19,1216,724,Packing
DIALOG ADD,LIST,PackHeader,125,19,1216,724,PackHeader
DIALOG ADD,LIST,Rejections,125,19,1216,724,Rejections
DIALOG ADD,LIST,DispHeader,125,19,1216,724,DispHeader
DIALOG ADD,LIST,Dispatch,125,19,1216,724,Dispatch
DIALOG ADD,LIST,Inwards,125,19,1216,724,Inwards
DIALOG ADD,LIST,PackingUpdates,125,19,1216,724,PackingUpdates
DIALOG ADD,LIST,Orders,125,19,1216,724,Orders
DIALOG ADD,LIST,AdvancedAnalytics,125,19,1216,724,AdvancedAnalytics
DIALOG ADD,LIST,Statistics,125,19,1216,724,Statistics
DIALOG ADD,LIST,SprayRecords,125,19,1216,724,SprayRecords
DIALOG ADD,MENU,File,Open,Save,Save As,Print,Exit
DIALOG ADD,MENU,Settings,Administration,Users,Security,Variables,Exit
# Lets temporarily create TAB2 and its containing elements outside of TAB1
DIALOG ADD,TAB,TAB2,10,9,10,10,Users|Administration|Security|Variables|Settings,,HAND
DIALOG ADD,LIST,Admin,12,19,1,1,Admin
DIALOG SHOW
Dialog Hide,TAB2
Dialog Hide,Packing
Dialog Hide,PackHeader
Dialog Hide,Rejections
Dialog Hide,Dispatch
Dialog Hide,DispHeader
Dialog Hide,Inwards
Dialog Hide,PackingUpdates
Dialog Hide,Orders
Dialog Hide,AdvancedAnalytics
Dialog Hide,Statistics
Dialog Hide,SprayRecords
Dialog Set,TAB1,Home
# Now we will change the position of TAB2 and its elements to where we really want them
Dialog setpos,TAB2,93,9,1237,768
Dialog setpos,Admin,125,19,1216,724
:Timer
%A = @Datetime(hh:nn:ss)
Dialog Set,Status1,%A %%Copyright
:Evloop
wait event,1
%E = @event()
If @null(%E)
Goto Timer
Else
Goto %E
:Administrationmenu
Dialog Hide,TAB1
Dialog Show,TAB2
Dialog Set,TAB2,Administration
Dialog Show,Admin
Dialog Set,Admin,Http://Domain/blahblah.php
goto evloop
:AdministrationClick
%%Browser = "Administration"
Dialog Show,Administration
Dialog Set,TAB2,Admin
goto evloop
:CLOSE
exit |
|
|
| Back to top |
|
 |
Teamgreentech Valued Newbie
Joined: 07 Dec 2010 Posts: 46 Location: Somerset
|
Posted: Tue Feb 22, 2011 6:12 pm Post subject: |
|
|
Hi Aslan, great work around mate and got me away from the "Group" issue so many thanks for your pointers on this problem I would have been messing around for days with your help.
TTFN _________________ Many thanks
Andy @ Team Green Technology |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|