style = 512 for inputselect()
Re: style = 512 for inputselect()
Most of the logic already exists in popupmenu (to handle the Caption|Data|Icon logic).
A bit of copy and paste and minimal refactoring should be able to handle this.
The good thing: XY could be a superb program starter (because it's filterable!) as well...
I'd even provide a script for it
A bit of copy and paste and minimal refactoring should be able to handle this.
The good thing: XY could be a superb program starter (because it's filterable!) as well...
I'd even provide a script for it
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
The logic is fine. But this is not a case for copy and paste.
Well, anyway, what is that "Data" field supposed to do?
Well, anyway, what is that "Data" field supposed to do?
FAQ | XY News RSS | XY Twitter
Re: style = 512 for inputselect()
Caption = What to display in the inputselect() window
Data = What to return for the selected item (if Data is not used, return from Caption instead)
Icon = If not provided, return from Data (and if Data is not used, return from Caption)
I thought I've explained it within the example script on post #14?
viewtopic.php?p=160211#p160211
Data = What to return for the selected item (if Data is not used, return from Caption instead)
Icon = If not provided, return from Data (and if Data is not used, return from Caption)
I thought I've explained it within the example script on post #14?
viewtopic.php?p=160211#p160211
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
I expected that but it was not totally clear from that other post. Better ask twice.Data = What to return for the selected item (if Data is not used, return from Caption instead)
OK, I'm on it. It might work out...
FAQ | XY News RSS | XY Twitter
Re: style = 512 for inputselect()
Great, then I can finally close my 7 year old "user configurable icon for inputselect()" request:
viewtopic.php?f=5&t=6839
viewtopic.php?f=5&t=6839
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
Yes, you will get your thing as well. Flag 2048.zakhar wrote:
FAQ | XY News RSS | XY Twitter
Re: style = 512 for inputselect()
Very cool, thanks for adding this stuff. Lots of usecases here...
One small bug:
It should return Audacity, not "<empty>". Rule: If "Data" isn't populated at all, return "Caption"
The icon is displayed correctly btw.
One small bug:
Code: Select all
$list = <<<>>>
Audacity||D:\Tools\@Shortcuts\Audacity [Portable].lnk
>>>;
text inputselect("Test: Caption|Data|Icon", $list, <crlf>, 1 + 1024);
The icon is displayed correctly btw.
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
This is not a missing field but an empty field. IMO it's correct to return nothing in this case.
FAQ | XY News RSS | XY Twitter
Re: style = 512 for inputselect()
I am happy!admin wrote:Yes, you will get your thing as well. Flag 2048.zakhar wrote:
Thank you very much!
Re: style = 512 for inputselect()
Ok, I can live with that.IMO it's correct to return nothing in this case.
What I'd like to see supported though: XY internal icons...
E.g.
Code: Select all
$list = <<<>>>
7-Zip|7-Zip Selected|:del
>>>;
text inputselect("Test: Caption|Data|Icon", $list, <crlf>, 1 + 1024);
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
In the meantime I rethought it. What could be the use of returning nothing? Well, I cannot see much there. I will silently change the behavior with the next release. I will update the last change log accordingly already now.highend wrote:Ok, I can live with that.IMO it's correct to return nothing in this case.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: style = 512 for inputselect()
Coming...highend wrote:What I'd like to see supported though: XY internal icons...
FAQ | XY News RSS | XY Twitter
Re: style = 512 for inputselect()
@zakhar
Sure, this could be done with style = 2048 as well but I personally don't want to see any ".exe.lnk" extensions...
Code: Select all
end compare(<xyver>, "19.00.0302", "v") == -1, "This script requires at least v19.00.0302, terminating now!";
$sepID = "<sep>";
$sepIcon = ":queue";
$subLocations = <<<>>>
%USERPROFILE%\Desktop\1
%USERPROFILE%\Desktop\2
%USERPROFILE%\Desktop\3
>>>;
$sep = strrepeat("-", 46) . "x";
$listOfLinks = "";
foreach($subLocation, $subLocations, <crlf>, "e") {
if (exists($subLocation) == 2) {
$links = quicksearch(".lnk", $subLocation);
if ($links) { $listOfLinks .= $links . <crlf> . "$sep|$sepID|$sepIcon" . <crlf>; }
}
}
$listOfLinks .= quicksearch(".lnk /n", "%USERPROFILE%\Desktop");
// Build "Caption|Data|Icon"
$listOfLinks = regexreplace($listOfLinks, "^(.+\\)(.*?)(?=\r?\n|$)", "$2|$1$2|$1$2");
// Remove (.exe).lnk in "Caption"
$listOfLinks = regexreplace($listOfLinks, "^(.+?)(\.exe)?\.lnk\|", "$1|");
// Sel + execute item
$selected = inputselect("", $listOfLinks, <crlf>, 1+1024, , 400, 700);
if ($selected == $sepID) { status "No valid entry selected, aborted!", "8B4513", "stop"; end true; }
open $selected;
One of my scripts helped you out? Please donate via Paypal
Re: style = 512 for inputselect()
Some hours ago I have switched to v19.00.0301 and my script looks now like this (very simple):
It works fine!
What I would like to have changed is the representation of $d - in the dialog window it has a "gray question" icon but I think that is not
a problem as I can simulate this separator element by a link to a renamed icon file. Its name would then be something like this
"--------------------------------------------x.lnk". Clicking it will end the script.
To day I would not use regexp elements ("^(.+\\)(.*?)(?=\r?\n|$)" and others) while I am not familiar with them.
I understand what they do, but not now. May be later. Therefore .lnk tail will stay a while.
Code: Select all
$qs1 = quicksearch(".lnk","C:\Users\User\Desktop\1");
$qs2 = quicksearch(".lnk","C:\Users\User\Desktop\2");
$qs3 = quicksearch(".lnk","C:\Users\User\Desktop\3");
$qs4 = quicksearch(".lnk /n","C:\Users\User\Desktop");
$d = "--------------------------------------------x";
$qs1 = "$qs1<crlf>$d<crlf>$qs2<crlf>$d<crlf>$qs3<crlf>$d<crlf>$qs4";
$a = inputselect("","$qs1","<crlf>",1+2048,0,400,700,"",);
if($a == "" || $a == $d){
$a = 0;
}
end $a == 0;
open "$a";
What I would like to have changed is the representation of $d - in the dialog window it has a "gray question" icon but I think that is not
a problem as I can simulate this separator element by a link to a renamed icon file. Its name would then be something like this
"--------------------------------------------x.lnk". Clicking it will end the script.
To day I would not use regexp elements ("^(.+\\)(.*?)(?=\r?\n|$)" and others) while I am not familiar with them.
I understand what they do, but not now. May be later. Therefore .lnk tail will stay a while.