Addbuttons

This forum is for eXpress++ general support.
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Addbuttons

#1 Post by omni »

Roger,

I just started playing again with DC_XbpPushButtonXPConfig(). My buttons look perfect, and do not HIDE/DISAPPEAR like they did a few years ago, before all my versions were updated.
However the internal size of the addbuttons is way too small, and I do not know how to adjust that.

I assume there is a method, but just do not know what it is.

Thanks

Fred
Omni

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#2 Post by omni »

Just to be clear, its not the buttons size, its fine. its the OK and CANCEL bitmap size inside the buttton that is so small.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#3 Post by omni »

Ok, I deleted my config command and it is now just OK and CANCEL, no bitmap, and looks the same as the other buttons. guess that is ok, but is there a method to change the bitmap size?

Fred

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

Re: Addbuttons

#4 Post by rdonnay »

Send me a snapshot of what you are talking about and show some code.
The eXpress train is coming - and it has more cars.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#5 Post by omni »

Below are the button codes used. Just addbuttons on the readgui. Using the below configuration for the button definitions, and the fairly standard ok/cancel set up. (like your example)

oConfig4 := DC_XbpPushButtonXPConfig():new()
oConfig4:bitmapOffset := 0
oConfig4:fgColorMouse := COLOR_BLACK
oConfig4:bgColorMouse := COLOR_SLATEGRAY
oConfig4:fgColor := COLOR_BLACK
oConfig4:bgColor := COLOR_SILVER
oConfig4:fgColorSelected := COLOR_BLACK
oConfig4:bgColorSelected := COLOR_ICEGREEN
oConfig4:fgColorClick := COLOR_BLACK
oConfig4:bgColorClick := COLOR_ICEGREEN
oConfig4:gradientStep := 9
oConfig4:gradientReverse := .T.
oConfig4:radius := 10
oConfig4:outline := .T.
oConfig4:font := '9.Arial'
oConfig4:mouseOverFont := '9.Arial Bold'
oConfig4:mouseOverScale := 1.2
oConfig4:bitmapScale := .5
oConfig4:borderColor := COLOR_DARKBLUE


DC_PushButtonStyle( oConfig4)
DC_ExpressButtonStyle(ocConfig4)
***********************************************************************
DC_AddButtonConfig(DCGUI_BUTTON_OK,BITMAP_OK_1,80,30)
DC_AddButtonConfig(DCGUI_BUTTON_CANCEL,BITMAP_CANCEL_1,80,30)

If we are not using the button style commands, the bitmaps auto-take up the entire buttons. If we do not use the expressbuttonstyle it also looks like it did previously, which is ok, but not consistent. Prefer the option to use a bitmap on the new style with size adjustment capabilities, if it is an option.

Thanks for your trouble.


Fred
Attachments
buttons.zip
This is a renamed pdf file
(264.88 KiB) Downloaded 612 times

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Addbuttons

#6 Post by hz_scotty »

DC_PushButtonStyle( oConfig4)
DC_ExpressButtonStyle(ocConfig4)
DC_ExpressButtonStyle(ocConfig4) -> Mistake?
best regards
Hans

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#7 Post by omni »

Sorry, that was a typo, but its right in my prg.

Another issue has come up. How do you set the default button font for this style. It shows up fine on my pc as a 9.Arial Bold, or that is what it appears to be, but its different on other pc's in the office, and not what we want (small and looks almost like italics). There is no font command for the set up. I tried to use one and it does not error out, but it is ignored. Nothing in the docs on this.


Need to update this.. It apparently uses the font set on the pushbutton, which may be different for certain fonts, certain pc's if I used an odd size, so figured that out. No font assignment in the buttonxp, so can you set ALL buttons (all pushbuttons) to be a certain font if no font is defined on the pushbutton command?

Thanks

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

Re: Addbuttons

#8 Post by rdonnay »

Why are you using a bitmapScale of .5?

Code: Select all

oConfig4:bitmapScale := .5
Also, I suggest doing removing the background color of the bitmaps like so:

Code: Select all

DC_BitMapTransparentColor( { 192, 192, 192 } )
The eXpress train is coming - and it has more cars.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#9 Post by omni »

Thanks, did not see that.

Any method to assign the default font on all pushbuttons, similar to some of the other global settings. We have hundreds, so do not want to have to change them all one by one. Only a few have assigned fonts.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Addbuttons

#10 Post by omni »

Roger,

Not sure you saw my last question to see if there is any method to assign a certain font to all my pushbuttons (or to pushbuttons that have the buttonxp, which is all of them). For our main app (although we have others we will also need to do) it is 550+ programs. We may be able to use a search/replace (we really like ACTUAL SEARCH AND REPLACE freeware), which will work for all of them that do not already have font assignments.

Just need to know so I can go forward.

Thanks

Fred

Post Reply