Objects with Button images
Moderator: Neosoft Support
Objects with Button images
Hello fellow Neobook'ers
I have a question regarding Objects who have button images.
Is it possible to change invidual images using Variables ?
Let's assume that i have Picture1,2,3 as default and user want to change set of button images to like Picture 4,5,6.
How to if possible to store that change in Variable so when program restarts selected set is used ?
Thank You
I have a question regarding Objects who have button images.
Is it possible to change invidual images using Variables ?
Let's assume that i have Picture1,2,3 as default and user want to change set of button images to like Picture 4,5,6.
How to if possible to store that change in Variable so when program restarts selected set is used ?
Thank You
Re: Objects with Button images
NyperCro:
Take a look at the GetObjectInfo and SetObjectFileName commands e.g. ...Let's assume that i have Picture1,2,3 as default and user want to change set of button images to like Picture 4,5,6.
Code: Select all
GetObjectInfo "Picture4" "FileName" "[FileOfPic4]"
SetObjectFileName "Picture1" "![FileOfPic4]"
You can use FileRead and FileWrite commands e.g. ...How to if possible to store that change in Variable so when program restarts selected set is used ?
Code: Select all
.. at Shutdown
FileWrite "![PubDir]Setup.txt" "1" "[FileOfPic1]"
... at Startup
FileRead "![PubDir]Setup.txt" "1" "[FileOfPic1]"
SetObjectFileName "Picture1" "![FileOfPic4]"
Re: Objects with Button images
Thank you, il will try it.
Is this possible for all 3 button images ? (Up, highlight, down) ?
Is this possible for all 3 button images ? (Up, highlight, down) ?
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Objects with Button images
You can if you set the button to use a button library image which is a compound image containing all three (Up, highlight, down).Is this possible for all 3 button images ? (Up, highlight, down) ?
NeoSoft Support
Re: Objects with Button images
By the way about the library buttons.
You can do in the future to show the way, not only from the library?
I think it will be convenient when all the icons are stored in a folder with the publication, not in the library.
********************Rus**********************
Кстати по поводу библиотеки кнопок.
Можно в будущем сделать чтобы указывать путь не только из библиотеки?
Мне кажется удобней будет когда все значки хранятся в папке с публикацией, а не в библиотеке.
**********************************************
You can do in the future to show the way, not only from the library?
I think it will be convenient when all the icons are stored in a folder with the publication, not in the library.
********************Rus**********************
Кстати по поводу библиотеки кнопок.
Можно в будущем сделать чтобы указывать путь не только из библиотеки?
Мне кажется удобней будет когда все значки хранятся в папке с публикацией, а не в библиотеке.
**********************************************
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Objects with Button images
Yes, I agree.You can do in the future to show the way, not only from the library?
I think it will be convenient when all the icons are stored in a folder with the publication, not in the library.
NeoSoft Support
Re: Objects with Button images
Hello,
Maybe my npPush plugin can be interesting here.
Maybe my npPush plugin can be interesting here.
Like all my other plugins npPush support for embedded files, so you can use disk files or embedded files to establish individually images (BMP, JPG, GIF, TIFF and PNG are supported) up to four button states: normal, hot, down and disabled.This plugin put at your service the possibility to use advance buttons controls on your publications, who can be customized in several ways, using various gradients colors and styles, borders bevels, glyps images, wallpapers images and events.
Every button have default options and four states options: normal, hot, down and disabled states options. Like others NeoPlugins, you can use one or more Push objects (buttons) on your publications, customizing it separatelly, with shareable publication subroutines/events.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
Re: Objects with Button images
Hi,
I tried that, but i can only change image for "up" status, i dont know how to do it for every state
If you take a look at these img, you will see my problem, i need to create a script who will read specified line in config file (eg. GUI=2 or GUI=something or GUI=default) and change state for push button img "up-red","down-green" and "highlight-orange"
I tried to use Embedded pictures, but i get stuck only on "up" state
Can anyone give me an example script how to do it. I prefer to use Embedded pictures, so they cant be deleted by user.
I hope i explained my problem better than last time
Thank you
I tried that, but i can only change image for "up" status, i dont know how to do it for every state
If you take a look at these img, you will see my problem, i need to create a script who will read specified line in config file (eg. GUI=2 or GUI=something or GUI=default) and change state for push button img "up-red","down-green" and "highlight-orange"
I tried to use Embedded pictures, but i get stuck only on "up" state
Can anyone give me an example script how to do it. I prefer to use Embedded pictures, so they cant be deleted by user.
I hope i explained my problem better than last time
Thank you
Re: Objects with Button images
NyperCro:
- outside the image rectangle (Up)
- howering over the image rectangle (Highlight)
- howering over the rectangle image with the left mouse button in the down/pressed position (Down)
For what you want to achieve, consider ...
a) using the Image object instead of the PushButton ... you can select an [Embedded] file to be shown in such an object
b) look at my previous post about how to change the image associated with such an object
c) you have to save current/changed selections in an external (text) file ... users must allow such files to be read/written on their respective folders ... if you don't want users to mess with the text files outside of your pub, then consider using a (password protected, encrypted) database file.
With this option (for the PushButton object) you have to define the images at Design time ... they can not be changed at Run time.If you take a look at these img, you will see my problem, i need to create a script who will read specified line in config file (eg. GUI=2 or GUI=something or GUI=default) and change state for push button img "up-red","down-green" and "highlight-orange"
Note that the images you specify (at Design time) will be shown when the mouse pointer is ...I tried to use Embedded pictures, but i get stuck only on "up" state
Can anyone give me an example script how to do it. I prefer to use Embedded pictures, so they cant be deleted by user.
- outside the image rectangle (Up)
- howering over the image rectangle (Highlight)
- howering over the rectangle image with the left mouse button in the down/pressed position (Down)
For what you want to achieve, consider ...
a) using the Image object instead of the PushButton ... you can select an [Embedded] file to be shown in such an object
b) look at my previous post about how to change the image associated with such an object
c) you have to save current/changed selections in an external (text) file ... users must allow such files to be read/written on their respective folders ... if you don't want users to mess with the text files outside of your pub, then consider using a (password protected, encrypted) database file.
Re: Objects with Button images
I see what you mean....
I tried an Action such as It works in the design run-time but not the compiled exe....
I think a solution if, for example, you want three different images to display at Button Down, is to duplicate the button three times and place it on three different pages at exactly the same position. Each page will have a different image for Button Down but your set variable will decide which page's button to bring to front...
Or MUCH EASIER keep the button you have but ignore the button down setting altogether (leave it blank) ... use the Left Click action to change the image (since it is also a button down action)... And use The Mouse Exit action (which is also a button up) to change back to the first image.
left click: SetObjectFileName "mybutton" "mypic2.jpg"
mouse exit: SetObjectFileName "mybutton" "mypic1.jpg"
Create a variable like [BtnDown] to determine which image displays with left click:
If "[BtnDown]" "=" "apple"
SetObjectFileName "mybutton" "applepic2.jpg"
EndIf
If "[BtnDown]" "=" "orange"
SetObjectFileName "mybutton" "orangepic2.jpg"
EndIf
.
I tried an Action such as
Code: Select all
FileCopy "C:\buttondown\NeoBookLogo2.jpg" "C:\buttondown\NeoBookLogo6.jpg"
I think a solution if, for example, you want three different images to display at Button Down, is to duplicate the button three times and place it on three different pages at exactly the same position. Each page will have a different image for Button Down but your set variable will decide which page's button to bring to front...
Or MUCH EASIER keep the button you have but ignore the button down setting altogether (leave it blank) ... use the Left Click action to change the image (since it is also a button down action)... And use The Mouse Exit action (which is also a button up) to change back to the first image.
left click: SetObjectFileName "mybutton" "mypic2.jpg"
mouse exit: SetObjectFileName "mybutton" "mypic1.jpg"
Create a variable like [BtnDown] to determine which image displays with left click:
If "[BtnDown]" "=" "apple"
SetObjectFileName "mybutton" "applepic2.jpg"
EndIf
If "[BtnDown]" "=" "orange"
SetObjectFileName "mybutton" "orangepic2.jpg"
EndIf
.