forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Resizeable Windows

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Thu Feb 27, 2003 3:56 pm    Post subject: Resizeable Windows Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 27, 2003 4:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1754
Location: Space and Time

PostPosted: Thu Feb 27, 2003 5:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 27, 2003 5:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Thu Feb 27, 2003 8:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Fri Feb 28, 2003 7:42 am    Post subject: Resize Reply with quote

Hi,

I think the easiest way is with code in :resize
I am doing it this way:

if %%resizable
blabla
blabla Wink
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
View user's profile Send private message Send e-mail Visit poster's website
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Fri Feb 28, 2003 1:49 pm    Post subject: Reply with quote

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. Sad

moke
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 02, 2003 2:24 am    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 02, 2003 3:46 pm    Post subject: Reply with quote

A minor change to Mac's example which will keep the dialog position. Wink

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group