Using labels as quicklaunch buttons, and customisation Thread last updated on 2007-06-21 13:05:06

Posted by member 256241 on 2007-06-19 20:21:35

Hello, this is my popup:

http://img261.imageshack.us/img261/6834/startmenuly9.jpg

The buttons up the middle are labels which I am going to turn into quicklaunch like buttons. However, I also thought I might make the bottom right hand corner a grid of more, larger quicklaunch labels. My question is there any way to make it easy for the user to set the targets, say, by right clicking on it, which brings up something into which you enter the target and icon (hopefully with browsing support)?

I don't eally know if you'd need to write an applet or something, or if other people have done it, perhaps with edit labels or something? Are there plug ins which create a browser to select the target?

I think this has the potential to be quite a difficult task, but my theme is pretty tough to customize at the moment.

Thanks for reading, and any help/pointers/advice would be very much appreciated.

Posted by member 1 on 2007-06-19 20:44:01 link

It isn't going to be easy that is for sure. You can use ckDialog to do what you want. Take a look at the ReLuna2 theme for a really good example.

Posted by member 248213 on 2007-06-19 23:04:14 link

No no no, DO NOT USE ckDialog!!! its bugged to all hell (thus the suggestion from DEVILboi?)

Instead use comdlgls-0.7 to open file, folder, font and color dialogs.
even comdlgls-0.7 is a little rough around the edges ;) but it does work (post back here if you need help)


BUT, what I would recommend in your case is to simply use the personal "evars" ala "$filemanager$", "$im$" etc

The user has allready specified his/her preference of applications in these "evars".
That is the simplest/best solution imho ;)

p.s. look in your "$personaldir$evars.rc" for wtf I am talking about.

Posted by member 212670 on 2007-06-20 03:34:01 link

Ya, like fractal says, comdlgls-0.7. Run these bangs in a command to give you some ideas.

!ComDlgColor !alert ^@cc^
!ComDlgFont !alert "^@tn^ at ^@#d^^@ts^/10^@#d^px" "Font Selected"
!ComDlgFile !alert "^@fp^"

Posted by member 256241 on 2007-06-20 15:49:57 link

Thanks for your responses.

I've had a look at comdlgls, and it seems to be a route to what I want. I've made it so that right clicking lets you browse to a target, the path of which is saved as an evar. At the moment it's just trying to set the tooltip, i've tried changing the image too, however when I change the image it just shows through to desktop presumably as it didn't link up with the image. !execute $target1$ doesn't work either. This is when target1 appears to contain a valid path. See below:

*script exec !ComDlgFile !Varset Target1 "^@fp^"
*script exec !parseEvars !labelrefresh panicbutton panicbuttonToolTip "%#target1%#"

The value is set correctly, as Varshow testifies. Ive tried variations like %#%{target1}%# $target1$ etc.

Can someone see why this wouldn't be working?


I figure the easiest way for me to accomplish the overall task is to just be able to set the icon(image) and target, with different clicks or whatever. I suppose the only other bit would be saving those values and loading them at the beginning. How do you do this?


Thanks for your time and help.


Oh, also, are evars in $these$ when they don't change at runtime, and in %#these%# or %{these} when they change?

Posted by member 1 on 2007-06-20 16:58:22 link

That should be !execute [$target1$]...or just $target1$...as !Execute was designed to run multiple things at once.

Posted by member 256241 on 2007-06-20 17:50:48 link

!execute [$target1$] doesn't seem to do anything at all, even though the value is a valid file.

Simply, $target1$ opens a file manager at the directory of the file, but doesn't open it.

Am I being stupid?

Posted by member 1 on 2007-06-20 18:03:40 link

try !alert $target1$ $target1$ and see what the value really is.

Posted by member 212670 on 2007-06-20 19:35:22 link

Have a look at this theme, specifically the script.rc file and themevars.rc.

Posted by member 248213 on 2007-06-20 21:13:45 link

about: !parseEvars !labelrefresh panicbutton panicbuttonToolTip "%#target1%#"

I always had trouble setting tooltips, and found the most reliable way is to actually destroy/create the label:
*script exec !labeldestroy panicbutton
*script exec !setevar panicbuttontooltip "Blah"
*script exec !labelcreate panicbutton

Posted by member 256241 on 2007-06-21 10:49:23 link

Thanks,

DevilBoi, !alert $target1$ $target1$ and !alert $target1$ bring up an empty Ok box. However !varshow target1 returns the correct value - a valid path to a file. I find it really odd that it just navigates to the path of the file but not open the file, when if you just LSXcommand the same path it opens fine. This is probably the same issue I have when trying to change it's image as well.

Fractal, yeah, thanks, that works to change the tooltip... Although not to the contents of $target1$:

*script exec !labeldestroy panicbutton
*script exec !parseEvars !setevar panicbuttontooltip "$target1$\asd"
*script exec !labelcreate panicbutton

This only makes the tooltip "\asd", as if $target1$ was empty, although !varshow target1 of course returns the perfectly coherant selected path >_<


Thanks for the help.

[edit] Okay, I've got the tooltip changing (it's a start!) to the path of the selected target. The tooltip displayed now is the valid selected path. However, I am still having difficulties changing the image (when given images it becomes a hole through to the desktop, not loading the new image) and executing them (No matter what I try, I cannot seem to execute the file held in Target1). I must just be missing something small, can anybody spot it?

Posted by member 212670 on 2007-06-21 11:40:42 link

For your !alert test, you have to run the right command for the vars to be expanded.

mzscript (!varset): !msgbox %{target} or !exec !alert %{target}
step.rc (var value): !alert $target$
xlabel (!setevar): !parseevars !alert %#target%#

If you're using !varset for your target var, then you'd do !setevar panicbuttontooltip "%{target}\asd"

Also note: In mzscripts, !parseevars isn't required for %#vars%#.

Posted by member 256241 on 2007-06-21 12:11:05 link

Thanks, I've now got it working, although obviously the scope for selecting an invalid image for an icon are large though. Executing them now works as well. To be honest, I'm not exactly sure what I changed :/, I think I was just messing up all of the $'S %'s and #'s...

Well, I'm theoretically onto the last step now, loading each buttons state at the start, and saving as they are edited. Could someone please tell me the best way to do this? Is it a case of a module which can save values to a file, or is there some integrated way of storing the themes settings....

Thanks :)

Posted by member 1 on 2007-06-21 13:05:06 link

You can dump your mzscript variables to a file with a mzscript setting. And in case it wasn't clear $target1$ != %#target1%#