Source language: Translate to:

Change Variable Font at execution time

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Change Variable Font at execution time

Postby David de Argentina » Sat Sep 15, 2007 4:22 pm

Hi Dave,

I think there is a good idea if we could change variable font at exectution time.

Using this feature, we can use graphical fonts (like Wingdings) in alertbox, menus or other merged text as well as normal fonts...

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

Postby HPW » Sat Sep 15, 2007 10:59 pm

What do you neam by variable font?
A variable has no font, it is a string.
Use 'SetObjectFont' for setting the font of objects.
Or do you ask for more support of other objects in 'SetObjectFont'?
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Gaev » Sun Sep 16, 2007 5:05 am

David de Argentina:

a) I take it you are aware of the option in Book >>> Book Properties >>> Interface ... also via F6 ... that allows you to set a Font (at Design Time) ... that will be used when servicing AlertBox, MessageBox, Exit, InputBox, StickyNote, Menu, MenuEx, Find and Balloon commands.

b) Are you asking for this property to be changeable at run time ? ... either via a reserved global variable or a command ... so you can change it to your liking before invoking one of the above commands ?
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Sun Sep 16, 2007 2:17 pm

ok guys,

I thought in the possibility to use symbol fonts AND character fonts in the same object.

If I redefine object font, I transform all text of this object with the same font.

for example:

Setvar "[windings_folder_open]" "1"
Setvar "[folder_open]" "Folder Open"

Now, we could affect this variables with a "desired" action.
Somethig like this:

FontVar "[windings_folder_open]" "WingDings" "14" "+Bold+italics, etc"
FontVar "[folder_open]" "Arial" "14" "+Bold+italics, etc"

Finally, we could create, for a example a menu:

Menu "pos_x" "pos_y" "[windings_folder_open] [folder_open]"

and we could obtain a graphical merged menu with the image and the text.

the result could be something like this

Image


Is too absurd...?

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

Postby Gaev » Sun Sep 16, 2007 4:27 pm

David de Argentina:

What you are wanting to do is use multiple fonts for text in buttons, menus etc. ... assuming that the standard windows API that Dave employs can accept text in multiple fonts, the best way to implement this additional functionality would be to enhance the SetObjectFont command to accept multiple "class definitions" e.g.
Code: Select all
SetObjectFont "Button1:Dingies" "Red" "Wingdings" "8" "Bold" "DEFAULT_CHARSET"
SetObjectFont "Button1:Warning" "Red" "Verdana" "12" "Bold" "DEFAULT_CHARSET"

... and then the SetObjectCaption command would have text tagged like ...
Code: Select all
SetObjectCaption "Button1" "<Dingies>x</Dingies><Warning>Folder Open</Warning>"


In the mean time, you might consider two alternatives ...

a) Set your captions in the Button object to be "right aligned" ... or with one/more preceeding spaces ... then position a text object ... with its ...

- font property set to "Wingdings"
- background set to "transparent"
- borders set to "none"

... such that the text object is positioned in the top left area of the button ... and in front of it ... the user won't be able to click on the image (Wingding character) but it will give the same impression as if it was one object.


b) You could just create the composite image (of the Wingding character followed by the regular text) ... one image for each event to be simulated (onMouseEnter, onMouseExit, onClick etc.) ... and use a Picture Object ... and use its event sections to alter the images as appropriate


Using multiple such buttons ... perhaps inside a Container ... can also simulate a PopUp menu.


But the best approach would be to use the Browser object ... load a generic/template html document into it ... and use NeoBook 5.5's NeoBook/Javascript interaction facilities to control the layout of the buttons and to invoke subroutines in NeoBook in response to user actions.
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Tue Sep 18, 2007 4:18 pm

Hi Gaev,

You define another posibilites: enhanced object propierties.

Variables are data, but, if exists an option to "attach" some attributes that can be used for any objects... i think there is a goal...

Its only an idea...
Dave has the last word..

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

Postby Gaev » Tue Sep 18, 2007 7:09 pm

David de Argentina:

The concept of classes and cascading style sheets ... deployed in html documents ... is a powerful one ... but also may be difficult to grasp for non-programmers ... so my suggestion is to take parts of the concept ... so we get some more flexibility (multi-font text) ... and retain simplicity.

but, if exists an option to "attach" some attributes that can be used for any objects... i think there is a goal...

Yes, the concept could be expanded to define global class definitions e.g. ...
Code: Select all
SetObjectFont "*:Dingies" "Red" "Wingdings" "8" "Bold" "DEFAULT_CHARSET"
SetObjectFont "*:Warning" "Red" "Verdana" "12" "Bold" "DEFAULT_CHARSET"


... or even ...
Code: Select all
SetObjectFontClass "Dingies" "Red" "Wingdings" "8" "Bold" "DEFAULT_CHARSET"
SetObjectFontClass "Warning" "Red" "Verdana" "12" "Bold" "DEFAULT_CHARSET"
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest