Resizing the window

Post Reply
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Resizing the window

Post by Natter »

Hi,

There is a window (TWindow) in the style (WS_BORDER, WS_MINIMIZEBOX, WS_SYSMENU), I need to prohibit moving the window borders with the mouse (resizing the window). How to do it ?
User avatar
cmsoft
Posts: 1297
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina
Been thanked: 2 times

Re: Resizing the window

Post by cmsoft »

Code: Select all | Expand


#include "Fivewin.ch"
static  nW, nH
function Main()
local oWnd

DEFINE WINDOW oWnd TITLE "No resize" ;
          NOZOOM FROM 05,05 TO 20,60
nW := oWnd:nWidth
nH := oWnd:nHeight
oWnd:bResized := { || NoResize(oWnd) }
ACTIVATE WINDOW oWnd  

static function NoResize(oWnd)
oWnd:SetSize(nW, nH)
oWnd:Refresh()
return nil

 
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Resizing the window

Post by nageswaragunupudi »

Please also try:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd NOZOOM NOMINIMIZE FROM 0,0 TO 400,600 PIXEL

   oWnd:aMinMaxInfo := { nil, nil, nil, nil, 600, 400, 600, 400 }

   ACTIVATE WINDOW oWnd CENTERED

return nil
 
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Resizing the window

Post by Natter »

Thanks !
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Resizing the window

Post by Natter »

Is it possible to make a TWindow without caption and sysmenu (WS_POPUP) and a frame so that it can be stretched with the mouse ?
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Resizing the window

Post by nageswaragunupudi »

Code: Select all | Expand

  DEFINE WINDOW oWnd STYLE WS_THICKFRAME FROM 0,0 TO 400,600 PIXEL
   oWnd:bRClicked := { || oWnd:End() }
   ACTIVATE WINDOW oWnd CENTERED
 
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Resizing the window

Post by Natter »

Yes, the WS_THICKFRAME style is suitable, only the frame turns out to be wide and not beautiful :(
Post Reply