New topic: 

Setting "Resizeable" dynamically. . .?

<http://forums.realsoftware.com/viewtopic.php?t=19192>

       Page 1 of 1
   [ 11 posts ]                 Previous topic | Next topic         Author  
Message       gberz3           Post subject: Setting "Resizeable" dynamically. 
. .?Posted: Mon Jan 14, 2008 1:44 pm                        
Joined: Sun Jun 24, 2007 1:40 pm
Posts: 426              Hi All, 
 
Is there any way to get a window to toggle "Resizeable" dynamically?  I need to 
adjust a window based on the size of an image that is being opened.  If the 
image dimensions exceed certain values then I stop the adjustment of the window 
and simply allow for the window to be resized *if* desired. 
 
Keep in mind that this isn't a matter of scroll bars, etc.  I've already 
addressed that aspect.  I need the ability to turn "Resizeable" on and off at 
will. 
 
Regards   
                            Top               npalardy           Post subject: 
Posted: Mon Jan 14, 2008 2:13 pm                        
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 5033
Location: Canada, Alberta, Near Red Deer              In the IDE allow the 
window to be resizable since you cannot change this at run time. 
 
Then keep a private property, isResizable, and set it true or false as you 
need. 
 
In the resizing event of the window check the property you created and make the 
window width and height the same as they were if you don't allow resizing.   
                            Top               imikedaman           Post 
subject: Posted: Mon Jan 14, 2008 2:30 pm                               
Joined: Fri Sep 30, 2005 6:55 pm
Posts: 1425              Can you just set the minWidth, maxWidth, minHeight, 
and maxHeight properties?     
_________________
Those who can, do. Those who can't, make excuses.  
                            Top               gberz3           Post subject: 
Posted: Mon Jan 14, 2008 2:59 pm                        
Joined: Sun Jun 24, 2007 1:40 pm
Posts: 426              Yes, and I do that, but only up to 600px by 800px.  
After that I don't want to risk a GIANT image wreaking havoc.  Therefore I make 
it resizable after that point.   
                            Top               gberz3           Post subject: 
Posted: Mon Jan 14, 2008 2:59 pm                        
Joined: Sun Jun 24, 2007 1:40 pm
Posts: 426              npalardy wrote:In the IDE allow the window to be 
resizable since you cannot change this at run time.

Then keep a private property, isResizable, and set it true or false as you need.

In the resizing event of the window check the property you created and make the 
window width and height the same as they were if you don't allow resizing. 
 
 
Hrm,  I might just have to do that.  I'd considered it, but it's also about 
appearance as well.  I don't want the "resizeable" box even available if it 
isn't currently resizable.   
                            Top               npalardy           Post subject: 
Posted: Mon Jan 14, 2008 3:01 pm                        
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 5033
Location: Canada, Alberta, Near Red Deer              you might be able to set 
those at run time and get the same effect 
 
good idea   
                            Top               Steve Garman           Post 
subject: Posted: Mon Jan 14, 2008 3:07 pm                               
Joined: Fri Sep 30, 2005 3:53 pm
Posts: 2772
Location: England              gberz3 wrote:I don't want the "resizeable" box 
even available if it isn't currently resizable. 
The only way I can think of doing that is with two windows, always one hidden 
and the other visible. 
 
You might want a ContainerControl for the contents if they are complex.     
_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r2.1 Professional on Linux Ubuntu 9.04 Desktop
Occasional blog  
                            Top               imikedaman           Post 
subject: Posted: Mon Jan 14, 2008 3:13 pm                               
Joined: Fri Sep 30, 2005 6:55 pm
Posts: 1425              gberz3 wrote:Hrm,  I might just have to do that.  I'd 
considered it, but it's also about appearance as well.  I don't want the 
"resizeable" box even available if it isn't currently resizable. 
Well, first off I'd say it's bad design to show and hide the resize box like 
that. Can you explain in detail why you'd like to do that? If you have 
scrollbars implemented it seems like there'd be no reason the user shouldn't be 
allowed to resize the window to any size they'd like.     
_________________
Those who can, do. Those who can't, make excuses.  
                            Top               joshmax           Post subject: 
Posted: Mon Jan 14, 2008 3:25 pm                               
Joined: Tue Feb 14, 2006 12:16 pm
Posts: 324
Location: New York              There's something you could do with a declare, 
it goes something like this 
 
Code:Declare Sub ChangeWindowAttributes Lib "Carbon" (win as WindowPtr, 
setAttribs as integer, removeAttribs as integer)
ChangeWindowAttributes Self, (some number goes here)
 
 
Unfortunately, I don't know more about this, but I'm sure other people here 
could offer you more help with this statement.     
_________________
My other computer is a Mac Pro  
                            Top               npalardy           Post subject: 
Posted: Mon Jan 14, 2008 3:37 pm                        
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 5033
Location: Canada, Alberta, Near Red Deer              0 if you want to show it 
16 to hide it   
                            Top               asksteve           Post subject: 
Re: Setting "Resizeable" dynamically. . .?Posted: Sun Jul 05, 2009 3:17 pm      
                  
Joined: Sun Jul 05, 2009 3:12 pm
Posts: 1
Location: Ajax, Ontario Canada              joshmax wrote:Code:Declare Sub 
ChangeWindowAttributes Lib "Carbon" (win as WindowPtr, setAttribs as integer, 
removeAttribs as integer)
ChangeWindowAttributes Self, (some number goes here)

npalardy wrote:0 if you want to show it

16 to hide it


Is there a declare for windows that anyone has figured out?
Thanks!   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 11 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to