A button in a button

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

A button in a button

#1 Post by skiman »

Hi,

In a lot of modern webbased applications I saw buttons in a button. This kind of sub-buttons gives the possibility to add extra functionality to a button.

Sample: Stock button gives a list of products. The '+' button adds a new product. This way a user just has to click once.
stockbutton.PNG
stockbutton.PNG (2.02 KiB) Viewed 13250 times
As you can seen in the sample above, I have two buttons. The little push-button has another action according to the big Stock button.

The problem I now have is that when the STOCK button is clicked, the '+' button disappears to the back of the stock button. I'm looking to put the '+' button to front.

I tried with a oStockPlus:refresh() in the action of the stock button, but that doesn't work.

Any suggestions for this?
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: A button in a button

#2 Post by skiman »

Hi,

I found it.

Using oStockButton:toback() solved my problem.
Best regards,

Chris.
www.aboservice.be

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

Re: A button in a button

#3 Post by c-tec »

Hello,
looking nice your botton combination. A little tip: you can make the small button round with RADIUS in dcpushbuttonxp, I think this would look better.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: A button in a button

#4 Post by skiman »

Hi Rudolf,

Yes, the sample was made to show the two buttons.

This is how I implemented it in my application.
buttoninbutton.PNG
buttoninbutton.PNG (5.79 KiB) Viewed 13210 times
I changed the pushbuttonxp class with some extra:
:borderpixel to create a thick border which automatically calculates the color of the border.
:bgparent to set the background color of big button.
:circle which uses graarc to draw the button.

This way I can define my little buttons in a big button.
Best regards,

Chris.
www.aboservice.be

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

Re: A button in a button

#5 Post by rdonnay »

You are saying that you modified the DC_XbpPushButtonXP() class?

I am planning another quick release of build 266.
I would like to see this plus your application code.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: A button in a button

#6 Post by skiman »

Hi Roger,

I don't mind to share code, but I expect that my dc_pushbuttonxp isn't compatible anymore.

If you send me your _dcxbutt.prg, i can add the above modifications.

I didn't change the pushbuttonxp command, since I'm using the eval clause to set some values. I won't be a problem to add this to dcdialog afterwards.

1. The standard border has a value of one. I modified this with :borderpixel. If the borderpixel if > 1, then the color is calculated based on the :bgcolor of the current state. This way the bordercolor changes according to the standard bgcolor, bgmousover and bgselected.

2. The :bgparent sets a :bgcolor if there is no specific parent. The big button is not the parent of the small button, so I needed an extra value to define this. This way you can put the small button above another.

3. If :circle = .T. it is a sub-button in my case. This way I test on the :bgparent to paint the grabox. I also use the graarc to paint the button, instead of using the grabox with a radius of 999.

I don't know if the modifications are generic. Maybe you can change them to have some kind of subbutton clause in the command.

To have the above working in a nice way, the o:bgColorMouse:=o:bgcolor for the big button is a must.

If you think this is an addition to eXPress++ and users find this of interest I can share it.
Best regards,

Chris.
www.aboservice.be

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

Re: A button in a button

#7 Post by rdonnay »

If you think this is an addition to eXPress++ and users find this of interest I can share it.
I was not thinking of it as an addition to eXpress++.
I thought it may have been something minor that would help you out with future releases.
I will forget about it and let you go about your business.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: A button in a button

#8 Post by skiman »

Hi Roger,

This is the result of my button in a button.
buttonmenu.PNG
buttonmenu.PNG (30.81 KiB) Viewed 13189 times
I can easily add extra subbuttons on a button. The main goal was to have as much of direct options with ONE click.
Best regards,

Chris.
www.aboservice.be

Post Reply