Re: drop down box or something like it.
Brian Wolven <[email protected]>
| Newsgroups | gmane.comp.windows.shells.litestep |
|---|---|
| Message-ID | <[email protected]> |
Hale, Paul wrote:
> SNIP
>>>> *Popup "Select color scheme" !new !popupSchemes
>>>> *Popup "Select color scheme"
>>>> !popupDynamicACtionFolder:!apply_colors:"$SchemesDir$"
>>>> *Popup ~New
>>>>
> SNIP
>>> Wow... That is perfect actually. Okay, now how about saving the
>>> filename as an evar?
> SNIP
>> That's why I defined bangs like these:
>>
>> *alias !saveSetting !execute [!setEvar %1 %2][!xtextSaveEvar @$settingsFile$@ @%1@ @%2@]
>> *alias !stripPath !execute [!xtextReplace @$settingsFile$@ @(^%1 \=)(.*\\)(.*\..*\=)_@ @\1\3@]
>> *alias !stripExtn !execute [!xtextReplace @$settingsFile$@ @(^%1 \=.*)(\..*\=)_@ @\1\=@]
>
> OK, bear with me as I am slow. As I understand it, the popupaction uses
> the data after the " : " as the arguments, so when looking at your
> Alias's I am trying to figure where the file path is represented. I
> don't understand the %1 %2. Also, in this example, is $settingFile$ the
> themevars? If so, where is the Var that it is trying to replace? I am
> used to the
>
> !xTextSaveEvar @file_the_Var_is_in@ @var_to_be_changed@ "new_value"
>
> format. In my head, I am trying to figure out how your configs work.
> Sorry if I sound dumb on this, I just don't get it yet.
!savesetting does two things:
1) Sets the evar with !setEvar so that it is replaced "immediately", and
2) Saves it to the settings file so that it's updated for future use
(!recycle, reboot, restart LS, etc.)
The %1 and %2 are just the two arguments to the bang; the first is the
setting/evar name, the second is the setting/evar value. So
!savesetting "username" "BigDaddy"
would place this line in the settings file after defining the evar:
username "BigDaddy"
Since the popup action feeds us the full path name (and that is not
configurable) I first save the setting with the full path and extension,
and then "strip" the folder and/or extension stuff off, as needed.
!stripPath and !stripExtn are called with only the setting/evar name
(e.g., username), and the regEx (regular expression) takes care of the rest.
---------------------------------------------------------------------
Can't Unsubscribe? Check http://desktopian.org/listunsub.html
LS List Homepage: http://wuzzle.org/list/litestep.php
Get the LS FAQ: http://lsfaq.shellfront.org