Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Button size
Button size [message #543080] Mon, 28 June 2010 11:05 Go to next message
Maziar Khodaei is currently offline Maziar KhodaeiFriend
Messages: 25
Registered: July 2009
Junior Member
Hi all,

I have a question. I create a own Button widget, extended from SWT Button widget. The problem is when I create this widget, the button is resized automaticly and has not more the default size. It is shruked. I don´t resized it or don´t set pack at true. When I create a Button in normal way, the size is normal (Defualt value).
I don´t have any decleration for this differencely Button size.

Do you have any idde?
Re: Button size [message #543234 is a reply to message #543080] Mon, 28 June 2010 17:56 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Mazier,

I'm sorry to say, but extending Button is not permitted. The only SWT
controls that may be subclassed are Canvas and Composite. See [1] for
details.

Why doesn't the standard button work for you? Maybe there's a better
solution.

Regards, Ralf

[1] http://www.eclipse.org/swt/faq.php#subclassing


Maziar Khodaei wrote:
> Hi all,
>
> I have a question. I create a own Button widget, extended from SWT
> Button widget. The problem is when I create this widget, the button is
> resized automaticly and has not more the default size. It is shruked. I
> don´t resized it or don´t set pack at true. When I create a Button in
> normal way, the size is normal (Defualt value). I don´t have any
> decleration for this differencely Button size.
>
> Do you have any idde?
Re: Button size [message #543320 is a reply to message #543234] Tue, 29 June 2010 06:55 Go to previous messageGo to next message
Maziar Khodaei is currently offline Maziar KhodaeiFriend
Messages: 25
Registered: July 2009
Junior Member
Hi Ralf,

thank you for your answer. No, the button Widget works well. The idee was to change the constructur of button and assign it with a "jface.action", which comprised e.g. text, image, tooltipp etc.

So, now I have to get an other solution for this.

Regards

Maziar
Re: Button size [message #543337 is a reply to message #543320] Tue, 29 June 2010 07:19 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Maziar,

I don't think that a widget which depends on JFace is a good idea. Why
don't you create a factory for your type of buttons and put that code
into a factory method?

Ralf


Maziar Khodaei wrote:
> Hi Ralf,
>
> thank you for your answer. No, the button Widget works well. The idee
> was to change the constructur of button and assign it with a
> "jface.action", which comprised e.g. text, image, tooltipp etc.
>
> So, now I have to get an other solution for this.
>
> Regards
>
> Maziar
Re: Button size [message #543353 is a reply to message #543337] Tue, 29 June 2010 08:04 Go to previous message
Maziar Khodaei is currently offline Maziar KhodaeiFriend
Messages: 25
Registered: July 2009
Junior Member
Hi Ralf,

OK, I will try it with a factory.

thx a lot.

Maziar
Previous Topic:Get menu activated by JS
Next Topic:Load balancing with Apache mod_proxy
Goto Forum:
  


Current Time: Thu Mar 28 22:55:02 GMT 2024

Powered by FUDForum. Page generated in 0.02798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top