| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Feb 27, 2003 3:56 pm Post subject: Resizeable Windows |
|
|
Hi,
is there a way to make a resizeable window not resizeable at a specific time and give it the resizeable option later ?
I know there should be a way through setting a variable and do it myself at :resize but is there a "real" way to disable the function ?
bye, Fabian |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Feb 27, 2003 4:32 pm Post subject: |
|
|
Well, like you said, you can use something like this:
| Code: | :Resize
if @equal(%%resize,true)
rem Resize code
else
rem Don't resize
end
goto Evloop |
|
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1754 Location: Space and Time
|
Posted: Thu Feb 27, 2003 5:15 pm Post subject: |
|
|
Well, the dialog would still resize, just the elements on the dialog would not. You would have to make the dialog snap back to a specific size in the resize event or recreate the dialog without the RESIZE option. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Feb 27, 2003 5:59 pm Post subject: |
|
|
So it must be something like this?
| Code: | DIALOG CREATE..........
....................
DIALOG SHOW
%%width = @dlgpos(,w)
%%height = @dlgpos(,h)
%%resize = false
:Evloop
wait event
goto @event()
:Resize
if @equal(%%resize,true)
rem Resize code
else
rem Don't resize
dialog setpos,,,,%%width,%%height
end
goto Evloop |
You can also make a dialog without the RESIZE style, and put bitmaps or textelements with the CLICK style on the sides, which you also can use to resize it... |
|
| Back to top |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Thu Feb 27, 2003 8:51 pm Post subject: |
|
|
It may not be the best way but i had to control the resizing of a non VDS
window from within VDS and I just launched a separate utility at a specific
event. That utility just looped keeping the window at the size I wanted
and I closed it when it was OK to resize the window.
moke |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Feb 28, 2003 7:42 am Post subject: Resize |
|
|
Hi,
I think the easiest way is with code in :resize
I am doing it this way:
if %%resizable
blabla
blabla
else
WINDOW NORMAL,mywindow
end
goto loop
But is there a real way to disable the maxmimize icon at a specific time ?
Bye, Fabian |
|
| Back to top |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Fri Feb 28, 2003 1:49 pm Post subject: |
|
|
I don't remember the exact source(s) but I tried find a way to disable the
maximize icon and all the information appeared to suggest that you
cannot disable or remove the maximize after a window has been
created. I was doing it to a non-VDS window but the information I got
when searching for a way to do it through API seemed to indicate you must
do it when the window is created. This is why I wrote a separate utilty
to keep my window size correct. So, I'm pretty sure you can do it.
moke |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Mar 02, 2003 2:24 am Post subject: |
|
|
The easiest way I've found to do all of the above is to use a child
dialog for the main window. First create a main dialog but DO NOT
show it. You can then close/re-create the child dialog as needed.
Here's a simple example that makes the window ONTOP or not...
| Code: |
rem -- Don't show main, it's easier/safer to
rem -- create and destroy child dialogs at will.
DIALOG CREATE, "Test Prog Main",0,0,0,0
:CreateWindow
if %%ontop
DIALOG CREATE,"Test prog",-1,-1,200,100,ONTOP
else
DIALOG CREATE,"Test prog",-1,-1,200,100
end
DIALOG ADD,BUTTON,B1,5,5,80,20,"On Top"
DIALOG ADD,BUTTON,B2,5,90,80,20,"Not On Top"
DIALOG SHOW
:EVLOOP
WAIT EVENT
goto @event()
:B1BUTTON
DIALOG CLOSE
%%ontop = 1
goto CreateWindow
:B2BUTTON
DIALOG CLOSE
%%ontop = ""
goto CreateWindow
:CLOSE
EXIT
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Mar 02, 2003 3:46 pm Post subject: |
|
|
A minor change to Mac's example which will keep the dialog position.
| Code: | rem -- Don't show main, it's easier/safer to
rem -- create and destroy child dialogs at will.
DIALOG CREATE, "Test Prog Main",0,0,0,0
%%top = -1
%%left = -1
:CreateWindow
if %%ontop
DIALOG CREATE,"Test prog",%%top,%%left,200,100,ONTOP
else
DIALOG CREATE,"Test prog",%%top,%%left,200,100
end
DIALOG ADD,BUTTON,B1,5,5,80,20,"On Top"
DIALOG ADD,BUTTON,B2,5,90,80,20,"Not On Top"
DIALOG SHOW
:EVLOOP
WAIT EVENT
goto @event()
:B1BUTTON
%a = @dlgpos(,TL)
parse "%%top;%%left",%a
DIALOG CLOSE
%%ontop = 1
goto CreateWindow
:B2BUTTON
%a = @dlgpos(,TL)
parse "%%top;%%left",%a
DIALOG CLOSE
%%ontop = ""
goto CreateWindow
:CLOSE
EXIT |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| 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
|
|