Old 7th February 2009, 02:41   #1
win64
Junior Member
 
Join Date: Feb 2009
Posts: 2
Question Always on top button

Hi
I search and search for way to implement Always on top function.

I found some wasabi code here:
http://forums.winamp.com/showthread.php?s=&threadid=127265&highlight=toggle+always+on+top

Quote:
const GUID options_guid = { 0x280876cf, 0x48c0, 0x40bc, { 0x8e, 0x86, 0x73, 0xce, 0x6b, 0xb4, 0x62, 0xe5 } };
CfgItem *options=api->config_getCfgItemByGuid(options_guid);
if (options != NULL) {
int isOnTop = options->getDataAsInt("Always on top");

if (isOnTop == 1) {
options->setDataAsInt("Always on top", FALSE);
} else {
options->setDataAsInt("Always on top", TRUE);
}
}
I tried to import it into maki script like this:
Quote:
String options_guid = "{280876cf-48c0-40bc-8e86-73ce6bb462e5}";
options = Config.getItemByGuid(options_guid);
if (options != NULL)
{
int a = options.getAttribute("Always on top");
if (a == 1)
{
return TRUE;

}

}
return FALSE;
but with no success. ConfigItem object options is found but options.getAttribute("Always on top") always returns 0.

Thanks for any reply
win64 is offline   Reply With Quote
Old 9th February 2009, 11:24   #2
RandomCarpet
Senior Member
 
RandomCarpet's Avatar
 
Join Date: Sep 2002
Location: BG
Posts: 265
What exactly do you want to implement?
A button that toggles Always on top ON / OFF , or you just want to get its current state (ON or OFF)?
PHP Code:
...
  
String options_guid "{280876cf-48c0-40bc-8e86-73ce6bb462e5}";
  
options Config.getItemByGuid(options_guid);
  
options.getAttribute("Always on top");
... 
this should get Always on top's current state, but not modify it.

Easiest way to implement a toogle button for Always on top is:
PHP Code:
(xml)

<
togglebutton
  id
="..."
  
cfgattrib="{280876CF-48C0-40BC-8E86-73CE6BB462E5};Always on top"
  
image="..."
  
downimage="..."
  
activeimage="..."
  
x=".." y=".."
  
tooltip="Toggle Always on top"
/> 

Latest skin: fCrcl
RandomCarpet is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump