resize groupbox

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

resize groupbox

#1 Post by c-tec »

Hello,
I have a dialog with groupboxes and use DCGETOPTIONS RESIZE and RESIZE DCGUI_RESIZE_AUTORESIZE_SCALEFONT. But the groupboxes are not resized, all other elements are working ok. Also the position is not correct changed. What's different at groupboxes ? Is it possible to set the RESIZE clause from gets global so that I don't have add it to all gets ?
reagrds
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: resize groupbox

#2 Post by rdonnay »

This works fine for me. I will need a sample program from you.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], oGroup, nRadio, oBrowse, aDir, GetOptions

aDir := Directory()
nRadio := 1

@ 0,0 dcbrowse oBrowse data aDir size 40,10

dcbrowsecol element 1 width 40 header 'File Name' parent oBrowse

@ 0,42 dcgroup oGroup size 20,10 caption 'Group box'

@ 2,1 dcradio nRadio prompt 'Radio 1' value 1 parent oGroup

@ 3,1 dcradio nRadio prompt 'Radio 2' value 2 parent oGroup

@ 4,1 dcradio nRadio prompt 'Radio 3' value 3 parent oGroup

dcgetoptions resize resizedefault DCGUI_RESIZE_AUTORESIZE_SCALEFONT

dcread gui fit title 'Resize Test' options GetOptions

return nil

proc appsys ; return
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: resize groupbox

#3 Post by c-tec »

ex2.jpg
ex2.jpg (56.09 KiB) Viewed 12249 times
Hello Roger,
thank you, attached the screenshot and the source. The pushbutton used as statusbar is also not correct resized.
regards
Rudolf


Code: Select all

#INCLUDE "dcdialog.CH"
#INCLUDE "dcmxbutt.CH"
#include "inkey.ch"
#include "appevent.ch"
#include "XBP.CH"


#DEFINE COLOR_TITLE_FG              GraMakeRGBColor( { 255, 255, 255 } )
#DEFINE COLOR_TITLE_BG              GraMakeRGBColor( {   0,   0, 127 } )


function Main()
******************************************************************
local getlist := {},oDialog,getoptions,oConfig1
local aVar := array(100)
local cTitel := "Add new reservation"
local cTrip  := "100111-0005"
local oGrp1,oGrp2,oStatBottom,oToolBottom,oButtonConfig,aTest
local cSayFont := '7.Arial'
local cGetFont := '8.Courier New'
local cDefaultFont := '7.Arial'

private owmeld,oMsgSay,oMsg



dc_getpopupcaption({'10.Marlett','u',0})
DC_GetPopupProtectHide()
DC_GroupBoxFix(.t.)
DC_PopDateStart(.t.)
DC_BitmapTransparentColor({192,192,192})
DC_SetKeyActive(.t.)
DC_CellEditTimeOut(60*3)
SET(_SET_SCOREBOARD,.F.)
SET(_SET_DELETED,.F.)
SET(_SET_EXACT,.T.)
SET(_SET_WRAP,.T.)
SET CONFIRM On
//SET DATE ITALIAN
SET CENTURY ON
SET TALK OFF
SET EPOCH TO 1955
SET EXCLUSIVE (.F.)
//SET COLLATION TO GERMAN//ASCII
SET SMARTFILTER OFF
SET RUSHMORE    OFF
SET OPTIMIZE    OFF

oButtonConfig := DC_XbpPushButtonXPDefault():new()
oButtonConfig:mouseOverScale := 1.02
oButtonConfig:bitmapoffset   := 0
oButtonConfig:Gradientstyle := 9
oButtonConfig:borderColor := 0
oButtonConfig:shadowtype := 0
oButtonConfig:textShadowColor := 0
oButtonConfig:textShadowOffset := 2
oButtonConfig:radius          := 0
oButtonConfig:gradientStep    := 1
oButtonConfig:gradientreverse := .f.
oButtonConfig:outline := .f.
oButtonConfig:fgColor         := GraMakeRGBColor({0,0,102})
oButtonConfig:bgColor         := GraMakeRGBColor({153,204,255})
oButtonConfig:fgColorMouse    := GraMakeRGBColor({255,255,255})
oButtonConfig:bgColorMouse    := GraMakeRGBColor({0,153,255})
DC_PushButtonStyle( oButtonConfig )

oConfig1 := DC_XbpPushButtonXPConfig():new()
oConfig1:bitmapOffset    := 5
oConfig1:fgColor         := GraMakeRGBColor( { 255, 255, 255 } )
oConfig1:bgColor         := GraMakeRGBColor( {  78, 113, 255 } )
oConfig1:outline         := .f.
oConfig1:font            := "10.Arial"
oConfig1:mouseOverFont   := "10.Arial"
oConfig1:mouseOverScale  := 1
oConfig1:Gradientstep    := 3
oConfig1:Gradientstyle   := 9
oConfig1:borderColor     := 0
oConfig1:shadowtype      := 0
oConfig1:textShadowColor := 0
oConfig1:textShadowOffset:= 2
oConfig1:radius          := 5
oConfig1:gradientreverse := .f.



afill(aVar,space(100))
aVar[24] := date()
aVar[25] := time()

//@ .5,.5 DCPUSHBUTTONXP STATIC CAPTION "" SIZE 100, 1.2 FONT '12.Arial' COLOR COLOR_TITLE_FG, COLOR_TITLE_BG GRADIENT 2 RESIZE DCGUI_RESIZE_REPOSONLY_Y OBJECT oMsg CONFIG oConfig1
@ .5,.5 DCPUSHBUTTONXP STATIC CAPTION "" SIZE DCGUI_PARENTWIDTH - 1, 1.2 FONT '12.Arial' COLOR COLOR_TITLE_FG, COLOR_TITLE_BG GRADIENT 2 RESIZE DCGUI_RESIZE_REPOSONLY_Y OBJECT oMsg CONFIG oConfig1

@ 3,2 dcsay "Trip # " + cTrip saysize 0 font '12.Arial Bold'

@ 5,2 dcsay "Name/#" get aVar[1] pict "999" saysize 0  popup {|c|poptest(c)}
@ 5,_col()+10 dcget aVar[2] pict "@S25"
@ 5,_col()+50 dcsay "Cust #" get aVar[3] pict "@S25" saysize 0  popup {|c|poptest(c)}

@ 6.5,12 dcgroup oGrp1 caption "PICK UP" size 40,10
@ 6.5,55 dcgroup oGrp2 caption "DROPOFF" size 40,10

@  8.5,1 dcsay "Landmark" saysize 10 SAYRIGHT
@  9.5,1 dcsay "Address"  saysize 10 SAYRIGHT
@ 10.5,1 dcsay "City"     saysize 10 SAYRIGHT
@ 11.5,1 dcsay "* Zone"   saysize 10 SAYRIGHT
@ 12.5,1 dcsay "Cross St" saysize 10 SAYRIGHT
@ 13.5,1 dcsay "Apt-Room" saysize 10 SAYRIGHT
@ 14.5,1 dcsay "Comments" saysize 10 SAYRIGHT

*--------------------- Groupbox 1---------------------------------------
@ 1,1 dcget aVar[4] pict "@S30"  parent oGrp1
@ 2,1 dcget aVar[5] pict "99999" parent oGrp1
@ 2,_col()+10 dcget aVar[6] pict "@S25"  parent oGrp1
@ 3,1 dcget aVar[7]  pict "99999" parent oGrp1
@ 4,1 dcget aVar[8]  pict "99999" parent oGrp1
@ 5,1 dcget aVar[9]  pict "@S30" parent oGrp1
@ 6,1 dcget aVar[10] pict "99999" parent oGrp1
@ 6,_col()+10 dcget aVar[11]  pict "(999)XXXX-XXXXXX" parent oGrp1
@ 7,1 dcget aVar[12]  pict "@S30" parent oGrp1
@ 8,1 dcget aVar[13]  pict "@S30" parent oGrp1

*--------------------- Groupbox 2 ---------------------------------------
@ 1,1 dcget aVar[14] pict "@S30"  parent oGrp2
@ 2,1 dcget aVar[15] pict "99999" parent oGrp2
@ 2,_col()+10 dcget aVar[16] pict "@S25"  parent oGrp2
@ 3,1 dcget aVar[17]  pict "99999" parent oGrp2
@ 4,1 dcget aVar[18]  pict "99999" parent oGrp2
@ 5,1 dcget aVar[19]  pict "@S30" parent oGrp2
@ 6,1 dcget aVar[20] pict "99999" parent oGrp2
@ 6,_col()+10 dcget aVar[21]  pict "(999)XXXX-XXXXXX" parent oGrp2
@ 7,1 dcget aVar[22]  pict "@S30" parent oGrp2
@ 8,1 dcget aVar[23]  pict "@S30" parent oGrp2
*------------------------------------------------------------

@ 17,2 dcsay "Date" get aVar[24] saysize 10 SAYRIGHT popup {|d|DC_PopDate(d,,,,,,2)}
@ 17,_col()+10 dcsay {||dow(aVar[24])} saysize 10
@ 17,30 dcsay "Driver" get aVar[26] pict "XXXXX" saysize 0

@ 18, 2 dcsay "Time"   get aVar[25] pict "XXXXX" saysize 10 SAYRIGHT
@ 18,_col()+10 dcsay {||aVar[27]} saysize 10

@ 19,2 dcsay "Account" get aVar[28] pict "99999" saysize 10 SAYRIGHT
@ 19,_col()+10 dcsay {||aVar[29]} saysize 10

@ 20,2 dcsay "Authorize" get aVar[30] pict "@S30"  saysize 10 SAYRIGHT

@ 21,2 dcsay "Rate" get aVar[31] pict "@S30"  saysize 10 SAYRIGHT
@ 21,_col()+10 dcsay {||aVar[32]} saysize 10

@ 22,2 dcsay "# Pass." get aVar[33] pict "99"  saysize 10 SAYRIGHT

@ 23,2 dcsay "Price" get aVar[34] pict "9999.99"  saysize 10 SAYRIGHT
@ 23,_col()+10 dcsay "Total" get aVar[35] pict "9999.99"  saysize 0
@ 23,_col()+30 dcsay "Pri" get aVar[36] pict "9"  saysize 0

@ 24,2 dcsay "Mileage" get aVar[37] pict "9999.9"  saysize 10 SAYRIGHT



DCSTATUSBAR oStatBottom HEIGHT 28 ALIGN DCGUI_ALIGN_BOTTOM
@ 3,0 DCTOOLBAR oToolBottom SIZE 400,20 BUTTONSIZE 110,20 TYPE XBPSTATIC_TYPE_RECESSEDBOX PARENT oStatBottom PIXEL
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 350,20 PARENT oStatBottom PIXEL OBJECT owmeld
@ 1,1 DCSAY '' PARENT owmeld ID 'MSGTXT' SAYSIZE 250,18 SAYCENTER PIXEL OBJECT oMsgSay
DCADDBUTTON CAPTION {||"F9=more information"}   ACTION {||test(1)}  BITMAP ".\img\editform.bmp" SIZE 120,18 PARENT oToolBottom PIXEL
DCADDBUTTON CAPTION {||"Test 2"}   ACTION {||test(2)}  BITMAP ".\img\cash.bmp" SIZE 75,18 PARENT oToolBottom PIXEL
//DCADDBUTTON CAPTION {||"scale "}   ACTION {||aTEST[1] := 1.4,aTEST[2] := 1.4,aTEST[3] := 1.4,aTEST[4] := 1.4,cSayFont := '10.Arial',cGetFont := '14.Courier New',cDefaultFont := '10.Arial',DC_GetRefresh(GetList)} BITMAP ".\img\transakt.bmp" SIZE 75,18 PARENT oToolBottom PIXEL
DCADDBUTTON CAPTION {||"Test 3"}   ACTION {||test(2)}  BITMAP ".\img\transakt.bmp" SIZE 75,18 PARENT oToolBottom PIXEL
DCADDBUTTON CAPTION {||"exit"}   ACTION {||test(4)}  BITMAP ".\img\exit.bmp" SIZE 75,18 PARENT oToolBottom PIXEL RESIZE DCGUI_RESIZE_AUTORESIZE_SCALEFONT

//resize resizedefault DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCGETOPTIONS SAYWIDTH 100 RESIZE resizedefault DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI FIT TITLE "Test" EVAL {|o|SetAppWindow(o),oMSGSAY:setcaption("messageline"),oMSG:setcaption(cTitel)} PARENT @oDialog HANDLER _dialoghandler OPTIONS GetOptions

return .t.

static function test(n)
******************************************************************
dcqdebugoff n
return .t.

static function _dialoghandler(nEvent, mp1, mp2, oXbp, oDlg,aGetlist, aRef, lOk)
******************************************************************
local x
//  1. nEvent   - The event type.
//  2. mp1      - The first event parameter.
//  3. mp2      - The second event parameter.
//  4. oXbp     - A pointer to the object creating the event.
//  5. oDlg     - A pointer to the main dialogue object.
//  6. aGetlist - A pointer to the GetList array.
//  7. aRef     - A pointer to an optional Reference array that
//                was passed to DC_ReadGets().
//  8. lOk      - A logical value that is .TRUE. if the OK button
//                was clicked and .FALSE. if CANCEL was clicked.
*------------------------------------------------------------
//if valtype(oXbp) = "O" .and. oXbp:isDerivedFrom('DC_XbpBrowse') .and. nEvent = xbeP_Keyboard

*------------------------------------------------------------
//  Return Value   Behavior
//  ------------   --------------------------------------------
//  DCGUI_NONE     Continue processing the event
//  DCGUI_IGNORE   Ignore event
//  DCGUI_CLEAR    Ignore event and clear all events from queue
//  DCGUI_EXIT     Exit the DC_ReadGui() reader event loop
 /*  code */
RETURN DCGUI_NONE



FUNCTION _Row()
return DCGUI_ROW

FUNCTION _Col()
return DCGUI_COL

function poptest(c)
return c

Attachments
ex1.jpg
ex1.jpg (51.13 KiB) Viewed 12249 times
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: resize groupbox

#4 Post by c-tec »

Hello Roger,
your sample works, mine not, so it is not the eXPress++ version, but where is the difference ?
reagards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: resize groupbox

#5 Post by rdonnay »

Comment out DC_GroupBoxFix(.t.)

This creates an invisible parent object to fix a bug in Xbase++.
That object is not included in the resizing system.

I don't think that I want to mess with that code because I believe that DC_GroupBoxFix() is not needed anymore.
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: resize groupbox

#6 Post by c-tec »

Hello Roger,
thank you, resizing works really great now !
only a minor thing: when resizing a window with a lot of elements it slows down the resizing because of updating the dialog. Maybe a delay between the refresh make sense.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: resize groupbox

#7 Post by rdonnay »

Maybe a delay between the refresh make sense.
I have thought of this, and even tried to resolve it.

This would require interecepting additional dialog resize events that would occur while in the process of resizing.

If such an event should occur, then possibly terminate the current resize process.

Unfortunately, this requires a lot more complicated code and can result in a window that has not been resized properly.

The user can turn off the dynamic resizing feature of windows in the control panel.
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: resize groupbox

#8 Post by c-tec »

Hello Roger,
thank you, is not a big problem
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply