|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Wed Sep 07, 2005 6:29 pm
Multilevel action chaining doesnt work.. ? |
Hey again, its me with more bugs.. ;) (thanks to the admirer who gave me a zApp Licence #!)
I'm trying to chain actions more than once, i.e. action "ChooseFile" derives from "_FileOpen", and actions "ChooseFileL" and "ChooseFileR" both derive from "ChooseFile", but setting either of those as my menu item action causes no text, no icon to appear, and nothing to happen when clicking:
Code: |
<action name='ChooseFileL' caption='Open' action='ChooseFile'>
<script language='PerlScript'>
<![CDATA[
$MainObj->currentlist->{Value} = 'bkmklist1';
]]>
</script>
</action>
<action name='ChooseFileR' caption='Open' action='ChooseFile'>
<script language='PerlScript'>
<![CDATA[
$MainObj->currentlist->{Value} = 'bkmklist2';
]]>
</script>
</action>
<toolbar name='mainmenu'>
<menu caption='&Left'>
<item action='ChooseFileL'/>
<item action='_FileExit'/>
</menu>
<menu caption='&Right'>
<item action='ChooseFileR'/>
<item action='_FileExit'/>
</menu>
</toolbar>
<action name='ChooseFile' action='_FileOpen'>
<script language='PerlScript'>
<![CDATA[
my $this = $MainObj->ChooseFile;
$this->Dialog->{Filter} = "ADR Files (*.adr)|*.adr|HTML (*.html) Files|*.html|All Files (*.*)|*.*";
$this->Dialog->{FilterIndex}=1;
if($core->ExecuteAction)
{
$MainObj->mainwindow->{Caption} = "&AppTitle; - " . $this->Dialog->{Filename};
LoadFile($this->Dialog->{Filename});
}
]]>
</script>
</action>
|
Using just "ChooseFile" on both works as expected, but I'd like to set that extra variable first.. Is that supposed to work at all? I'd imagine plugins would be kind of useless if not..
Lady C.[/code] |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Sep 09, 2005 6:36 pm |
Unfortunately you can only chain an action from a system action. You can't chain a user action to another user action.
In a plugin you don't need to chain stuff. A plugin just defines the same action and adds a script. zApp is set up to automatically daisy-chain scripts of the same item. So the original action script runs first, followed by the action script in the plugin. No need to inherited anything.
I'll consider allowing user actions to chain from other user actions if I can figure out how to do it. Go ahead and post this in the zApp Bug Reports as a feature request. |
|
|
|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Sun Sep 11, 2005 8:17 am |
Hmm, I managed to figure a way to work around this particular one, by using zEvent.Sender .. At least, I hope it'll work, once you fix it! :)
Lady C. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|