If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > another question about forms in pdox 7

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-04, 12:41
cmose cmose is offline
Registered User
 
Join Date: Apr 2004
Posts: 16
another question about forms in pdox 7

does anyone know if it is possible to a) keep a form from being "resize" by a user, e.g., if they drag on the corner, they are unable to resize the item, or b) allow a form to be resized in the windows sense, e.g., dragging corner will actually resize form and not just resize window with form on a white background?
many thanks.
Reply With Quote
  #2 (permalink)  
Old 05-20-04, 04:57
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
Sure:

a) You cannot keep the user from resizing the form, but you can make the form return automatically to the max size it should be by means of this simple code:

method menuAction(var eventInfo MenuEvent)
var
it smallint
endvar
it=eventinfo.id()
switch
case it = MenuControlRestore:
autosize()
case it = MenuControlSize:
autosize()
endswitch
endmethod

method autosize()
var
x,y,w,h longint
scroll longint
border longint
title longint
wconst longint
hconst longint
endvar

scroll=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","ScrollWidth",RegKe yCurrentUser))
scroll=-(scroll) ;/TwipsPerPixel)

border=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","BorderWidth",RegKe yCurrentUser))
border=-(border) ;/TwipsPerPixel)

title=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","CaptionHeight",Reg KeyCurrentUser))
title=-(title) ;/TwipsPerPixel)

wconst=(9*TwipsPerPixel) ;7 con riga, 6 senza
hconst=(10*TwipsPerPixel) ;8 con riga, 7 senza

delayscreenupdates(yes)
self.getposition(x,y,w,h)
tmppt1=self.size
tmppt2=self.nameofabutton.container.size

switch

;Out in the low right angle
case tmppt1.x() > tmppt2.x() and tmppt1.y() > tmppt2.y():
w=tmppt2.x() + (border*2) + wconst
h=tmppt2.y() + (border*2) + title + hconst
self.setposition(x,y,w,h)

;out horizontally
case tmppt1.x() > tmppt2.x():
w=tmppt2.x() + scroll + (border*2) + wconst
self.setposition(x,y,w,h)

;out vertically
case tmppt1.y() > tmppt2.y():
h=tmppt2.y() + scroll + title + (border*2) + hconst
self.setposition(x,y,w,h)

;not out
otherwise:
endswitch
delayscreenupdates(no)
endMethod

(You shoud replace the "nameofabutton" with the name of a button or other object that's containesd in the page.)

b) Sure, but there's no authomatic means of doing this: you can mess with the zoom property of the form, or you can implement a message passing that will make the resizing of the form resize also any control on it, but this will be much work.
__________________
The only failure is not trying to do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On