Author Topic: Buttons description in .msf skin file: how to pass parameter to a Service ?  (Read 4580 times)

0 Members and 1 Guest are viewing this topic.

Offline arter

  • Newbie
  • *
  • Posts: 4
Hello,

I'm trying to modify a skin to change the function of a button, but i don't know the good syntax to call a service that needs a parameter.

I want to call "CListFrames/SHFrame" to hide/show the frame of the contact list toolbar, but this service needs a wParam : the frameId of this frame which is simply "Toolbar".

So how can I pass a wParam (or lParam) in this kind of command ?

#ToolbarButton=sPush,CListFrames/SHFrame,-76,1,-50,19,R-R--,0,0,Show/Hide Toolbar

Thank's for any help
 

Offline unsane

Hi, Try to use '%' as delimeter (e.g. CListFrames/SHFrame%param1%param2)
Si no estas con nosotros, estas contra nosotros.
 

Offline arter

  • Newbie
  • *
  • Posts: 4
Thank you very much unsane, it works !

#Toolbar=sPush,CListFrames/SHFrame%%6,-76,1,-50,19,R-R--,0,0,Show/Hide Toolbar

first parameter wParam is useless, so left empty and second lParam is 6 for the FrameId (I just try different number to find the good FrameId of the toolbar). Like this you can put a button anywhere to hide/show a frame you don't use all the time.

Thank's a lot for your help
 

Offline arter

  • Newbie
  • *
  • Posts: 4
Today when i restart Miranda, I had the surprise that the toolbar don't want to show up anymore when i click on my new button. I have to change my profile database with a backup profile and then the toolbar works again normally.

So i make a byte comparison of the 2 profiles database and find that the problem comes with the key "Height" in the folder CLUIFRAMES that contains all the parameters for the frames.

What is happening is that when i click on my button to hide the toolbar frame, its visible property is taken to 0 as it should, BUT its height is also taken to 0. And when doing reverse, visible is well set to 1 but height is not restore and stays at 0, so you can't see the frame.

I look in the options of contact list -> toolbar and see i have an option to "Auto Resize" which was checked. I don't remenber if it is checked by default when you install this plugin, or it's me who has done it. But when this option is unchecked, then the heigh property of toolbar frame is not anymore taken to 0 when this frame is hidden. So I can now Hide/show frame again without problem.

Then I have try to see if this behavior is the fault of my specific button command i have add, so i try to do reproduce the bug using the miranda menu instead of using my new button. I have rechecked the toolbar option "autoresize" and in the menu of miranda, I ask to hide the toolbar frame and then try to make it show again: the problem comes back and toolbar don't appears because its height was set to 0 by autoresize option.

I think this is probably a little bug in the toolbar code, which make "autoresize" option conflicting with Hide/show frames. Autoresize should not resize (change height parameter) in the case the toolbar frame is hidden, because in this case it considers that the toolbar has no height and resize it to 0. But when toolbar is shown again, autoresize can't put back the previous value of height and toolbar is visible but with no size that allows to see it.

So if you want to hide/show the toolbar, be sure the option "autoresize" is not checked and then everything works fine.