Page 1 of 2
ButtonXP bitmap location
Posted: Wed Feb 24, 2010 11:21 am
by Jeanne
eXpress build 1.9 253
I was trying to put my bitmap in the center of the XP button by doing this in the DC_XbpPushButtonXPConfig code:
oConfig1:alignBitmap := XBPALIGN_HCENTER + XBPALIGN_VCENTER
but it is not working for me
Is this wrong?
Jeanne
Re: ButtonXP bitmap location
Posted: Wed Feb 24, 2010 1:03 pm
by rdonnay
Show me more code because that looks right to me.
Re: ButtonXP bitmap location
Posted: Wed Feb 24, 2010 2:30 pm
by Jeanne
oConfig2 := DC_XbpPushButtonXPConfig():new()
oConfig2:fgColorMouse := COLOR_DARKGREEN
oConfig2:bgColorMouse := COLOR_ORANGE
oConfig2:fgColor := COLOR_DARKGREEN
oConfig2:bgColor := COLOR_DARKGREEN
oConfig2:fgColorSelected := GRA_CLR_GREEN
oConfig2:bgColorSelected := COLOR_ICEGREEN
oConfig2:fgColorClick := COLOR_DARKGREEN
oConfig2:bgColorClick := COLOR_ICEGREEN
oConfig2:gradientStep := 10
oConfig2:gradientReverse := .T.
oConfig2:radius := 12
oConfig2:outline := .T.
oConfig2:font := cSayFont
oConfig2:mouseOverFont := cGetFont
oConfig2:mouseOverScale := 1.1
oConfig2:bitmapOffset := 1
oConfig2:bitmapScale := 1
oConfig2:alignBitmap := XBPALIGN_HCENTER +XBPALIGN_VCENTER //XBPALIGN_HCENTER +
oConfig2:borderColor := COLOR_BLUE
Re: ButtonXP bitmap location
Posted: Thu Feb 25, 2010 8:47 am
by Jeanne
Roger,
May be I need to put together a small test to see how this works in it.
Jeanne
Re: ButtonXP bitmap location
Posted: Thu Feb 25, 2010 9:01 am
by rdonnay
Please do. Thanks.
Re: ButtonXP bitmap location
Posted: Thu Feb 25, 2010 3:01 pm
by Jeanne
Roger,
Because my app is a touch screen I used your sample TouchSrc as my base. I modified the Numpad.prg to show my issue with the bitmaps not being centered.
When I do not use the RESIZE options the bitmap does stay in the center but when I add the RESIZE and maximize the window the bitmap goes to the bottom left part of the button.
I really need this to work so we can release this soon.
Jeanne
Re: ButtonXP bitmap location
Posted: Tue Mar 02, 2010 9:01 am
by Jeanne
Roger,
I was wondering if you had a chance to look at this?
thanks
Jeanne
Re: ButtonXP bitmap location
Posted: Tue Mar 02, 2010 9:05 am
by rdonnay
Sorry, I got distracted and missed it. Will do it now.
Re: ButtonXP bitmap location
Posted: Tue Mar 02, 2010 9:38 am
by rdonnay
Jeanne -
The below code better explains the problem.
Compile and run it to see what I mean. You need to resize the window to see the problem.
It is in the resizing logic of the DC_XbpPushButtonXP() class.
I consider this a bug.
Apparently, nobody has attempted to resize one of these buttons before.
I will have to work on a fix for this and give you an update.
Roger
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oConfig1
oConfig1 := DC_XbpPushButtonXPConfig():new()
oConfig1:gradientStep := 10
oConfig1:gradientReverse := .T.
oConfig1:radius := 12
oConfig1:outline := .T.
oConfig1:font := '16.Arial Bold'
oConfig1:mouseOverFont := '16.Arial Bold'
oConfig1:mouseOverScale := 1.1
oConfig1:bitmapOffset := 15
oConfig1:bitmapScale := 1
oConfig1:alignBitmap := XBPALIGN_HCENTER +XBPALIGN_VCENTER
oConfig1:borderColor := GRA_CLR_YELLOW
@ 50, 90 DCPUSHBUTTON CAPTION 2108 FONT '16.Arial Bold' SIZE 80,80 PIXEL ;
RESIZE DCGUI_RESIZE_AUTORESIZE_SCALEFONT CONFIG oConfig1
@ 200, 90 DCPUSHBUTTON CAPTION 2108 FONT '16.Arial Bold' SIZE 200, 200 PIXEL ;
RESIZE DCGUI_RESIZE_AUTORESIZE_SCALEFONT CONFIG oConfig1
DCGETOPTIONS RESIZE
DCREAD GUI FIT OPTIONS GetOptions
RETURN nil
PROC appsys ; return
Re: ButtonXP bitmap location
Posted: Mon Mar 08, 2010 2:13 pm
by Jeanne
Roger,
Any luck on fixing this? Looks like I will have to release my app with the bitmaps not getting centered.
Jeanne