Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [Not my release] foo_uie_panel_splitter (Read 400628 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Not my release] foo_uie_panel_splitter

Reply #925
Hey, guys. Does anyone know what can cause this behavior? The button doesn't show up until I hover over it.



Here is a code:
Code: [Select]
$if($isvisible_c(Playlistmanager),
$movepanel_c(Albumlist,0,0,%_width%,$sub(%_height%,$div(%_height%,3)))
$drawrect(0,$sub(%_height%,$div(%_height%,3)),%_width%,24,40-40-40,,)
$textbutton(0,$sub(%_height%,$div(%_height%,3)),%_width%,24,$drawtext(PLAYLIST MANAGER,0,$sub(%_height%,$div(%_height%,3)),%_width%,24,150-152-154, hcenter vcenter),$drawtext(PLAYLIST MANAGER,0,$sub(%_height%,$div(%_height%,3)),%_width%,24,150-152-154, hcenter vcenter),PANELSHOW:Playlistmanager:0;REFRESH,options1,options2),
$movepanel_c(Albumlist,0,0,%_width%,$sub(%_height%,24))
$drawrect(0,$sub(%_height%, 24),%_width%,24,40-40-40,,)
$textbutton(0,$sub(%_height%, 24),%_width%,24,$drawtext(PLAYLIST MANAGER,0,$sub(%_height%, 24),%_width%,24,150-152-154, hcenter vcenter),$drawtext(PLAYLIST MANAGER,0,$sub(%_height%, 24),%_width%,24,150-152-154, hcenter vcenter),PANELSHOW:Playlistmanager:-1;REFRESH,options1,options2)
)

[Not my release] foo_uie_panel_splitter

Reply #926
This "isvisible" and "Panelshow" doesn't works very well...

I use global variables and showpanel instead.

Btw. you use many unnecessary code in your script...
"drawtext" in textbutton?
"drawrect" outside a textbutton?
;-)

Try this:
Code: [Select]
$init_ps_global(pl.manager,0)
$puts(btn.y,$ifequal(%pl.manager%,0,$sub(%ps_height%,24),$muldiv(%ps_height%,2,3)))
$puts(btn.cmd,$ifequal(%pl.manager%,0,1,0))

$showpanel_c(Playlistmanager,$ifequal(%pl.manager%,1,1,0))

$textbutton(0,$get(btn.y),%ps_width%,24,PLAYLIST MANAGER,PLAYLIST MANAGER,SETGLOBAL:pl.manager:$get(btn.cmd);REFRESH,brushcolor:40-40-40 fontcolor:150-152-154 hcenter vcenter,brushcolor:40-40-40 fontcolor:150-152-154 hcenter vcenter)

$ifequal(%pl.manager%,1,
    $movepanel_c(Albumlist,0,0,%ps_width%,$muldiv(%ps_height%,2,3))
    $movepanel_c(Playlistmanager,0,$add($muldiv(%ps_height%,2,3),24),%ps_width%,$sub($div(%ps_height%,3),24))
,
    $movepanel_c(Albumlist,0,0,%ps_width%,$sub(%ps_height%,24))
    $movepanel_c(Playlistmanager,0,0,0,0)
)


Of course this will only work really well, when your "Playlist Manager" is correctly placed..
So i added $movepanel_c() with its guessed coordinates.

(haven't tested it, but it should work... hopefully :-))

EDIT: have forgot something...
Make sure, you haven't placed your albumlist with other coordinates on Panel List tab or with another $movepanel_c() in your script, because it looks like you draw your button over the panel...

[Not my release] foo_uie_panel_splitter

Reply #927
Sorry, tried it now and there was still a little issue because Playlistmanager was drawn over the Albumlist...
So $movepanel_c(Playlistmanager,...) must be placed one line above the $movepanel_c(Albumlist,...)
PSS is not really convenient...

Corrected code:
Code: [Select]
$init_ps_global(pl.manager,0)
$puts(btn.y,$ifequal(%pl.manager%,0,$sub(%ps_height%,24),$muldiv(%ps_height%,2,3)))
$puts(btn.cmd,$ifequal(%pl.manager%,0,1,0))

$showpanel_c(Playlistmanager,$ifequal(%pl.manager%,1,1,0))

$ifequal(%pl.manager%,0,
    $movepanel_c(Playlistmanager,0,0,0,0)
    $movepanel_c(Albumlist,0,0,%ps_width%,$sub(%ps_height%,24))
,
    $movepanel_c(Playlistmanager,0,$add($muldiv(%ps_height%,2,3),24),%ps_width%,$sub($div(%ps_height%,3),24))
    $movepanel_c(Albumlist,0,0,%ps_width%,$muldiv(%ps_height%,2,3))
)

$textbutton(0,$get(btn.y),%ps_width%,24,PLAYLIST MANAGER,PLAYLIST MANAGER,SETGLOBAL:pl.manager:$get(btn.cmd);REFRESH,brushcolor:40-40-40 fontcolor:150-152-154 hcenter vcenter,brushcolor:40-40-40 fontcolor:150-152-154 hcenter vcenter)

[Not my release] foo_uie_panel_splitter

Reply #928
tedgo, thank you so much! Your code works great.
Actually, this was my first attempt at working with PSS. Well, and now I know that I should use global variables. :3

[Not my release] foo_uie_panel_splitter

Reply #929
ugly, ugly hacks...

Code: [Select]
SETGLOBAL:NAME:VALUE;COMMAND:Playback/Play or pause;COMMAND:Playback/Play or pause


you don't need REFRESH because it would be redundant with the above addition. this is completely inaudible using the default output method (directsound). i have vague recollections of people hearing glitches when using either ASIO/wasapi. YMMV.


Hey thanks for this hack, I've yet to try it but what's the point of global variables in PSS then? I thought they were used to control code between two different panels.

[Not my release] foo_uie_panel_splitter

Reply #930
A new splitter for DUI is on the way (Author: ttsping)
ESLyric panel + wsh panel


[Not my release] foo_uie_panel_splitter

Reply #931
I'm trying to achieve something like this. So basically what I'm doing is using the $imageabs_rc function to crop the album cover pic and resize it as a background, but the result is not blurred enough.

Is there a way to increase the blur effect?
I'm late

[Not my release] foo_uie_panel_splitter

Reply #932
Is it possible to trigger multiple commands with the $imagebutton function?
I'm late

[Not my release] foo_uie_panel_splitter

Reply #933
yes.


Re: [Not my release] foo_uie_panel_splitter

Reply #935
Is there a way to trigger the MENU and CONTEXT commands used in the button functions, on a per track basis? In other words, performing a command when the track changes?
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #936
I would like to add a button the toggles a child panel. The problem is that the button has to be on the same area of the child panel. I wrote the $movepanel function first and the $imagebutton second, but when I hit the button the panel covers the button and I can't use it to hide the panel. Is there a way to have the button always on top?
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #937
I badly need a trick to make a panel behave like a button. Basically I would like to perform a command whenever I click on that panel. I tried overlaying a transparent pic $imagebutton on that panel, but it looks like the panel covers the button, no matter the order I write the $imagebutton and $movepanel functions.

Any smart idea to achieve what I want?
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #938
Is there some reason that COMMAND:'View/Switch to playlist/Radio' doesn't work in a $textbutton? Most every other command works so it's not an issue with the button.

Re: [Not my release] foo_uie_panel_splitter

Reply #939
^It's because the menu items are dynamic and not fixed. You could have 1 playlist or 100 - changing all the time. Only components developed with the v1 SDK and newer can launch dynamic commands. WSH panel mod and JScript panel can do it with fb.RunMainMenuCommand.

Re: [Not my release] foo_uie_panel_splitter

Reply #940
If the colours are the same as in the Windows SDK, this may help.  This is the help info for the Windows SDK GetSysColor():


Code: [Select]
[...]

COLOR_ACTIVECAPTION
2
Active window title bar.
Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled.
Windows NT and Windows 95:  This remark does not apply.

[...]

Did anybody succeed using this with windows 10? I'm trying to replicate the custom title bar colour by using color index 2, but I get a totally different one. Am I using the wrong color index?

EDIT: by custom colors I mean these:
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #941
I'm trying to have the Y coordinate of a panel be dependent on the value of two global variables. This means it could have 4 different outcomes each having a different value assigned. I tried some combinations or expressions but have little luck.
This doesn't work, yes I know $equal isn't a function (it should be) but can't seem to think of any other way here. Can anyone advise?

Code: [Select]
$puts(PLAYLIST.Y,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,1)),150,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,0)),200,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,1)),250,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,0)),300,
))))
)

Re: [Not my release] foo_uie_panel_splitter

Reply #942
I'm trying to have the Y coordinate of a panel be dependent on the value of two global variables. This means it could have 4 different outcomes each having a different value assigned. I tried some combinations or expressions but have little luck.
This doesn't work, yes I know $equal isn't a function (it should be) but can't seem to think of any other way here. Can anyone advise?

Code: [Select]
$puts(PLAYLIST.Y,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,1)),150,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,0)),200,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,1)),250,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,0)),300,
))))
)


Try this:
Code: [Select]
$puts(PLAYLIST.Y,$sub(300,$mul(50,$add($mul(2,%_PLAYLISTX_EXPANDED%),%_FILTER_MODE%))))

EDIT: sorry, there was a last bracket missing, which I added now.
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #943
Thank you for your answer, it seems to work (you missed a ')' in the expression at the end). But surely there is an a more elegant way of doing this. The numbers I provided were just an example and I don't see this working great with any random numbers which is actually what I'm looking for.
For instance if I were to make it like this I don't see it working well. Especially if I scale it up to 3 global variables instead of 2.

Code: [Select]
$puts(PLAYLIST.Y,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,1)),1167,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,0)),90,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,1)),310,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,0)),1130,
))))
)

Re: [Not my release] foo_uie_panel_splitter

Reply #944
Thank you for your answer, it seems to work (you missed a ')' in the expression at the end).
Yes, I edited my previous post when I realized it, but not on time  ;)

But surely there is an a more elegant way of doing this. The numbers I provided were just an example and I don't see this working great with any random numbers which is actually what I'm looking for.
For instance if I were to make it like this I don't see it working well. Especially if I scale it up to 3 global variables instead of 2.

Code: [Select]
$puts(PLAYLIST.Y,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,1)),1167,
$if($and($equal(%_PLAYLISTX_EXPANDED%,1),$equal(%_FILTER_MODE%,0)),90,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,1)),310,
$if($and($equal(%_PLAYLISTX_EXPANDED%,0),$equal(%_FILTER_MODE%,0)),1130,
))))
)

How about this?
Code: [Select]
$puts(myvar,$sum($mul(2,%_PLAYLISTX_EXPANDED%),%_FILTER_MODE%))
$puts(PLAYLIST.Y,
$ifequal($get(myvar),3,1167,
$ifequal($get(myvar),2,90,
$ifequal($get(myvar),1,310,1130))))
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #945
Here's the 3 variables version:

Code: [Select]
$puts(myvar,$sum(%mul(3,%THIRD_VARIABLE%),$mul(2,%_PLAYLISTX_EXPANDED%),%_FILTER_MODE%))
$puts(PLAYLIST.Y,
$ifequal($get(myvar),6,n1,
$ifequal($get(myvar),5,n2,
$ifequal($get(myvar),4,n3,
$ifequal($get(myvar),3,n4,
$ifequal($get(myvar),2,n5,
$ifequal($get(myvar),1,n6,n7)))))))


I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #946
If the colours are the same as in the Windows SDK, this may help.  This is the help info for the Windows SDK GetSysColor():


Code: [Select]
[...]

COLOR_ACTIVECAPTION
2
Active window title bar.
Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled.
Windows NT and Windows 95:  This remark does not apply.

[...]

Did anybody succeed using this with windows 10? I'm trying to replicate the custom title bar colour by using color index 2, but I get a totally different one. Am I using the wrong color index?

EDIT: by custom colors I mean these:


Apparently the color I'm looking for is the system accent color. So, the question now is: is there a color index for the windows 10 accent color that can be used in the $getsyscolor function?
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #947
I see the logic in your solution and to my estimate it should work but I'm not getting the expected result. I'll have to look into it a bit further to establish if there's more going on here with my script. Thanks for the replies.

Re: [Not my release] foo_uie_panel_splitter

Reply #948
I see the logic in your solution and to my estimate it should work but I'm not getting the expected result. I'll have to look into it a bit further to establish if there's more going on here with my script. Thanks for the replies.

Sorry, I just noticed my mistake.: there was a parameter missing in the last $ifequal statement, which I edited now.
I'm late

Re: [Not my release] foo_uie_panel_splitter

Reply #949
It seems to only respond on the last value.
Using this
Code: [Select]
$puts(myvar,$sum($mul(2,%_PLAYLISTX_EXPANDED%),%_FILTER_MODE%))
$puts(PLAYLIST.Y,
$ifequal($get(myvar),3,1167,
$ifequal($get(myvar),2,90,
$ifequal($get(myvar),1,310,1130))))

Only 1130 is recognized no matter what combinations of global values I use. Strange.