Resizing the window

Resizing the window

Postby Natter » Sat Jun 11, 2022 6:40 pm

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 ?
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: Resizing the window

Postby cmsoft » Sun Jun 12, 2022 1:07 am

Code: Select all  Expand view

#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
cmsoft
 
Posts: 1285
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Resizing the window

Postby nageswaragunupudi » Sun Jun 12, 2022 4:39 am

Please also try:
Code: Select all  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Resizing the window

Postby Natter » Sun Jun 12, 2022 6:33 am

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

Re: Resizing the window

Postby Natter » Tue Jun 14, 2022 8:52 pm

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 ?
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: Resizing the window

Postby nageswaragunupudi » Wed Jun 15, 2022 8:47 am

Code: Select all  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Resizing the window

Postby Natter » Wed Jun 15, 2022 9:03 am

Yes, the WS_THICKFRAME style is suitable, only the frame turns out to be wide and not beautiful :(
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests