autoscale

This forum is for eXpress++ general support.
Post Reply
Message
Author
Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

autoscale

#1 Post by Zdeno Bielik »

Hi Roger,

please, how can be reconfigured/refreshed/recreated current oDialog via pressing Ctrl+P or Ctrl+M or by clicking on respective pushbuttons in actual dialog?
I tried some combinations ( oDialog:Hide(), oDialog:Configure(), oDialog:Show(), oDialog:invalidateRect(), DC_GetRefresh( GetList )...), but without success.

TIA
Zdeno
Attachments
SCALE.zip
(2.35 KiB) Downloaded 731 times

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: autoscale

#2 Post by Zdeno Bielik »

ok, with this workaround it works how I need
may be someone has better solution
Attachments
SCALE.zip
(2.82 KiB) Downloaded 674 times

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: autoscale

#3 Post by Zdeno Bielik »

a little update...
Attachments
SCALE.zip
(2.8 KiB) Downloaded 657 times

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: autoscale

#4 Post by rdonnay »

I will look at it and give you some suggestions.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: autoscale

#5 Post by rdonnay »

Zdeno -

It appears that you have figured out how to do what you want.

Unfortunately, using scaling the way you want to do it ( + and - ) requires rebuilding the dialog.

I believe that this can be accomplished in another way that does NOT require rebuilding but instead using Auto Resize and Automatic Font scaling.

I will write a sample for you.

BTW - I have 2 other suggestions:

1. Do NOT use DCMXPUSHBUTTON any more. It is no longer supported. This was written by a 3rd party who does not support it. Use DCPUSHBUTTONXP as a replacement.

2. You do not need to use DC_DebugBrowse() in code blocks. You can use WTF by simply placing the command in parenthesis.
Example: {|| (wtf date(), time()) }
This is simpler.

Roger
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: autoscale

#6 Post by rdonnay »

Replace TestWindow() with the below code. This uses DCGUI_RESIZE_AUTORESIZE_SCALEFONT.

Code: Select all

FUNCTION TestWindow( aScale, cSayFont, cGetFont, cDefaultFont )

LOCAL GetList[0], GetOptions, oTab1, oTab2, oTab3, cTest := 'This is a Get', ;
      lCheck := .T., nRadio := 1, oBrowse, aDir, cMemo, aBrowPres, ;
      oDialog, cSay, bSay                                                              && added

aBrowPres := ;
  { { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE },            /* Header FG Color  */  ;
    { XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY },         /* Header BG Color  */  ;
    { XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_DOTTED }, /* Row Sep          */  ;
    { XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_DOTTED }, /* Col Sep          */  ;
    { XBP_PP_COL_DA_FGCLR, GRA_CLR_BLACK },            /* Row FG Color     */  ;
    { XBP_PP_COL_DA_BGCLR, GRA_CLR_WHITE },            /* Row BG Color     */  ;
    { XBP_PP_COL_DA_ROWHEIGHT, 14 },                   /* Row Height       */  ;
    { XBP_PP_COL_HA_HEIGHT, 10 },                      /* Header Height    */  ;
    { XBP_PP_HILITE_FGCLR, GRA_CLR_WHITE },            /* Hilite FG color  */  ;
    { XBP_PP_HILITE_BGCLR, GRA_CLR_BLUE },             /* Hilite BG color  */  ;
    { XBP_PP_COL_FA_FGCLR, GRA_CLR_WHITE },            /* Footer FG Color  */  ;
    { XBP_PP_COL_FA_BGCLR, GRA_CLR_DARKGRAY },         /* Footer BG Color  */  ;
    { XBP_PP_COL_FA_HEIGHT, 10 }                       /* Footer Height    */  ;
  }

cMemo := 'This is a memo'

@ 0,0 DCTABPAGE oTab1 SIZE 50,14 CAPTION 'Tab 1' ;
      COLOR GRA_CLR_YELLOW

@ 3,10 DCSAY 'This is a SAY' GET cTest PARENT oTab1 ;
   COLOR GRA_CLR_BLACK, GRA_CLR_WHITE SAYRIGHTCENTER

@ 4,10 DCSAY 'This is a SAY' GET cTest PARENT oTab1 ;
   COLOR GRA_CLR_BLACK, GRA_CLR_BLUE SAYRIGHTCENTER

@ 5,10 DCSAY 'This is a SAY' GET cTest PARENT oTab1 ;
   COLOR GRA_CLR_BLACK, GRA_CLR_WHITE SAYRIGHTCENTER ;
   GETSIZE 20

@ 6,10 DCSAY 'This is a SAY' GET cTest PARENT oTab1  ;
   COLOR GRA_CLR_BLACK, GRA_CLR_BLUE SAYRIGHTCENTER

@ 8,10 DCCHECKBOX lCheck PROMPT 'This is a Checkbox' PARENT oTab1
@ 9,10 DCRADIO nRadio VALUE 1 PROMPT 'This is a Radio Button' PARENT oTab1

@ 11, 5 DCPUSHBUTTON CAPTION 'Button 1' SIZE 10,1.2 PARENT oTab1

@ 11, 20 DCPUSHBUTTON CAPTION 'Button 2' SIZE 10,1.2 PARENT oTab1

@ 11, 35 DCPUSHBUTTON CAPTION 'Button 3' SIZE 10,1.2 PARENT oTab1

* -----------

@ 0,0 DCTABPAGE oTab2 RELATIVE oTab1 CAPTION 'Tab 2' ;
      COLOR GRA_CLR_CYAN

@ 2,2 DCMULTILINE cMemo SIZE 46,11 PARENT oTab2

* -----------

@ 0,0 DCTABPAGE oTab3 RELATIVE oTab2 CAPTION 'Tab 3' ;
      COLOR GRA_CLR_WHITE

aDir := Directory()

@ 2,2 DCBROWSE oBrowse DATA aDir SIZE 46,11 ;
      PRESENTATION aBrowPres PARENT oTab3 FIT

DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 9 PARENT oBrowse
DCBROWSECOL ELEMENT 2 HEADER 'File Size' WIDTH 6 PARENT oBrowse
DCBROWSECOL ELEMENT 3 HEADER 'File Date' WIDTH 6 PARENT oBrowse
DCBROWSECOL ELEMENT 4 HEADER 'File Time' WIDTH 6 PARENT oBrowse

@ 0, 40 DCSAY 'This is a Say' SAYSIZE 0 COLOR GRA_CLR_RED, GRA_CLR_WHITE

@ 14.5, 1 DCPUSHBUTTON CAPTION '+'  SIZE 4 ACCELKEY xbeK_CTRL_P FONT '18.Arial Bold';
          ACTION {|| oDialog:setSize({oDialog:currentSize()[1]+100,oDialog:currentSize()[2]+100})}

@ 14.5, 6 DCPUSHBUTTON CAPTION '-'  SIZE 4 ACCELKEY xbeK_CTRL_M  FONT '18.Arial Bold';
          ACTION {|| oDialog:setSize({oDialog:currentSize()[1]-100,oDialog:currentSize()[2]-100})}

DCGETOPTIONS ;
   SAYWIDTH 100 ;
   SAYRIGHTBOTTOM ;
   SAYFONT IIF(aScale[5],nil,Alltrim(cSayFont)) ;
   GETFONT IIF(aScale[5],nil,Alltrim(cGetFont)) ;
   DEFAULTFONT IIF(aScale[5],nil,Alltrim(cDefaultFont)) ;
   SCALEFACTOR aScale ;
   RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI FIT ADDBUTTONS OPTIONS GetOptions TITLE DC_Array2String(aScale) ;
       EVAL { |o| oDialog := o, (wtf aScale) }

RETURN nil
The eXpress train is coming - and it has more cars.

Post Reply