ButtonXP bitmap location

This forum is for eXpress++ general support.
Message
Author
Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

ButtonXP bitmap location

#1 Post 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

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

Re: ButtonXP bitmap location

#2 Post by rdonnay »

Show me more code because that looks right to me.
The eXpress train is coming - and it has more cars.

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: ButtonXP bitmap location

#3 Post 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

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: ButtonXP bitmap location

#4 Post by Jeanne »

Roger,
May be I need to put together a small test to see how this works in it.
Jeanne

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

Re: ButtonXP bitmap location

#5 Post by rdonnay »

Please do. Thanks.
The eXpress train is coming - and it has more cars.

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: ButtonXP bitmap location

#6 Post 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
Attachments
Numpad.zip
Numpad.prg
(3.15 KiB) Downloaded 782 times

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: ButtonXP bitmap location

#7 Post by Jeanne »

Roger,
I was wondering if you had a chance to look at this?
thanks
Jeanne

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

Re: ButtonXP bitmap location

#8 Post by rdonnay »

Sorry, I got distracted and missed it. Will do it now.
The eXpress train is coming - and it has more cars.

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

Re: ButtonXP bitmap location

#9 Post 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
The eXpress train is coming - and it has more cars.

Jeanne
Posts: 34
Joined: Thu Jan 28, 2010 8:11 am
Location: Oklahoma, USA
Contact:

Re: ButtonXP bitmap location

#10 Post by Jeanne »

Roger,
Any luck on fixing this? Looks like I will have to release my app with the bitmaps not getting centered.
Jeanne

Post Reply