Source language: Translate to:

Text Object & Click action

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Text Object & Click action

Postby David de Argentina » Fri Jun 15, 2007 2:34 pm

Hi Dave,

I had created a some Image Object as pseudo Buttons.
If I superimpose a transparent text Object as Label of each pseudo button, i can't manage click events, like font propierties, or another actions.

I think it will be a great enhancement.

Thanks in advance.
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Wrangler » Fri Jun 15, 2007 2:57 pm

I agree. There isn't a lot of control over placing text in buttons, and in some instances placing a text box over the button is the only way the text will look proper. And you can't move the text box to the back so you can click the button or you can't see the text. Got my vote. :lol:
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Fri Jun 15, 2007 3:24 pm

David de Argentina:
If I superimpose a transparent text Object as Label of each pseudo button, i can't manage click events, like font propierties, or another actions.

I don't understand what you mean by "like font properties" ... it is not a "click event"

However, you might consider using a Button object ... with Button Style of ...

- Use XP Themes (OFF)
- Hollow/Transparent (ON)
- No Border (ON)
- Depress Effect (OFF)
- Bevel Width ("0")

... just use the text part (not images) of this button ... then, in its Left Click section ...
Code: Select all
GetObjectInfo "[self]" "Width" "[temp_SelfWidth]"
SizeObject "[self]" "1" "-1"
ClickMouse
SizeObject "[self]" "[temp_SelfWidth]" "-1"

This will cause a mouse click on the Picture object underneath the button object ... so you can place all your actions for the Pseudo button (Picture) in the Picture object's Left Click section ... same for the Right Click event.
User avatar
Gaev
 
Posts: 3736
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Fri Jun 15, 2007 10:01 pm

Hi Gaev,

I tryed to change the pseudo button Label text color each time it is pressed.

Some like this:

SetObjectFont "Texto1" "Navy" "Arial" "10" "Bold" "DEFAULT_CHARSET"

But the rectangle area of the Text Object of the label, doesn't allow to process the click on this rectangle.

If the text is very large, the rectangle area of the Text Object fits almost all surface of the image pseudo button.

This is an example:

Image

The marked area is the Text Object


cheers,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby David de Argentina » Fri Jun 15, 2007 10:02 pm

Hi Gaev,

I tryed to change the pseudo button Label text color each time it is pressed.

Some like this:

SetObjectFont "Texto1" "Navy" "Arial" "10" "Bold" "DEFAULT_CHARSET"

But the rectangle area of the Text Object of the label, doesn't allow to process the click on this rectangle.

If the text is very large, the rectangle area of the Text Object fits almost all surface of the image pseudo button.

This is an example:

Image

The marked area is the Text Object


cheers,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Gaev » Fri Jun 15, 2007 10:44 pm

David de Argentina:

As I said in my previous post ... you might consider using a Button object ... instead of a Text object.

When an object in front covers an object at the back ... clicking on the object at the front does NOT trigger specified Click Actions for the object at the back ... even if the object at the front is defined to have a transparent background ... so the trick I suggested was to place actions in the click section of the object in front that ...

- minimize the size of the object in front
- simulate another mouse click ... which would then trigger the Click Actions of the object underneath
- restore the size of the object in front

... but since a Text object does not have Click events to trigger ... use a Button object instead.
User avatar
Gaev
 
Posts: 3736
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Sat Jun 16, 2007 1:53 am

Thanks Gaev,

Nice suggestion !!

Grettings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest