Resize a Dialog

Resize a Dialog

Postby Silvio.Falconi » Tue Feb 12, 2013 12:33 pm

I wish the final user can resize a dialog

this sample (found in this forum ) use a dialog can be resize

and all controls are resize with it

How can I stop resizing the window to a coordinated initial in this case (620, 294)

I explain you : the user can resize the dialog until to maximized but can zoom out only until at (620, 294)




Code: Select all  Expand view  RUN

#include "FiveWin.ch"
#define TCS_MULTILINE 512

function Main()
LOCAL oGet1, oGet2, oGet3, oGet4, oGet5, obtnCancel, obtnChg
LOCAL oFnt, oFnt2, oDlg, oFld, oGrp, oGrp1
LOCAL xVekNo := 11, xREFNO := SPACE(15), xNOTER := SPACE(20)
   
  DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD
    DEFINE FONT oFnt1 NAME "Verdana" SIZE 0, -12

   DEFINE DIALOG oDlg SIZE 620, 294 FONT oFnt1  ;
        STYLE nOr( WS_OVERLAPPEDWINDOW ) TRANSPARENT
    oDlg:SetColor(,9425383)
   
  @ 2, 3 FOLDER oFld OF oDlg SIZE 100, 100 PIXEL  TRANSPARENT;
      PROMPTS "Page 1", "Page 2", "Page 3","Page 4","Page 5","Page 6","Page 7","Page 8","Page 9", "Page 10", ;
      "Page 11", "Page 12", "Page 13","Page 14","Page 15","Page 16","Page 17","Page 18","Page 19", "Page 20",
    oFld:nStyle := nOr( oFld:nStyle, TCS_MULTILINE )
           
  @ 2, 3 GROUP oGrp TO 150, 150 PROMPT " Group Text " OF oFld:aDialogs[ 1 ] PIXEL TRANSPARENT;
    FONT oFnt

    @ 15,10 SAY oSay PROMPT "No" OF oFld:aDialogs[1] PIXEL UPDATE
    @ 13,68 GET oGet1 VAR xVEKNO OF oFld:aDialogs[1] PIXEL RIGHT PICT "@Z 9999999" UPDATE

    @ 15,160 SAY oSay PROMPT "Referans No" OF oFld:aDialogs[1] PIXEL UPDATE
    @ 13,218 GET oGet5 VAR xREFNO OF oFld:aDialogs[1] PIXEL SIZE 60,12 UPDATE

    @ 28,10 SAY "Remarks" OF oFld:aDialogs[1] PIXEL UPDATE
    @ 26,68 GET oGet2 VAR xNOTER OF oFld:aDialogs[1] PIXEL SIZE 80,12 UPDATE

    @ 100,10 BUTTON obtnCancel PROMPT "&Cancel" OF oDlg PIXEL SIZE 50,13 ;
        ACTION oDlg:End()

  oDlg:bResized := {|| ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg) }
    ACTIVATE DIALOG oDlg CENTERED ON INIT ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg)
   
    oFnt:End()
    oFnt1:End()

return nil

PROCEDURE ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg)
LOCAL i
    oFld:nHeight := oDlg:nHeight-80
    oFld:nWidth := oDlg:nWidth-29
   
  FOR i:=1 TO LEN(oFld:aDialogs)
  oFld:aDialogs[i]:SetColor(, oDlg:nClrPane)
  Next
  oFld:Refresh()
 
  oGrp:nHeight := oFld:nHeight-35
  oGrp:nWidth  := oFld:nWidth-17
 
    obtnCancel:nTop := oDlg:nHeight-70
    obtnCancel:nLeft := oDlg:nWidth-125


return
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: Resize a Dialog

Postby Daniel Garcia-Gil » Tue Feb 12, 2013 2:09 pm

Silvio

not use STYLE nOr( WS_OVERLAPPEDWINDOW )
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Resize a Dialog

Postby Silvio.Falconi » Tue Feb 12, 2013 6:31 pm

Sorry Daniel,
If I not use STYLE nOr( WS_OVERLAPPEDWINDOW ) .....I cannot resize the dialog ...

Perhaps I explain bad



I wish enlarge the dialog but I wish to shrink the dialog to the original coordinates, it is possible ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: Resize a Dialog

Postby Daniel Garcia-Gil » Tue Feb 12, 2013 8:11 pm

Sorry silvio

You are rigth. I read wrong
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Resize a Dialog

Postby Silvio.Falconi » Tue Feb 12, 2013 8:27 pm

Thanks to Emg....
I found the solution
I must use aMinMaxInfo it run goooooooooooooodddddddddddd!!!!!!!!!!!

T H A N K S E N R I C O
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests