resize function ON MAXIMIZE / ON SIZE

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2096
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

resize function ON MAXIMIZE / ON SIZE

Post by AUGE_OHR »

hi

i have a RTF and GRID and a Main Form with Macro

Code: Select all

Public fMain:="frmMain"

   DEFINE WINDOW &fMain ;
   ...
   ON MAXIMIZE (GetMain(), Setproperty(fMain, "log_", "Width", (mainWidth-30)/2 ), Setproperty(fMain, "log_", "Height", 100 ),;
                           Setproperty(fMain, "Grid_1", "Width", mainWidth-30 ), Setproperty(fMain, "Grid_1", "Height", mainHeight-170 ));
   ON SIZE     (GetMain(), Setproperty(fMain, "log_", "Width", (mainWidth-30)/2 ), Setproperty(fMain, "log_", "Height", 100 ),;
                           Setproperty(fMain, "Grid_1", "Width", mainWidth-30 ), Setproperty(fMain, "Grid_1", "Height", mainHeight-170 ));
now i like to pass it to a function

Code: Select all

   ON MAXIMIZE DoMax(  GetMain(),fMain, "log_", "Grid_1")  
   ON SIZE     DoSize( GetMain(),fMain, "log_", "Grid_1")
but it seems not to work ... :(

i need a construction like this while more control are coming.
or do i work wrong Way (it is not a FMG) :?:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2096
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: resize function ON MAXIMIZE / ON SIZE

Post by AUGE_OHR »

hi,

got it :D

Code: Select all

   ON MAXIMIZE DoMaximize(fMain) ;
   ON SIZE     DoSize(fMain)     ;

FUNCTION DoMaximize(fMain)
   DoSize(fMain)
RETURN NIL

FUNCTION DoSize(fMain)
   GetMain()  // refresh PUBLIC
   Setproperty(fMain, "log_", "Width", mainWidth/3*2 )
   Setproperty(fMain, "log_", "Height", 100 )
   Setproperty(fMain, "Grid_1", "Width", mainWidth-30 )
   Setproperty(fMain, "Grid_1", "Height", mainHeight-170 )
   ...
RETURN NIL
---

does a "Layout-manager" for "Auto-Resize" exist in harbour / HMG / Extended Version :?:
have fun
Jimmy
Post Reply