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: WSH Panel Mod (Read 811786 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod

Reply #550
Strange crashes when using the latest version: one, two.

You should see the reason for first crash in Event Viewer -> Application events. Components compiled with the new SDK should now also crash properly so that crashlog writing and internal troubleshooting works.

WSH Panel Mod

Reply #551
@Case
Thanks for your reply. It seems WSH Panel Mod causes the crash.


WSH Panel Mod

Reply #552
@ T.P. Wang : Yes, my mistake, sorry. The buttons are never in their "down" state. When you click on them, menus show up, but buttons remain in their "normal" state.

I wonder if I should try to modify the code, in order to make menus appear when button is released ??

WSH Panel Mod

Reply #553
@phoen1x:
Because "TrackPopupMenu()" is a blocking function, mean is: codes after that function won't be executed until you have chosen an popup menu result.
So, you should add something:
Code: [Select]
if (menuXXX.checkstate("down",x,y)==ButtonStates.down) {
// Set state to "hover"
menuXXX.checkstate("move", x, y);
...
// the following code will invoke TrackPopupMenu();

WSH Panel Mod

Reply #554
 
I'm afraid this code does not help in any way ... It does not change the button's state when clicked. However, when you right-click on any menu button, and keep left-clicking only on buttons, It makes buttons keep their "hover state" .

I'm sorry to bother you with these problems ...

And please, excuse my english, I'm from France =)

PS: I'll try to update to Foobar 1.0 within a few hours, and see what happens !

WSH Panel Mod

Reply #555
Why not handle these actions in on_mouse_lbtn_up() ?

 

WSH Panel Mod

Reply #556
that's exactly what I suggested earlier, I'll give it a shot.
But how can I tell the Button to take the "normal" AFTER the menu is closed ?

WSH Panel Mod

Reply #557
Set these button states to "normal" after TrackPopupMenu() is invoked, ASAP.

WSH Panel Mod

Reply #558
WSH Panel Mod 1.2.2 Beta 2 uploaded.
Just some tiny fixes and the docs is updated.

WSH Panel Mod

Reply #559
how do you use "CheckMenuItem"?

Code: [Select]
_menu.AppendMenuItem(MF_STRING, 2, "Prefer embedded");    
_menu.CheckMenuItem(2, ??);


i've tried 1 or 0, true or false and the id of the item but none work.

(i'm assuming this is a "tick" option as opposed to using radio??)

WSH Panel Mod

Reply #560
Code: [Select]
#define MF_UNCHECKED       0x0000
#define MF_CHECKED         0x0008
Full-quoting makes you scroll past the same junk over and over.

WSH Panel Mod

Reply #561
doh. i'm such an idiot. thanks.

WSH Panel Mod

Reply #562
Yes, I've used it, but wait, the value of "check" is not either true or false.
You can use MF_CHECKED (0x8) or MF_UNCHECKED (0x0), however, I may make it to use boolean value in the next version, you can use MF_CHECKED and MF_UNCHECED at this time, since non-zero value will be treated as true.

WSH Panel Mod

Reply #563
well i'm using this for now and it works perfectly.

Code: [Select]
_menu.CheckMenuItem(2, window.GetProperty("embed", 0) == 0 ? 0x0 : 0x8);

WSH Panel Mod

Reply #564
News:
WSH Panel Mod 1.2.2 Beta 3 is uploaded, the major change is that this panel is now both UI Element (DUI) and UI Extension (CUI).

WSH Panel Mod

Reply #565
News:
WSH Panel Mod 1.2.2 Beta 3 is uploaded, the major change is that this panel is now both UI Element (DUI) and UI Extension (CUI).


I can't express how amazed I am by these news. This is the first time, that such a configurable component hits DUI. Thank you so much!

WSH Panel Mod

Reply #566
one rather large problem. it's completely broken CUI. i've got the menu and can open the preferences but everything else is gone. i'm also able to open the console but that doesn't display anything exciting.

edit: i've managed to make it crash...

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 70D7C674h
Access violation, operation: read, address: 9B324A95h

Call path:
entry=>app_mainloop

Code bytes (70D7C674h):
70D7C634h:  8D 46 04 50 C7 44 24 44 FF FF FF FF FF 15 C8 E1
70D7C644h:  DE 70 85 C0 0F 85 65 FF FF FF E9 56 FF FF FF CC
70D7C654h:  CC CC CC CC CC CC CC CC CC CC CC CC B8 E8 30 DF
70D7C664h:  70 C3 CC CC CC CC CC CC CC CC CC CC 8B 4C 24 04
70D7C674h:  8B 01 8B 50 08 6A 06 68 F8 30 DF 70 FF D2 C2 04
70D7C684h:  00 CC CC CC CC CC CC CC CC CC CC CC 8B 44 24 08
70D7C694h:  8B 54 24 04 83 C1 04 50 51 8B 4C 24 14 E8 1A 53
70D7C6A4h:  FF FF C2 0C 00 CC CC CC CC CC CC CC 8B 54 24 04

Stack (0019EF08h):
0019EEE8h:  00000000 FFFFFD34 000002E4 FFFFFD34
0019EEF8h:  000002CC 00000019 00000000 047454D9
0019EF08h:  047454AB 9B324A95 00000000 00000000
0019EF18h:  00000000 03DF1EB8 0000EF24 0019F034
0019EF28h:  047F24D8 00000000 0019F040 04784CB8
0019EF38h:  04A1A008 0019F020 9B3255C5 00190620
0019EF48h:  048A1860 00000001 00000064 00000000
0019EF58h:  00000000 00000000 00000000 00000000
0019EF68h:  00000000 00000000 00000000 00000000
0019EF78h:  00000000 00000000 00000000 00000000
0019EF88h:  00000000 00000000 00000000 00000000
0019EF98h:  00000000 00000000 00000000 00000000
0019EFA8h:  00000000 00000000 00000000 00000000
0019EFB8h:  00000010 04732112 0019EFE0 047CAE44
0019EFC8h:  04A10000 00000000 00000004 00000000
0019EFD8h:  00000500 0019F018 76C98BCD 00010080
0019EFE8h:  0480F1EC 00000000 4680A648 00000000
0019EFF8h:  00000000 00000000 00000000 0015049E
0019F008h:  00000834 04710000 00000000 40000000
0019F018h:  00000000 00000001 00000000 0480F1EC

Registers:
EAX: 70DF3B34, EBX: 023B2238, ECX: 9B324A95, EDX: 70D7C670
ESI: 00000002, EDI: 0019EF1C, EBP: 0019EF30, ESP: 0019EF08

Crash location:
Module: foo_uie_wsh_panel_mod
Offset: C674h

Loaded modules:
foobar2000                      loaded at 003F0000h - 005A9000h
ntdll                            loaded at 77A80000h - 77C00000h
kernel32                        loaded at 77150000h - 77250000h
KERNELBASE                      loaded at 76570000h - 765B6000h
COMCTL32                        loaded at 73830000h - 739CE000h
msvcrt                          loaded at 76770000h - 7681C000h
GDI32                            loaded at 773D0000h - 77460000h
USER32                          loaded at 76C80000h - 76D80000h
ADVAPI32                        loaded at 75650000h - 756F0000h
sechost                          loaded at 76D90000h - 76DA9000h
RPCRT4                          loaded at 772E0000h - 773D0000h
SspiCli                          loaded at 755F0000h - 75650000h
CRYPTBASE                        loaded at 755E0000h - 755EC000h
LPK                              loaded at 76D80000h - 76D8A000h
USP10                            loaded at 765C0000h - 7665D000h
SHLWAPI                          loaded at 76950000h - 769A7000h
DSOUND                          loaded at 75440000h - 754B2000h
ole32                            loaded at 76B00000h - 76C5C000h
WINMM                            loaded at 75400000h - 75432000h
POWRPROF                        loaded at 753D0000h - 753F5000h
SETUPAPI                        loaded at 763D0000h - 7656D000h
CFGMGR32                        loaded at 769B0000h - 769D7000h
OLEAUT32                        loaded at 76690000h - 7671F000h
DEVOBJ                          loaded at 76C60000h - 76C72000h
UxTheme                          loaded at 737B0000h - 73830000h
SHELL32                          loaded at 756F0000h - 76339000h
shared                          loaded at 10000000h - 1002B000h
imagehlp                        loaded at 77250000h - 7727A000h
dbghelp                          loaded at 74C60000h - 74D4B000h
COMDLG32                        loaded at 77600000h - 7767B000h
IMM32                            loaded at 77280000h - 772E0000h
MSCTF                            loaded at 76820000h - 768EC000h
CLBCatQ                          loaded at 76DB0000h - 76E33000h
MMDevApi                        loaded at 73730000h - 73769000h
PROPSYS                          loaded at 73630000h - 73725000h
dwmapi                          loaded at 73780000h - 73793000h
foo_run                          loaded at 00390000h - 003EF000h
foo_converter                    loaded at 02CD0000h - 02D40000h
foo_verifier                    loaded at 025B0000h - 025F3000h
foo_ui_std                      loaded at 03160000h - 0326E000h
gdiplus                          loaded at 71ED0000h - 72060000h
MSIMG32                          loaded at 74D60000h - 74D65000h
foo_audioscrobbler              loaded at 02D80000h - 02DB1000h
foo_facets                      loaded at 03020000h - 030A1000h
foo_uie_panel_splitter          loaded at 03270000h - 032C9000h
foo_uie_console                  loaded at 024A0000h - 024BA000h
foo_albumlist                    loaded at 03A70000h - 03ACC000h
foo_uie_wsh_panel_mod            loaded at 70D70000h - 70E19000h
foo_fileops                      loaded at 03AD0000h - 03B18000h
foo_input_std                    loaded at 04230000h - 0437D000h
foo_bitcompare                  loaded at 030F0000h - 03118000h
foo_customdb                    loaded at 04520000h - 045C0000h
foo_ui_columns                  loaded at 04710000h - 04883000h
foo_uie_library_tree            loaded at 03FE0000h - 04037000h
foo_uie_graphical_browser        loaded at 70CD0000h - 70D64000h
foo_utils                        loaded at 70F10000h - 70F54000h
foo_softplaylists                loaded at 72190000h - 721E1000h
WININET                          loaded at 76E40000h - 76F34000h
Normaliz                        loaded at 77A50000h - 77A53000h
urlmon                          loaded at 774C0000h - 775F5000h
CRYPT32                          loaded at 769E0000h - 76AFC000h
MSASN1                          loaded at 77470000h - 7747C000h
iertutil                        loaded at 76F50000h - 77149000h
foo_uie_elplaylist              loaded at 04480000h - 044F1000h
ctagent                          loaded at 03430000h - 03437000h
WindowsCodecs                    loaded at 74A40000h - 74B3B000h
apphelp                          loaded at 749F0000h - 74A3B000h
EhStorShell                      loaded at 74970000h - 749A1000h
GROOVEEX                        loaded at 74170000h - 74568000h
MSVCR90                          loaded at 748C0000h - 74963000h
MSVCP90                          loaded at 74830000h - 748BE000h
ATL90                            loaded at 749C0000h - 749EB000h
GrooveIntlResource              loaded at 72ED0000h - 73371000h
ntshrui                          loaded at 74750000h - 747BF000h
srvcli                          loaded at 73D30000h - 73D49000h
cscapi                          loaded at 749B0000h - 749BB000h
slc                              loaded at 74820000h - 7482A000h
SXS                              loaded at 735B0000h - 7360F000h
profapi                          loaded at 752C0000h - 752CB000h
ws2_32                          loaded at 77480000h - 774B5000h
NSI                              loaded at 76F40000h - 76F46000h
dnsapi                          loaded at 74B90000h - 74BD4000h
iphlpapi                        loaded at 73CF0000h - 73D0C000h
WINNSI                          loaded at 73CE0000h - 73CE7000h
RASAPI32                        loaded at 706B0000h - 70702000h
rasman                          loaded at 70690000h - 706A5000h
rtutils                          loaded at 72150000h - 7215D000h
sensapi                          loaded at 70680000h - 70686000h
NLAapi                          loaded at 74BE0000h - 74BF0000h
rasadhlp                        loaded at 74800000h - 74806000h
mswsock                          loaded at 739F0000h - 73A2C000h
wshtcpip                        loaded at 739E0000h - 739E5000h
wship6                          loaded at 74810000h - 74816000h
fwpuclnt                        loaded at 747C0000h - 747F8000h
CRYPTSP                          loaded at 73A70000h - 73A86000h
rsaenh                          loaded at 73A30000h - 73A6B000h
sud                              loaded at 70C10000h - 70CCB000h
ADVPACK                          loaded at 751B0000h - 751DE000h
VERSION                          loaded at 73C90000h - 73C99000h
DUI70                            loaded at 745E0000h - 74692000h
explorerframe                    loaded at 74000000h - 7416F000h
DUser                            loaded at 746A0000h - 746CF000h

Stack dump analysis:
Address: 047454ABh (foo_ui_columns+354ABh)
Address: 047F24D8h (foo_ui_columns+E24D8h), symbol: "foobar2000_get_interface" (+309D8h)
Address: 04784CB8h (foo_ui_columns+74CB8h)
Address: 04732112h (foo_ui_columns+22112h)
Address: 047CAE44h (foo_ui_columns+BAE44h), symbol: "foobar2000_get_interface" (+9344h)
Address: 76C98BCDh (USER32+18BCDh), symbol: "CreateWindowExW" (+33h)
Address: 0480F1ECh (foo_ui_columns+FF1ECh), symbol: "foobar2000_get_interface" (+4D6ECh)
Address: 04710000h (foo_ui_columns+0h)
Address: 0480F1ECh (foo_ui_columns+FF1ECh), symbol: "foobar2000_get_interface" (+4D6ECh)
Address: 047F97DEh (foo_ui_columns+E97DEh), symbol: "foobar2000_get_interface" (+37CDEh)
Address: 04783DE2h (foo_ui_columns+73DE2h)
Address: 04771FDBh (foo_ui_columns+61FDBh)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 0480ED74h (foo_ui_columns+FED74h), symbol: "foobar2000_get_interface" (+4D274h)
Address: 047FA088h (foo_ui_columns+EA088h), symbol: "foobar2000_get_interface" (+38588h)
Address: 04788E44h (foo_ui_columns+78E44h)
Address: 047A00F8h (foo_ui_columns+900F8h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 7385768Ah (COMCTL32+2768Ah), symbol: "ImageList_CoCreateInstance" (+179Bh)
Address: 047FBA08h (foo_ui_columns+EBA08h), symbol: "foobar2000_get_interface" (+39F08h)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC12A1h (USER32+412A1h), symbol: "SendNotifyMessageW" (+341h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC1259h (USER32+41259h), symbol: "SendNotifyMessageW" (+2F9h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76CC10E2h (USER32+410E2h), symbol: "SendNotifyMessageW" (+182h)
Address: 0479FFF0h (foo_ui_columns+8FFF0h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76CC11E7h (USER32+411E7h), symbol: "SendNotifyMessageW" (+287h)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76C968EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 76CC11BEh (USER32+411BEh), symbol: "SendNotifyMessageW" (+25Eh)
Address: 76C96899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C9CD1Ah (USER32+1CD1Ah), symbol: "GetWindow" (+21Ah)
Address: 76C9CD35h (USER32+1CD35h), symbol: "SendMessageW" (+0h)
Address: 76C9CD81h (USER32+1CD81h), symbol: "SendMessageW" (+4Ch)
Address: 738D4E95h (COMCTL32+A4E95h), symbol: "GetEffectiveClientRect" (+306Ch)
Address: 738D4EF7h (COMCTL32+A4EF7h), symbol: "GetEffectiveClientRect" (+30CEh)
Address: 738D4D89h (COMCTL32+A4D89h), symbol: "GetEffectiveClientRect" (+2F60h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 737D0FC0h (UxTheme+20FC0h), symbol: "GetThemePropertyOrigin" (+69Dh)
Address: 76C96238h (USER32+16238h), symbol: "gapfnScSendMessage" (+270h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76C968EAh (USER32+168EAh), symbol: "gapfnScSendMessage" (+922h)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76C96899h (USER32+16899h), symbol: "gapfnScSendMessage" (+8D1h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C97D31h (USER32+17D31h), symbol: "LoadStringW" (+11Fh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 77A9F88Ah (ntdll+1F88Ah), symbol: "NtCallbackReturn" (+12h)
Address: 76CB0155h (USER32+30155h), symbol: "DdeQueryStringW" (+6D7h)
Address: 76C97DFAh (USER32+17DFAh), symbol: "DispatchMessageW" (+Fh)
Address: 7385F82Bh (COMCTL32+2F82Bh), symbol: "ImageList_GetIcon" (+98h)
Address: 76CB2292h (USER32+32292h), symbol: "IsDialogMessageW" (+11Eh)
Address: 76CB2174h (USER32+32174h), symbol: "IsDialogMessageW" (+0h)
Address: 0045401Fh (foobar2000+6401Fh)
Address: 76C97E92h (USER32+17E92h), symbol: "GetMessageW" (+0h)
Address: 77161199h (kernel32+11199h), symbol: "SetLastError" (+0h)
Address: 76CA0112h (USER32+20112h), symbol: "PeekMessageW" (+0h)
Address: 0051C098h (foobar2000+12C098h)
Address: 004540DEh (foobar2000+640DEh)
Address: 00454EE4h (foobar2000+64EE4h)
Address: 00537AF8h (foobar2000+147AF8h)
Address: 00537AF8h (foobar2000+147AF8h)
Address: 0054A240h (foobar2000+15A240h)
Address: 003F0000h (foobar2000+0h)
Address: 77AAE20Ch (ntdll+2E20Ch), symbol: "RtlInitUnicodeString" (+164h)
Address: 77AADF72h (ntdll+2DF72h), symbol: "RtlAllocateHeap" (+ACh)
Address: 0054A224h (foobar2000+15A224h)
Address: 77AAE20Ch (ntdll+2E20Ch), symbol: "RtlInitUnicodeString" (+164h)
Address: 77AADF72h (ntdll+2DF72h), symbol: "RtlAllocateHeap" (+ACh)
Address: 77AADEC6h (ntdll+2DEC6h), symbol: "RtlAllocateHeap" (+0h)
Address: 0056F068h (foobar2000+17F068h)
Address: 00506BB5h (foobar2000+116BB5h)
Address: 0050E4CCh (foobar2000+11E4CCh)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 0050E4CCh (foobar2000+11E4CCh)
Address: 0050C61Ch (foobar2000+11C61Ch)
Address: 77AC027Fh (ntdll+4027Fh), symbol: "RtlCreateHeap" (+1A4h)
Address: 00507402h (foobar2000+117402h)
Address: 00527087h (foobar2000+137087h)
Address: 100027BBh (shared+27BBh), symbol: "uCallStackTracker::uCallStackTracker" (+2Fh)
Address: 0053F340h (foobar2000+14F340h)
Address: 00455127h (foobar2000+65127h)
Address: 003F0000h (foobar2000+0h)
Address: 00507100h (foobar2000+117100h)
Address: 005320B4h (foobar2000+1420B4h)
Address: 0056F068h (foobar2000+17F068h)
Address: 0052F040h (foobar2000+13F040h)
Address: 00405836h (foobar2000+15836h)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 00507100h (foobar2000+117100h)
Address: 00507114h (foobar2000+117114h)
Address: 0052F040h (foobar2000+13F040h)
Address: 0052746Dh (foobar2000+13746Dh)
Address: 00507F26h (foobar2000+117F26h)
Address: 003F0000h (foobar2000+0h)
Address: 0050FB87h (foobar2000+11FB87h)
Address: 0050A0C0h (foobar2000+11A0C0h)
Address: 77163677h (kernel32+13677h), symbol: "BaseThreadInitThunk" (+12h)
Address: 77AB9D72h (ntdll+39D72h), symbol: "RtlInitializeExceptionChain" (+63h)
Address: 77189775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77189775h (kernel32+39775h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 77AF041Dh (ntdll+7041Dh), symbol: "WinSqmSetIfMaxDWORD" (+31h)
Address: 77AB9D45h (ntdll+39D45h), symbol: "RtlInitializeExceptionChain" (+36h)
Address: 00507F91h (foobar2000+117F91h)
Address: 00507F91h (foobar2000+117F91h)

Environment:
App: foobar2000 v1.0
OS: Windows 6.1.7600 x64
CPU: Pentium® Dual-Core  CPU      E5200  @ 2.50GHz, features: MMX SSE SSE2 SSE3
Audio: Speakers (Creative SB Audigy 2 (WDM)); SPDIF Out (Creative SB Audigy 2 (WDM)); Headset Earphone (XBOX 360 For Windows (Headset))
UI: Columns UI 0.3.8.3

Components:
Core (2010-01-09 11:47:00)
    foobar2000 core 1.0
foo_albumlist.dll (2010-01-09 11:44:46)
    Album List 4.4
foo_audioscrobbler.dll (2009-10-25 20:30:02)
    Audioscrobbler 1.4.3
foo_bitcompare.dll (2008-12-05 14:08:02)
    Binary Comparator 1.2
foo_converter.dll (2010-01-09 11:44:32)
    Converter 1.4
foo_customdb.dll (2009-05-09 19:17:06)
    Custom Database 0.0.9a
foo_facets.dll (2009-11-29 09:18:32)
    Facets 2008-02-25
foo_fileops.dll (2010-01-09 11:43:32)
    File Operations 2.1.2
foo_input_std.dll (2010-01-09 11:44:24)
    Standard Input Array 1.0
foo_run.dll (2009-06-07 14:15:18)
    Run services 0.3.7
foo_softplaylists.dll (2009-12-30 19:45:46)
    Soft Playlists 2009-12-30.2
foo_ui_columns.dll (2010-01-09 14:40:28)
    Columns UI 0.3.8.3
foo_ui_std.dll (2010-01-09 11:44:52)
    Default User Interface 0.9.5
foo_uie_console.dll (2009-08-29 16:06:24)
    Console panel 0.4
foo_uie_elplaylist.dll (2009-12-11 23:35:40)
    ELPlaylist 0.6.6.4(beta)
foo_uie_graphical_browser.dll (2008-04-19 21:37:54)
    Graphical Browser rev015
foo_uie_library_tree.dll (2009-07-25 00:18:14)
    Library Tree 0.3.2.5b
foo_uie_panel_splitter.dll (2009-11-26 01:03:32)
    Panel Stack Splitter 0.3.8.2(alpha)
foo_uie_wsh_panel_mod.dll (2010-01-12 14:35:41)
    WSH Panel Mod 1.2.2 Beta 3
foo_utils.dll (2008-02-08 22:26:58)
    Playlist Tools 0.6.2 beta 6
foo_verifier.dll (2009-10-05 10:39:20)
    File Integrity Verifier 1.1

Recent events:
Watching: E:\Music
Custom Database: Initialize
Custom Database: table quicktag already exists (1)
Custom Database: table database_version already exists (1)
Custom Database: index url_idx already exists (1)
Custom Database: Completed
Startup time : 0:00.204673

WSH Panel Mod

Reply #567
Sorry, wrong version uploaded, please download it again.

WSH Panel Mod

Reply #568
thanks. now working fine. i shall now have a play with DUI. 

WSH Panel Mod

Reply #569
Hello

So this evening i almost got a heart attack. i opened foobar (0.9.6.9, with the latest dark one), and all hell went loose. nothing was working, errors everywhere, database corrupted, configuration file messed up.. When i looked up the console, the most common string i was seeing had to do with "file format not supported" (something like that).

Fortunately, i had a month old app data folder backup, so i got almost everthing working again (most importantly playback statisticks), but wsh panel mod is still messing with me. in the upper left corner, just below playback controls, there is a white square with black letters "cript erro" (of course, script error shortened). It's the rating panel and it's bugging me. i tryed re-applying it, to no avail. something to do with "Microsoft JScript runtime" Anyone?


Here is my console log:

Album list panel: initialised in 0.169 s
WSH Panel Mod (GUID: F7CA1517-F171-44C3-871B-FA17038AF28A): initliased in 0.0000055 s
WSH Panel Mod (GUID: FF1A308A-F5B2-49E1-B98F-594F180E0BA6): initliased in 0.0000118 s
WSH Panel Mod (GUID: B38385B4-7CBE-4019-BB99-8CCE46084548): initliased in 0.0000174 s
Error: WSH Panel Mod (GUID: 08886804-F90F-4666-8B93-12335E0F92D8): Microsoft JScript runtime error:
File already exists
Ln: 29, Col: 2
<no source text available>
WSH Panel Mod (GUID: 27B46416-B5A0-4EE8-9E4C-0BF55FEDF8DF): initliased in 0.0000019 s
WSH Panel Mod (GUID: E1B1886B-E811-472E-9296-786231BAC70D): initliased in 0.0000062 s
WSH Panel Mod (GUID: 23221355-21CA-4A4F-B5BA-3B675D5DA564): initliased in 0.0000033 s
Album list panel: initialised in 0.158 s
Filter Panel - Genre: initialised in 0.098 s
Filter Panel - Artist: initialised in 0.141 s
Filter Panel - Album: initialised in 0.116 s

WSH Panel Mod

Reply #570
Have you installed the latest WSH Panel mod Beta?
Its for foobar2000 v1.0 only. So you should upgrade to the latest foobar2000.
DarkOne works fine here with the latest foobar2000 and the latest WSH Panel mod beta...

The line that is metioned in the console only opens the written text file...
Have you changed anything in the script?

Maybe you should close foobar2000, try deleting the "DO_current_date" files in your foobar2000 profile path and restart foobar2000.

Code: [Select]
// DarkOne Rating Panel
// Code by super-gau and tedGo
// File creation code by Br3tt

var imgPath = fb.FoobarPath + "DarkOne16\\Buttons\\Rating\\";
var stop_img = gdi.Image(imgPath + "Grey.png");

var today = new Date();
var opt_read, bool;

var plycntr = fb.TitleFormat("%play_count%");

var g_tooltip = window.CreateTooltip();
var g_down = false;
var fso = null;

try {
fso = new ActiveXObject("Scripting.FileSystemObject");
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Please make sure FSO is enabled.\nOpen command prompt and run: regsvr32 scrrun.dll\n\nYou may need to run this as administrator!");
}

set_current_date();

function update_option(optvalue) {
var f1, ts, ts2, s;

ts = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 1);
s = ts.ReadLine();
ts.Close();

try {
f1 = fso.MoveFile(fb.ProfilePath + "DO_current_date_" + s, fb.ProfilePath + "DO_current_date_" + optvalue);
ts2 = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 2);
ts2.WriteLine(optvalue);
ts2.Close();
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Couldn't move text file.\nPlease give \"full controls\" for the current user to the foobar2000 directory!");
}
}

function read_option(initvalue) {
var ts, ts2, s;

if (file_exists(fb.ProfilePath + "DO_current_date.txt") == true) {
ts = fso.OpenTextFile(fb.ProfilePath + "DO_current_date.txt", 1);
s = ts.ReadLine();
ts.Close();
return s;
} else {
try {
ts = fso.CreateTextFile(fb.ProfilePath + "DO_current_date.txt", 2);
ts.WriteLine(initvalue);
ts.Close();
ts2 = fso.CreateTextFile(fb.ProfilePath + "DO_current_date_" + initvalue, 2);
ts2.Close();
return initvalue;
} catch(e) {
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Popup("Error in WSH Rating Panel! Couldn't create text file.\nPlease give \"full controls\" for the current user to the foobar2000 directory!");
}
}
}

function file_exists(path) {
bool = fso.Fileexists(path);
return bool;
}

function set_current_date() {
var s, s1, s2, s3;
s1 = today.getFullYear();
s2 = (today.getMonth() + 1);
s3 = today.getDate();
s = s1 + ((s2 < 10) ? "-0": "-") + s2 + ((s3 < 10) ? "-0": "-") + s3;
opt_read = read_option(s);
update_option(s);
}

function RatingButton(x, y, rW) {
this.left = x;
this.top = y;
this.ratingWidth = rW;
this.normalImage = null;
this.ratingImageArray = null;
this.img = null;
this.curRating = -1;
this.controler = null;
this.active;

this.toolTips = new Array("Bad", "Average", "Good", "Very Good", "Excellent");

this.changeRating = function() {
if (this.curRating < 0 || !this.active) {
if (this.normalImage)
this.img = gdi.Image(this.normalImage);
} else {
if (this.ratingImageArray) {
if (this.ratingImageArray[this.curRating])
this.img = gdi.Image(this.ratingImageArray[this.curRating]);
}
}
window.Repaint();
}

this.showToolTip = function() {
var getMode = this.controler.getModus();
g_tooltip.Deactivate();
if (!this.active) return;
if (this.curRating > -1 && fb.IsPlaying) {
var ratingIndex = (this.curRating > 4) ? 4 : this.curRating;
if (getMode == 0 || !this.controler.IsInLibrary())
g_tooltip.Text = this.toolTips[ratingIndex];
else if (getMode == 1)
g_tooltip.Text = "Autorate-Index: " + this.controler.arIdx;
else
g_tooltip.Text = "Playcounts: " + plycntr.Eval();

g_tooltip.Activate();
}
}

this.draw = function(gr) {
if (this.img)
this.img && gr.DrawImage(this.img, this.left, this.top, this.img.Width, this.img.Height, 0, 0, this.img.Width, this.img.Height);
}

this.onClick = function() {
if (!this.active) return;
if (this.curRating > -1)
this.controler.setRating(this.curRating + 1);
}

this.on_mouse_move = function(x, y) {
if (!this.active) return;
var ratingIndex = 0;
var _x = x - this.left;
if (_x > 0 && _x < this.ratingWidth * 5) {
ratingIndex = Math.floor(_x / this.ratingWidth);
ratingIndex = ratingIndex > 5 ? 5 : ratingIndex;
if (this.curRating != ratingIndex) {
this.curRating = ratingIndex;
this.changeRating();
this.showToolTip();
}
}
}

this.on_mouse_leave = function() {
this.curRating = -1;
this.changeRating();
g_tooltip.Deactivate();
}

this.init = function() {
this.on_playback_new_track(fb.GetNowPlaying());
}

this.on_playback_new_track = function(metadb) {
if (metadb) {
if (fb.PlaybackLength <= 0 || metadb.RawPath.indexOf("cdda://" ) == 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
this.active = false;
else
this.active = true;
}
}

this.setRatingImages = function(normalImg, hoverImg) {
this.normalImage = normalImg;
this.ratingImageArray = hoverImg;
this.changeRating();
}

this.setControler = function(controler) {
this.controler = controler;
}
}

function StateControler(ratingButton) {
this.ratingButton = ratingButton;
this.ratingButton.setControler(this);
this.curMetadb = null;
this.RATING = "RATING";
this.curModus = null;
this.active;
this.arIdx;

var Colours = {
manRating:"White",
dataBase:"Yellow",
playCount:"Green",
autoRating:"Blue"
}

this.DisplayMode = function() {
this.dm_cur = window.GetProperty("Display Mode", 0);
if (typeof(this.dm_cur) != "number" || this.dm_cur < 0 || this.dm_cur > 2)
this.dm_cur = 0;

return this.dm_cur;
}

this.RatingMode = function() {
this.rm_cur = window.GetProperty("Rating Mode", 0);
if (typeof(this.rm_cur) != "number" || this.rm_cur < 0 || this.rm_cur > 2)
this.rm_cur = 0;

return this.rm_cur;
}

this.CountLimit = function() {
this.cntlmt = window.GetProperty("Playcounter Limit", 50);
if (typeof(this.cntlmt) != "number")
this.cntlmt = 50;
else if (this.cntlmt < 0)
this.cntlmt = 0;

return this.cntlmt;
}

this.setRating = function(ratingIndex) {
if (!this.active) return;
var modus = this.DisplayMode();
this.curModus = modus;

if (!this.IsInLibrary() || (modus == 0 && this.RatingMode() == 1))
this.SetMetaRating(ratingIndex);
else if (modus == 0)
fb.RunContextCommand("Rating" + "/" + ratingIndex);

this.on_metadb_changed();
}

this.SetMetaRating = function(rating) {
if (this.curMetadb)
this.curMetadb.UpdateFileInfoSimple(this.RATING, rating);
}

this.init = function() {
this.on_playback_new_track(fb.GetNowPlaying());
}

this.on_playback_new_track = function(metadb) {
if (metadb) {
if (fb.PlaybackLength <= 0 || metadb.RawPath.indexOf("cdda://" ) == 0 || metadb.RawPath.indexOf("FOO_LASTFM" ) == 0)
this.active = false;
else
this.active = true;
}

if (this.curMetadb) {window.UnwatchMetadb();}
this.curMetadb = metadb;
if (this.curMetadb) {
on_metadb_changed();
window.WatchMetadb(this.curMetadb);
}
}

this.on_metadb_changed = function() {
if (this.active) {
var mRating = this.GetMetaRating();
var modus = this.DisplayMode();
this.curModus = modus;
if (!this.IsInLibrary())
this.SetRatingDisplay(Colours.manRating, mRating > 0 ? mRating : 0, modus);
else if (modus == 2)
this.SetRatingDisplay(Colours.playCount, this.GetPlayCounts(), modus);
else if (modus == 1)
this.SetRatingDisplay(Colours.autoRating, this.GetAutoRating(), modus);
else if (this.IsMetaRating())
this.SetRatingDisplay(Colours.manRating, mRating, modus);
else
this.SetRatingDisplay(Colours.manRating, this.GetDBRating(), modus);
} else
this.ratingButton.setRatingImages(imgPath + "Grey.png", null);
}

this.IsInLibrary = function() {
if (this.curMetadb)
return fb.IsMetadbInMediaLibrary(this.curMetadb);
else
return false;
}

this.GetMetaRating = function() {
if (this.curMetadb) {
var fileInfo = this.curMetadb.GetFileInfo();
if (fileInfo) {
var idx = fileInfo.MetaFind(this.RATING);
if (idx > 0) {
var rating = fileInfo.MetaValue(idx, 0);
return (rating > 5) ? 5 : rating;
} else
return 0;
}
} else
return 0;
}

this.IsMetaRating = function() {
return (this.GetMetaRating() > 0);
}

this.GetDBRating = function() {
return fb.TitleFormat("$if2(%rating%,0)").Eval();
}

this.GetAutoRating = function() {
if (this.DisplayMode() == 1) {
var pcntr = plycntr.Eval();
var fpy = fb.TitleFormat("$year(%first_played%)").Eval();
var fpm = fb.TitleFormat("$sub($month(%first_played%),1)").Eval();
var fpd = fb.TitleFormat("$day_of_month(%first_played%)").Eval();
var fday = new Date(fpy, fpm, fpd);
var one_day = 1000 * 60 * 60 * 24;
var ar_days = Math.floor((today.getTime() - fday.getTime()) / one_day);
var ar_count = (pcntr * 5) - Math.floor(ar_days / 7.3);

this.arIdx = pcntr > 0 ? ar_count / 10 : 0;

var rating = Math.floor(ar_count / 10);
return (rating > 5) ? 5 : ((rating < 0) ? 0 : rating);
} else
return 0;
}

this.GetPlayCounts = function() {
if (this.DisplayMode() == 2) {
var rating = Math.floor(plycntr.Eval() / (this.CountLimit() / 5));
return (rating > 5) ? 5 : ((rating < 0) ? 0 : rating);
} else
return 0;
}

this.SetRatingDisplay = function(normalColour, ratingIndex, modus) {
var hoverImg = null;
if (!this.IsInLibrary() || (modus == 0 && this.RatingMode() == 1))
hoverImg = this.getHoverImages(Colours.manRating);
else if (modus == 0)
hoverImg = this.getHoverImages(Colours.dataBase);

var normalImg = null;
normalImg = imgPath + normalColour + ratingIndex + ".png";

this.ratingButton.setRatingImages(normalImg, hoverImg);

CollectGarbage();
}

this.getHoverImages = function(colour) {
var hoverImageArray = new Array();
for (var i = 1; i < 6; i++)
hoverImageArray.push(imgPath + colour + "MH"+ i +".png");

return hoverImageArray;
}

this.getModus = function() {
return this.curModus;
}
}

function CustomMenu(x, y) {
var MF_SEPARATOR = 0x00000800;
var MF_GRAYED = 0x00000001;
var MF_STRING = 0x00000000;
var MF_POPUP = 0x00000010;

var _menu = window.CreatePopupMenu();
var idx;

var star_MF = (stateControler.GetDBRating() > 0) ? MF_STRING : MF_GRAYED;

if (stateControler.IsInLibrary()) {
var _child = window.CreatePopupMenu();
var rate_MF = (stateControler.DisplayMode() == 0) ? MF_STRING : MF_GRAYED;
var pclmt_MF = (stateControler.DisplayMode() == 2) ? MF_STRING : MF_GRAYED;

var pl = stateControler.CountLimit();
var c_radio = pl == 5 ? 101 : pl == 10 ? 102 : pl == 25 ? 103 : pl == 50 ? 104 : pl == 100 ? 105 : pl == 250 ? 106 : null;

_child.AppendMenuItem(MF_STRING, 101, "5");
_child.AppendMenuItem(MF_STRING, 102, "10");
_child.AppendMenuItem(MF_STRING, 103, "25");
_child.AppendMenuItem(MF_STRING, 104, "50");
_child.AppendMenuItem(MF_STRING, 105, "100");
_child.AppendMenuItem(MF_STRING, 106, "250");
_child.CheckMenuRadioItem(101, 106, c_radio);

_menu.AppendMenuItem(star_MF, 1, "Delete rating");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Show/enable rating");
_menu.AppendMenuItem(MF_STRING, 3, "Show auto-rating");
_menu.AppendMenuItem(MF_STRING, 4, "Show playcounts");
_menu.CheckMenuRadioItem(2, 4, stateControler.DisplayMode() + 2);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(rate_MF, 5, "Rate to the database");
_menu.AppendMenuItem(rate_MF, 6, "Rate to the file tags");
_menu.CheckMenuRadioItem(5, 6, stateControler.RatingMode() + 5);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(pclmt_MF | MF_POPUP, _child.ID, "Playcount limit");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 7, "Properties");
_menu.AppendMenuItem(MF_STRING, 8, "Configure...");

idx = _menu.TrackPopupMenu(x, y);

if (idx == 0) return;

switch (idx) {
case 101:
window.SetProperty("Playcounter Limit", 5);
stateControler.init();
break;

case 102:
window.SetProperty("Playcounter Limit", 10);
stateControler.init();
break;

case 103:
window.SetProperty("Playcounter Limit", 25);
stateControler.init();
break;

case 104:
window.SetProperty("Playcounter Limit", 50);
stateControler.init();
break;

case 105:
window.SetProperty("Playcounter Limit", 100);
stateControler.init();
break;

case 106:
window.SetProperty("Playcounter Limit", 250);
stateControler.init();
break;
}

switch (idx) {
case 1:
fb.RunContextCommand("Rating" + "/" + "<not set>");
stateControler.init()
break;

case 2:
window.SetProperty("Display Mode", 0);
stateControler.init();
break;

case 3:
window.SetProperty("Display Mode", 1);
stateControler.init();
break;

case 4:
window.SetProperty("Display Mode", 2);
stateControler.init();
break;

case 5:
window.SetProperty("Rating Mode", 0);
stateControler.init();
break;

case 6:
window.SetProperty("Rating Mode", 1);
stateControler.init();
break;

case 7:
window.ShowProperties();
break;

case 8:
window.ShowConfigure();
}
} else {
_menu.AppendMenuItem(star_MF, 1, "Delete rating");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 2, "Properties");
_menu.AppendMenuItem(MF_STRING, 3, "Configure...");

idx = _menu.TrackPopupMenu(x, y);

if (idx == 0) return;

switch (idx) {
case 1:
stateControler.SetMetaRating("");
stateControler.init()
break;

case 2:
window.ShowProperties();
break;

case 3:
window.ShowConfigure();
}
}
}

button = new RatingButton(0, 0, 16);
stateControler = new StateControler(button);
stateControler.init();
button.init();

function on_mouse_move(x, y) {
button.on_mouse_move(x, y);
}

function on_mouse_lbtn_down(x, y) {
g_down = true;
}

function on_mouse_lbtn_up(x, y) {
if (g_down)
button.onClick(x, y);
g_down = false;
}

function on_mouse_rbtn_up(x, y) {
if (fb.IsPlaying && stateControler.active) {
CustomMenu(x, y);
return true;
} else
return;
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, 0xFF131E26);

if (fb.IsPlaying && button)
button.draw(gr);
else
gr.DrawImage(stop_img, 0, 0, 80, 16, 0, 0, stop_img.Width, stop_img.Height);
}

function on_mouse_leave() {
if(button)
button.on_mouse_leave();
}

function on_playback_stop() {
window.Repaint();
}

function on_playback_new_track(metadb) {
stateControler.on_playback_new_track(metadb);
button.on_playback_new_track(metadb);
window.Repaint();
}

function on_metadb_changed() {
stateControler.on_metadb_changed( );
window.Repaint();
}

Btw. what file have you tried to play as you got the error "File format not supported"?
(But a wrong file format shouldn't effect the wsh panel scripts...)

EDIT:
Don't forget that the Profile Path needs write permissions on Vista and Windows 7!
If you have set foobar2000 profile path to your foobar installation path you need to give "full controls" in UAC to your foobar folder!

WSH Panel Mod

Reply #571
Maybe you should close foobar2000, try deleting the "DO_current_date" files in your foobar2000 profile path and restart foobar2000.


That did it, thanks!

And about "file format not supported", console was writing that for all kinds of files, mp3, jpeg for covers, txt, lrc. It was a neverending stream of error messages. I had to close the foobar from task manager. Restoring the app data folder backup solved all of that, although foobar has suffered a one month amnesia.

Will i have to do anything else beide update WSH panel mod component if i update to 1.0? I mean, regarding dark one? I have it perfectly set up, i do not want to go through all that pain again..

WSH Panel Mod

Reply #572
Regarding DarkOne? No. It should work with foobar2000 v1.0 as well.

Enough hijacking this thread...

WSH Panel Mod

Reply #573
I wrote an keyboard input script for editing tags. It works (reasonably) well in foobar2000 v0.9.6.9 with wsh panel mod v1.2.1. With foobar2000 v.1.0 with wsh panel mod v1.2.2 beta 3, though, it gives a script error saying "Error: WSH Panel Mod (GUID: 55AB069D-B0DA-4E6B-84AB-287C6123DCC3): Microsoft JScript runtime error: Overflow Ln: 159, Col: 3 <no source text available>". The line number doesn't make much sense to me, because it is in the middle of a switch statement:
Code: [Select]
inputobjects = [];

// ==PREPROCESSOR==
// Include jquery here
// @import "%fb2k_path%scripts\Flags.txt"
// @import "%fb2k_path%scripts\Helpers.txt"
// @import "%fb2k_path%scripts\inputobjects.js"
// @import "%fb2k_path%scripts\values.js"
// ==/PREPROCESSOR==

function inputobjectsDraw(gr) {
for (i in inputobjects) {
inputobjects[i].draw(gr);
}
}

function inputobjectsRedraw() {
for (i in inputobjects) {
inputobjects[i].redraw();
}
}

function inputobjectsLoad() {
if ((g_handle.Path != fpath) || (reload)) {
reload = false;
fpath = g_handle.Path;
for (i in inputobjects) {
inputobjects[i].load();
}
}
}

function inputobjectsSave() {
for (i in inputobjects) {
inputobjects[i].save();
}
}

// --- APPLICATION START
var g_handle = fb.GetFocusItem();
window.WatchMetadb(g_handle);
var metadata = g_handle.GetFileInfo();
reload = true;
fpath = "";
edit = false;

function on_mouse_move(x, y) {
hoverbak = cursorhover;
cursorhover = false;
for (i in inputobjects) {
inputobjects[i].onMove(x, y);
};
if (hoverbak != cursorhover) {
if (cursorhover)
window.SetCursor(32649);
else
window.SetCursor(32512);
}
}

function on_mouse_lbtn_down(x, y) {
for (i in inputobjects) {
inputobjects[i].onClick(x, y);
};
inputobjectsRedraw();
}

function on_focus(is_focused) {
if (!is_focused && edit) inputobjectsSave();
}

function on_item_focus_change() {
if (edit) inputobjectsSave();
window.UnWatchMetadb();
g_handle = fb.GetFocusItem();
window.WatchMetadb(g_handle);
metadata = g_handle.GetFileInfo();
reload = true;
inputobjectsRedraw();
}

function on_metadb_changed(g_handle, fromhook) {
metadata = g_handle.GetFileInfo();
reload = true;
inputobjectsRedraw();
}

function on_size() {
for (i in inputobjects) {
inputobjects[i].resize();
}
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, window.Width, window.Height, RGB(0,0,0));
gr.DrawRect(1, 1, window.Width - 3, window.Height - 3, 3, RGB(255, 255, 255));
inputobjectsLoad();
inputobjectsDraw(gr);
}

//Relates to: Inputbox
function on_key_down(vkey) {
key = vkey;
ins = "";
tb = null;
//edit, ctrl, alt?
if (edit && !utils.IsKeyPressed(17) && !utils.IsKeyPressed(18)){
for (i in inputobjects) {
tb = inputobjects[i];
if ((tb.type == "ib") && tb.active) break;
}
if ((tb.type == "ib") && tb.active) {

if (!tb.special) {

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (utils.IsKeyPressed(16))
ins = String.fromCharCode(key);
else
ins = String.fromCharCode(key + 32);
}

//Num
switch (key){
case 96: ins = "0"; break;
case 97: ins = "1"; break;
case 98: ins = "2"; break;
case 99: ins = "3"; break;
case 100: ins = "4"; break;
case 101: ins = "5"; break;
case 102: ins = "6"; break;
case 103: ins = "7"; break;
case 104: ins = "8"; break;
case 105: ins = "9"; break;
case 106: ins = "*"; break;
case 107: ins = "+"; break;
case 109: ins = "-"; break;
case 110: ins = "."; break;
case 111: ins = "/"; break;
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}

//special characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "`"; break;
case 222: tb.special = true; tb.specialchar = "'"; break;
}
}

//special shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 192: tb.special = true; tb.specialchar = "~"; break;
case 54: tb.special = true; tb.specialchar = "^"; break;
case 222: tb.special = true; tb.specialchar = "\""; break;
}
}

//space
if (key == 32){
ins = String.fromCharCode(key);
}

}
else {
ins0 = tb.specialchar;

//special characters
switch (key){
case 65:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ã" : ins = "ã"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "À" : ins = "à"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Â" : ins = "â"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ä" : ins = "ä"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Á" : ins = "á"; key = null; break;
}
break;
case 67:
switch (tb.specialchar){
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ç" : ins = "ç"; key = null; break;
}
break;
case 69:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "È" : ins = "è"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ê" : ins = "ê"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ë" : ins = "ë"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "É" : ins = "é"; key = null; break;
}
break;
case 73:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ì" : ins = "ì"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Î" : ins = "î"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ï" : ins = "ï"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "í" : ins = "í"; key = null; break;
}
break;
case 78:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ñ" : ins = "ñ"; key = null; break;
}
break;
case 79:
switch (tb.specialchar){
case "~": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Õ" : ins = "õ"; key = null; break;
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ò" : ins = "ò"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ô" : ins = "ô"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ö" : ins = "ö"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ó" : ins = "ó"; key = null; break;
}
break;
case 83:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ß"; key = null}; break;
}
break;
case 85:
switch (tb.specialchar){
case "`": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ù" : ins = "ù"; key = null; break;
case "^": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Û" : ins = "û"; key = null; break;
case "\"": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ü" : ins = "ü"; key = null; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ú" : ins = "ú"; key = null; break;
}
break;
case 89:
switch (tb.specialchar){
case "\"": if (!utils.IsKeyPressed(16)) {ins0 = ""; ins = "ÿ"; key = null}; break;
case "'": ins0 = ""; (utils.IsKeyPressed(16)) ? ins = "Ý" : ins = "ý"; key = null; break;
}
break;
}

//0-9
if (47<key && key<58 && !utils.IsKeyPressed(16)) {
ins = String.fromCharCode(key);
}

//A-Z
if (64<key && key<91) {
if (utils.IsKeyPressed(16))
ins = String.fromCharCode(key);
else
ins = String.fromCharCode(key + 32);
}

//Num
switch (key){
case 96: ins = "0"; break;
case 97: ins = "1"; break;
case 98: ins = "2"; break;
case 99: ins = "3"; break;
case 100: ins = "4"; break;
case 101: ins = "5"; break;
case 102: ins = "6"; break;
case 103: ins = "7"; break;
case 104: ins = "8"; break;
case 105: ins = "9"; break;
case 106: ins = "*"; break;
case 107: ins = "+"; break;
case 109: ins = "-"; break;
case 110: ins = "."; break;
case 111: ins = "/"; break;
}

//simple characters
if (!utils.IsKeyPressed(16)) {
switch (key){
case 189: ins = "-"; break;
case 187: ins = "="; break;
case 219: ins = "["; break;
case 221: ins = "]"; break;
case 186: ins = ";"; break;
case 220: ins = "\\"; break;
case 226: ins = "\\"; break;
case 188: ins = ","; break;
case 190: ins = "."; break;
case 191: ins = "/"; break;
}
}

//simple shift characters
if (utils.IsKeyPressed(16)) {
switch (key){
case 49: ins = "!"; break;
case 50: ins = "@"; break;
case 51: ins = "#"; break;
case 52: ins = "$"; break;
case 53: ins = "%"; break;
case 55: ins = "&"; break;
case 56: ins = "*"; break;
case 57: ins = "("; break;
case 48: ins = ")"; break;
case 189: ins = "_"; break;
case 187: ins = "+"; break;
case 219: ins = "{"; break;
case 221: ins = "}"; break;
case 186: ins = ":"; break;
case 220: ins = "|"; break;
case 226: ins = "|"; break;
case 188: ins = "<"; break;
case 190: ins = ">"; break;
case 191: ins = "?"; break;
}
}
tmp = ins
ins = ins0 + tmp;
tb.special = false;
tb.specialchar = "";
}

//left
if (key == 37){
if (tb.cursor != 0) tb.cursor -= 1;
}

//right
if (key == 39){
if (tb.cursor != tb.contentedit.length) tb.cursor += 1;
}

//up
if (key == 38){
tb.up = true;
}

//down
if (key == 40){
tb.down = true;
}

//home
if (key == 36){
tb.cursor = 0;
}

//end
if (key == 35){
tb.cursor = tb.contentedit.length;
}

//backspace
if (key == 8){
if (tb.cursor != 0){
str2 = tb.contentedit.slice(tb.cursor);
tb.cursor -= 1;
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//delete
if (key == 46){
if (tb.cursor != tb.contentedit.length){
str2 = tb.contentedit.slice(tb.cursor + 1);
str1 = tb.contentedit.slice (0, tb.cursor);
tb.contentedit = str1 + str2
}
}

//enter
if (key == 13) {
inputobjectsSave();
}

//esc
if (key == 27) {
tb.escape();
}

str1 = tb.contentedit.slice(0, tb.cursor);
str2 = tb.contentedit.slice(tb.cursor);
tb.contentedit = str1 + ins + str2;
tb.cursor += ins.length;
tb.splitagain = true;
tb.redraw();
}
}
}

inputobjects[0] = new Buttons (15, 10);

inputobjects[1] = new SplitterInputBox("artist", "artist", "separators", 10, 10, 80, "window.Width - 230", 40, 10);

inputobjects[2] = new InputBox("conductor", "conductor", true, "window.Width / 2 + 10", 60, 80, "window.Width / 2 - 100", 30, 10);
inputobjects[3] = new InputBox("composer", "composer", true, 10, 60, 80, "window.Width / 2 - 100", 30, 10);

inputobjects[4] = new InputBox("performer", "performer", true, 10, 100, 80, "window.Width - 100", 30, 10);

inputobjects[5] = new CheckBox("TAC", "tac", "window.Width - 111", 140, 50, 30, 10);
inputobjects[6] = new InputRating("rating", "rating", 5, "window.Width - 400", 140, 70, 30, 10);
inputobjects[7] = new Keywords("country", "country", countrycodes, countrynames, 10, 140, 80, "window.Width - 490", 30, 10);

inputobjects[8] = new InputBox("title", "title", false, 10, 180, 80, "window.Width - 100", 40, 10);

inputobjects[9] = new InputBox("year", "date", false, "window.Width - 160", 230, 60, 90, 30, 10);
inputobjects[10] = new InputBox("disc", "discnumber", false, "window.Width - 280", 230, 50, 70, 30, 10);
inputobjects[11] = new InputBox("track", "tracknumber", false, "window.Width - 410", 230, 50, 70, 30, 10);
inputobjects[12] = new InputBox("-", "album", false, "window.Width / 3 + 10", 230, 20, "2 * window.Width / 3 - 455", 30, 10);
inputobjects[13] = new InputBox("album", "album artist", false, 10, 230, 80, "window.Width / 3 - 95", 30, 10);

inputobjects[14] = new InputBox("year", "original release date", false, "window.Width - 160", 270, 60, 90, 30, 10);
inputobjects[15] = new InputBox("taken from", "original album", false, "window.Width / 3 - 55", 270, 85, "2 * window.Width / 3 - 190", 30, 10);
inputobjects[16] = new InputBox("label", "publisher", true, 10, 270, 80, "window.Width / 3 - 165", 30, 10);

inputobjects[17] = new Keywords("signature", "signature", signatures, signatures, "window.Width - 310", 330, 80, 220, 30, 10);
inputobjects[18] = new Keywords("language", "language", languagecodes, languagenames, "(window.Width - 330) / 2", 330, 80, "(window.Width - 330) / 2 - 70", 30, 10);
inputobjects[19] = new Keywords("vocals", "vocals", vocalsshort, vocalslong, 10, 330, 80, "(window.Width - 330) / 2 - 100", 30, 10);

inputobjects[20] = new RadioBox("category", "category", categories, categories, "window.Width - 686", 370, 80, 0, 30, 10, true);
inputobjects[21] = new Keywords("genre", "genre", genres, genres, 10, 370, 80, "window.Width - 786", 30, 10);

inputobjects[22] = new Keywords("mood", "mood", moods, moods, "window.Width / 2 + 10", 410, 80, "window.Width / 2 - 110", 30, 10);
inputobjects[23] = new Keywords("subgenre", "subgenre", subgenres, subgenres, 10, 410, 80, "window.Width / 2 - 100", 30, 10);

inputobjects[24] = new InputBox("style", "style", false, 10, 450, 80, "window.Width - 100", 30, 10);

inputobjects[25] = new ShowMultiLine("comment", "comment", 10, 510, 80, "window.Width - 110", "Math.floor((window.Height - 520) / 40)", 30, 10);

load = false;
cursorhover = false;

Is this a bug or is there something wrong with my code?

Of course my script would be much better if there was something like an input box interface, so that is a feature I would like to request  Or is there already a way to implement it and am I missing it ?

WSH Panel Mod

Reply #574
maybe the error is on line 159 on one of your imported scripts?