| View previous topic :: View next topic |
| Author |
Message |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Mon Mar 14, 2005 5:03 pm Post subject: Using Group Dialogs to group hide & Show |
|
|
Hi all,
has anyone worked with Groups elements , I want to hide a group of elements and show another group of elements once a user hits a button.
The Dialog Hide,Group1 works
but
When I Dialog Show Group2,,, it does not appear.
Becuase of limited space on the window I need Group1 and Group2 to share the same space, is this a known problem
Kind regards
Andy F |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Mar 14, 2005 9:09 pm Post subject: |
|
|
I'm not sure if the problem is that one group element is ontop of the other. I
personally prefer to remove and recreate group elements instead of hiding
or showing them. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Mon Mar 14, 2005 9:25 pm Post subject: |
|
|
There is an example somewhere in the forum which shows how to "hide" elements by repositioning them off the window area. This works very well.
Regards. _________________ John Trappett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Wed Mar 16, 2005 9:22 am Post subject: |
|
|
Hi Bill, thanks for commenting....
The trouble with removing a group is that I assume any data entered by the user will be lossed and so if Group 1 was re-added the data will have disappeared.
| ShinobiSoft wrote: | I'm not sure if the problem is that one group element is ontop of the other. I
personally prefer to remove and recreate group elements instead of hiding
or showing them. |
|
|
| Back to top |
|
 |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Wed Mar 16, 2005 9:29 am Post subject: |
|
|
Hi Trapper,
Thats sounds like a feasable idea
Tried this and was able to make Group1 disappear but Group2 which I set off window at the beginning of the script did not re-appear
Hear is a bit of the code...
DIALOG SETPOS,GROUP3,5,5,5,5
DIALOG SETPOS,GROUP3,286,19,633,184
Dialog SETPOS,Group2,5,5,5,5
Any ideas where I'm going wrong
| trapper wrote: | There is an example somewhere in the forum which shows how to "hide" elements by repositioning them off the window area. This works very well.
Regards. |
|
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Wed Mar 16, 2005 9:44 am Post subject: |
|
|
i once made a program that used group elements for different views.
I had to set each group to different places like "
group 1 shown at first 0,0,100,100
group 2 shown at 200,0,100,100
group 3 shown at 400,0,100,100
then when i wanted to show i just moved each one to 2000,0,100,100
and moved the one i wanted to show to 0,0,100,100
worked pretty good. Sorry i do not have the code anymore. _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Wed Mar 16, 2005 10:17 am Post subject: |
|
|
Thats it I get it now, it seems you can't create a group in the position you want to view originally. So I create the initial Dialig Add,Group1 and Group2 etc etc with coordinates off the window and bring them on when I need them. This works great.
Are there any disadvantages or problems I should be aware of using this method
Is there a better way to achieve this without creating multiple dialog windows
Thanks for everyone input on this question. Great help as always.
Regards Andy F
| kOt wrote: | i once made a program that used group elements for different views.
I had to set each group to different places like "
group 1 shown at first 0,0,100,100
group 2 shown at 200,0,100,100
group 3 shown at 400,0,100,100
then when i wanted to show i just moved each one to 2000,0,100,100
and moved the one i wanted to show to 0,0,100,100
worked pretty good. Sorry i do not have the code anymore. |
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Mar 16, 2005 2:24 pm Post subject: |
|
|
I would treat the groups like a tab page. Just before one is closed, retreive
whatever data there may be, and when one is created/recreated simply
reapply the data that was saved/stored.
Tell ya what, gimme a few, and I'll spit out a simple demo script to explain
what I'm talkin' about.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Mar 16, 2005 3:45 pm Post subject: |
|
|
Maybe this will give you some kind of idea or at least point you in that
direction.
| Code: |
title Groups Test
DIALOG CREATE,Groups Test,-1,0,350,200
REM *** Modified by Dialog Designer on 3/16/05 - 10:24 ***
DIALOG ADD,BUTTON,bBack,170,5,65,25,<< Back
DIALOG ADD,BUTTON,bNext,170,70,65,25,Next >>
DIALOG ADD,BUTTON,Cancel,170,280,65,25,Cancel
DIALOG SHOW
%%page = 1
gosub OpenPage%%page
dialog disable,bBack
:Evloop
wait event
%E = @event()
goto %E
:bBackBUTTON
gosub ClosePage%%page
%%page = @pred(%%page)
gosub OpenPage%%page
if @equal(%%page,1)
dialog disable,bBack
end
if @greater(3,%%page)
dialog enable,bNext
end
goto Evloop
:bNextBUTTON
gosub ClosePage%%page
%%page = @succ(%%page)
gosub OpenPage%%page
if @equal(%%page,3)
dialog disable,bNext
end
if @greater(%%page,1)
dialog enable,bBack
end
goto Evloop
:CancelBUTTON
:CLOSE
exit
:OpenPage1
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page1Text
parse ed1;ed2;ed3,%%page1Text
end
exit
:OpenPage2
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page2Text
parse ed1;ed2;ed3,%%page2Text
end
exit
:OpenPage3
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page3Text
parse ed1;ed2;ed3,%%page3Text
end
exit
:ClosePage1
%%page1Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
:ClosePage2
%%page2Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
:ClosePage3
%%page3Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Thu Mar 17, 2005 2:52 pm Post subject: |
|
|
Many thanks Bill,
I see what your doing and it seems simple enough. Just that I'm used to creating all the dialogs at the beginning of my script. Never thought about doing it this way before.
Do you do this often ? i.e. adding dialogs and removing as you need them rather than up front ?
Should I be thinking about doing this general with my dialogs or is this just a work around becuase of the problems we have discussed ?
Regards
Andy F
| ShinobiSoft wrote: | Maybe this will give you some kind of idea or at least point you in that
direction.
| Code: |
title Groups Test
DIALOG CREATE,Groups Test,-1,0,350,200
REM *** Modified by Dialog Designer on 3/16/05 - 10:24 ***
DIALOG ADD,BUTTON,bBack,170,5,65,25,<< Back
DIALOG ADD,BUTTON,bNext,170,70,65,25,Next >>
DIALOG ADD,BUTTON,Cancel,170,280,65,25,Cancel
DIALOG SHOW
%%page = 1
gosub OpenPage%%page
dialog disable,bBack
:Evloop
wait event
%E = @event()
goto %E
:bBackBUTTON
gosub ClosePage%%page
%%page = @pred(%%page)
gosub OpenPage%%page
if @equal(%%page,1)
dialog disable,bBack
end
if @greater(3,%%page)
dialog enable,bNext
end
goto Evloop
:bNextBUTTON
gosub ClosePage%%page
%%page = @succ(%%page)
gosub OpenPage%%page
if @equal(%%page,3)
dialog disable,bNext
end
if @greater(%%page,1)
dialog enable,bBack
end
goto Evloop
:CancelBUTTON
:CLOSE
exit
:OpenPage1
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page1Text
parse ed1;ed2;ed3,%%page1Text
end
exit
:OpenPage2
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page2Text
parse ed1;ed2;ed3,%%page2Text
end
exit
:OpenPage3
DIALOG ADD,GROUP,grp1,5,5,340,160
DIALOG ADD,TEXT,TEXT1,20,15,75,15,Enter some text:
DIALOG ADD,EDIT,ed1,35,15,320,20
DIALOG ADD,TEXT,TEXT2,65,15,95,15,And some more text:
DIALOG ADD,EDIT,ed2,80,15,320,20
DIALOG ADD,TEXT,TEXT3,110,15,115,15,And yet some more text:
DIALOG ADD,EDIT,ed3,125,15,320,20
if %%page3Text
parse ed1;ed2;ed3,%%page3Text
end
exit
:ClosePage1
%%page1Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
:ClosePage2
%%page2Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
:ClosePage3
%%page3Text = @dlgtext(ed1)|@dlgtext(ed2)|@dlgtext(ed3)
dialog remove,grp1
exit
|
|
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Mar 17, 2005 2:58 pm Post subject: |
|
|
Hi Andy,
For me anyway, it is far simpler to create the dialogs/etc. as I need them
instead of creating them all at once. This method also cuts down on memory
usage, although that prolly isn't an issue with most computers now adays.
We are each individuals and have developed our own coding practices. I
can't say who's way is better or not. You should do whatever you are comfortable doing.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Andy_Fletcher Contributor

Joined: 10 Jun 2003 Posts: 90 Location: Somerset, United Kingdom
|
Posted: Thu Mar 17, 2005 4:36 pm Post subject: |
|
|
Hi Bill
I thought the benefits would mainly be memory issues.
I am a complete novice at programming and to be quite honest I have probably biten off more that I can chew with my current project. That said I am learn and gaining a better understanding of VDS and Code writing from this challenge. Without the kind help I get you all you guys on the forum I would never learn anything.
I'm like a sponge at the moment trying to absorb as much knowledge as I can.
Regards
Andy F
| ShinobiSoft wrote: | Hi Andy,
For me anyway, it is far simpler to create the dialogs/etc. as I need them
instead of creating them all at once. This method also cuts down on memory
usage, although that prolly isn't an issue with most computers now adays.
We are each individuals and have developed our own coding practices. I
can't say who's way is better or not. You should do whatever you are comfortable doing.  |
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Mar 17, 2005 4:57 pm Post subject: |
|
|
I'm gonna be honest with you Andy, a little over 20 years ago I started
programming on the old Apple 2 desktops. Then had several years where I
didn't program at all. I then had about a year piddlin' with an IBM clone
programming for dos. Then I had about 7 or 8 years again where I didn't
touch a computer.
I stumbled upon VDS when I decided to get back into computers. I managed to pick up VDS fairly quickly. After I felt I had a good
understanding of VDS's syntax, I decided I wanted to learn a major
programming language. I bought several development packages and
download a few freeware packages. For a couple years I piddled with
them trying to learn C/C++ to no avail. Some how after tinkering extensively with VDSs @sendmsg() function, I began to
understand C and working with the Windows API. Now I am where I am
today. I still have a lot to learn, but thru perserverance I managed to learn most of a major programming language. And I do attribute this to
my involvement in VDS, as my web site suggests.
So don't give up. And if I can help, please don't hesitate to ask. I'm by
no means a knowledge monger. I'm alway willing to share the knowledge
I have.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| 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
|
|