Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Have the PictureButton ?
Have the PictureButton ? [message #12557] Fri, 09 November 2007 05:36 Go to next message
LiniX is currently offline  LiniX
Messages: 7
Registered: October 2007
Location: Thailand
Promising Member
Hi,

I want to use Picture like the Button.
I want to use GreenPhone and RedPhone to application.

How to use it ?

Thank You
Watchara Kangkun
Re: Have the PictureButton ? [message #12566 is a reply to message #12557] Fri, 09 November 2007 11:26 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Try FlatButton, it should do what you want.
Re: Have the PictureButton ? [message #12612 is a reply to message #12566] Sat, 10 November 2007 17:39 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
FlatButton? When was this introduced?
Re: Have the PictureButton ? [message #12617 is a reply to message #12612] Sat, 10 November 2007 23:50 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

FlatButton is a class used in Clock and Calendar. Now (after recent DateTimeCtrl refactoring) it should be rather named TransparentButton. Anyway I could make it more universal (it wasn't created as next standard ctrl in mind). Just say what you really need and I'll try to extend it.
Now you can use it for example in this way:
FlatButton btn;
btn.SetImage(Img::LeftArrow);
btn.SetLeft() //when button is pushed the image will be scrolled left (to natural move imitation - it'd look stupid if right arrow were scrolled left)
btn <<= THISBACK(MyAction);
Add(btn.LeftPos(0, 40).TopPos(0, 19));

There is also a FlatSpin which is the combination of two FlatButtons ant text displayed between them. For example:
FlatSpin btn;
btn.SetText("Click me");
btn <<= THISBACK(MyActionOnTextClick)
btn.SetCallbacks(THISBACK(MyActionOnLeftClick), THISBACK(MyActionOnRightClick));

One can also use LineCtrl which is for example used in Clock control as minute and hour setter (it's located at left and right side of clock).

All this controls were created for DropTime/DropDate. If anyone wants to use them please give me a sign. I will document them better / make more universal.

[Updated on: Sat, 10 November 2007 23:55]

Report message to a moderator

Re: Have the PictureButton ? [message #12620 is a reply to message #12557] Sun, 11 November 2007 03:41 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
I'm not sure about the special controls you are mentioning, but some straight forward example and documentation how the button with Image and button with image+text should be done in U++ way would be welcome by many people.

Whatever the used control is in such case.
Re: Have the PictureButton ? [message #12624 is a reply to message #12557] Sun, 11 November 2007 13:08 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mr_ped, I agree with you completely. U++ has large amount of undocumented (or almost undocumented) features, controls, techniques, etc. It is vital to have U++ widely and user-friendly documented. That is why I started topic about documentation.

[Updated on: Sun, 11 November 2007 13:12]

Report message to a moderator

Re: Have the PictureButton ? [message #12634 is a reply to message #12624] Sun, 11 November 2007 23:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 11 November 2007 07:08

mr_ped, I agree with you completely. U++ has large amount of undocumented (or almost undocumented) features, controls, techniques, etc. It is vital to have U++ widely and user-friendly documented. That is why I started topic about documentation.


Factual note: Many people had a lot of suggestions about how documentation should look like. Very little actually contributed any useful docs... Smile

Mirek
Re: Have the PictureButton ? [message #12639 is a reply to message #12634] Mon, 12 November 2007 00:19 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I may contribute docs structure as I see it, gradually adding actual texts to the articles proposed. It`s how I suggested to do.
For now, presence and content of structure proposed is still under discussion, so it`s unknown what to contribute for now, actually.
That`s why I try to determine what kind of manual should be - ASAP.

[Updated on: Mon, 12 November 2007 00:22]

Report message to a moderator

Re: Have the PictureButton ? [message #12694 is a reply to message #12639] Tue, 13 November 2007 10:21 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Since we are talking about buttons, I think that U++ has to many flavors of Buttons. I often need one in between, and some design choices are really strange, like normal Button not having a flat mode/skin and OptionButton not having a Label. Any plan to normalize/streamline the classes a little?
Re: Have the PictureButton ? [message #12714 is a reply to message #12694] Tue, 13 November 2007 19:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Tue, 13 November 2007 04:21

Since we are talking about buttons, I think that U++ has to many flavors of Buttons. I often need one in between, and some design choices are really strange, like normal Button not having a flat mode/skin and OptionButton not having a Label. Any plan to normalize/streamline the classes a little?


I think it is relatively easy to use chameleon style to get the flat button.

Mirek
Re: Have the PictureButton ? [message #12735 is a reply to message #12714] Wed, 14 November 2007 15:43 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
It may be easy, but I don't know how. And I was also refering to the fact that some Buttons lack features, but others don't.
Re: Have the PictureButton ? [message #12737 is a reply to message #12735] Wed, 14 November 2007 16:18 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Button::Style flatstyle;

void SetFlatStyle(Button &btn)
{
    flatstyle = btn.StyleNormal();
    flatstyle.look[0] = SColorFace();
    flatstyle.look[1] = SColorFace();
    flatstyle.look[2] = SColorFace();
    flatstyle.look[3] = SColorFace();
    btn.SetStyle(flatstyle);
}

Or you can replace SColorFace with an Image to draw some sort of border. See the Image B in CtrlLib/Ctrls.iml.

And yes, Button option should have a Label and IMO be either a variant of Option or Pusher. It's a bit useless at the mo.

[Updated on: Wed, 14 November 2007 16:19]

Report message to a moderator

Re: Have the PictureButton ? [message #12739 is a reply to message #12737] Wed, 14 November 2007 16:38 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Thank You! I'm starting to get the hang of this chameleon business. But if I set all looks to SColorFace(), the button will not change it's appearance at all. By flat Button I mean something more like a ToolButton. I'll check to see how ToolButton draws it's self (it has no Style), and try to extract a style from that so I can add it to Button.
Re: Have the PictureButton ? [message #12743 is a reply to message #12739] Wed, 14 November 2007 17:14 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
void SetFlatStyle(Button &btn)
{
    flatstyle = btn.StyleNormal();
    CtrlsImageLook(flatstyle.look, CtrlsImg::I_TB, 4);    
    btn.SetStyle(flatstyle);
}

Smile
Re: Have the PictureButton ? [message #12751 is a reply to message #12743] Wed, 14 November 2007 19:24 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
That worked great. To bad It's just a hunch, but I won't find any documentation and chameleon and those magic IDs. Too bad you can't use it on ButtonOption...
Previous Topic: label text not wrapped
Next Topic: How to call GUI in static function?
Goto Forum:
  


Current Time: Fri Mar 29 09:10:24 CET 2024

Total time taken to generate the page: 0.02175 seconds