Posts: 41
Threads: 11
Joined: Jul 2012
Greetings , currently i can only view 9 items in my TS menu item list at a time , while i have more items in the list.
I want to at least view 20-30 items and scroll the rest , is this possible ? Thanks in advance.
Example Ts menu
css= :"visibility:hidden;"
css= :"position:fixed;"
css= :"width:500px;"
css= :"height:600px;"
css= :"padding:0px;"
css= :"left:5%;"
css= :"top:20%;"
css= :"overflow:hidden;"
css= :" background-image: url('./imaj/kapat.gif');[] background-repeat: no-repeat;[] background-position: center;[] background-size: 100% 100%;"
css= :"background-color:white;"
css= :"float:left;"
css= :"clear:both;"
css= :"font-family:Arial,sans-serif;"
css= :"text-align:center;"
css= :"vertical-align: middle;"
css= :"font-size:20px;"
css= :"border-style:solid;"
css= :"margin-left:auto;"
css= :"margin-right:auto;"
css= :"width:70%;height:9%;"
css= :"color:black;"
css= :"font-size:small;"
Posts: 12,073
Threads: 140
Joined: Dec 2002
09-10-2012, 01:16 PM
(This post was last modified: 08-13-2022, 10:47 AM by Gintaras.)
Code: https://www.quickmacros.com/forum/showth...9#pid35679
Create function and paste this code.
Set the trigger: paste !v"" "QM_PopupList" /QM in Trigger field on toolbar. It is by the Properties button.
The function runs when a TS menu list appears. If it has scrollbar, resizes to show as many as possible items.
Posts: 41
Threads: 11
Joined: Jul 2012
Thank you Gintaras , it works flawlessly well . I will use this , in addition i would like to be able to set menu heights to a fixed number . Because my ts menus may contain over 150 items in them .
Extra question is , can i have sub menus in my ts menu's ? Thanks .
Posts: 12,073
Threads: 140
Joined: Dec 2002
Updated, now you can set max height.
Cannot have submenus.
Can add mac "menu" items, but will need to click/close the main menu to show the submenu.
css= :mac "Menu38" ;;submenu
Menu Menu38
a :"margin-right:auto;"
b :"width:70%;height:9%;"
c :"color:black;"
d :"font-size:small;"
Posts: 41
Threads: 11
Joined: Jul 2012
Thanks for the reply , submenu works aswell . Im ok with clicking , i can also assign commands to menu clicks aswell , aswesome .Now i can build huge libraries that pop out of simple texts and work on any computer. Mobile library of macros .
Posts: 12,073
Threads: 140
Joined: Dec 2002
This may be better:
TS Menu TS Menu6
Trigger $t
/b/i/c
css= :0;;a - menu 1
css= :0;;b - menu 2
;menu 1
css=a :"visibility:hidden;"
css=a :"position:fixed;"
css=a :"width:500px;"
;menu 2
css=b :"height:600px;"
css=b :"padding:0px;"
css=b :"left:5%;"
;instant items
css= :"top:20%;"
css= :"overflow:hidden;"
On css= it shows menu of available submenus. If then you continue typing "a", it shows menu for css=a, if "b" - for css=b, and so on.
Then you cannot click, but typing "a" is faster anyway.
Posts: 41
Threads: 11
Joined: Jul 2012
Interesting , i havent thought of that . Im going to use those menus to keep my code snippets organized . Like say , jquery snippets , mysql snippets , c# snippets , css snippets all in a main menu. Expanding through selection or typing as you said. There are other softwares capable of doing this. However since my archive is huge together with other much complex tasks , i want to have all those magic in one program , thats why i like QM . Triggers to close those particular annoying popup windows, automatic tasks , complex macros . My keyboard has the power of 3 keyboards atm. Now i just need more
Posts: 12,073
Threads: 140
Joined: Dec 2002
08-25-2015, 05:56 PM
(This post was last modified: 08-13-2022, 10:48 AM by Gintaras.)
Posts: 1,031
Threads: 246
Joined: Jul 2022
08-12-2022, 08:14 PM
(This post was last modified: 08-13-2022, 12:14 PM by Davider.)
@ Gintaras
Function autotext_popup_resize , This function is useful on high resolution screens
In some autotexts have no effect, please see the image demonstration below
"Microsoft YaHei Mono" is a font that comes with the system, Not a third party
The function is not enabled:
Posts: 12,073
Threads: 140
Joined: Dec 2002
08-13-2022, 07:48 AM
(This post was last modified: 08-13-2022, 10:48 AM by Gintaras.)
Posts: 1,031
Threads: 246
Joined: Jul 2022
autotext items are still not displayed
Function autotext_pop_resize
Trigger !v"" "QM_PopupList" /QM
int hwnd=TriggerWindow
int hlv=child("" "SysListView32" hwnd)
if 1 ;;replace 0 with 1 if want to change font
,__Font f.Create("Microsoft YaHei Mono" 12) ;;change this
,SendMessage hlv WM_SETFONT f 1
int widthPercent=150 ;;change this
if(GetWinStyle(hlv)&WS_VSCROLL=0) ret
RECT r.left=LVIR_BOUNDS; SendMessage(hlv LVM_GETITEMRECT 0 &r)
int ni=SendMessage(hlv LVM_GETITEMCOUNT 0 0)
if(ni>50) ni=50 ;;limit height to 50 items. Change the value if want.
r.bottom*ni
int y cx addWidth
RECT rm; MonitorFromIndex hwnd 0 rm
GetWinXY hwnd 0 y cx; y=rm.bottom-(y+r.bottom)-10; if(y<0) r.bottom+y
addWidth=MulDiv(cx widthPercent 100)-cx
cx+addWidth
siz cx r.bottom+4 hwnd
siz cx-4 r.bottom hlv
if addWidth
,SendMessage(hlv LVM_SETCOLUMNWIDTH 0 SendMessage(hlv LVM_GETCOLUMNWIDTH 0 0)+addWidth-(addWidth/10))
,SendMessage(hlv LVM_SETCOLUMNWIDTH 1 SendMessage(hlv LVM_GETCOLUMNWIDTH 1 0)+(addWidth/10))
wait 0 -WC hwnd
Posts: 12,073
Threads: 140
Joined: Dec 2002
Try to remove the GetWinXY line.
Posts: 1,031
Threads: 246
Joined: Jul 2022
Posts: 12,073
Threads: 140
Joined: Dec 2002
Before the first siz line insert
out r.bottom
What it displays in the output?
Posts: 1,031
Threads: 246
Joined: Jul 2022
08-13-2022, 09:17 AM
(This post was last modified: 08-13-2022, 12:13 PM by Davider.)
Before the first siz line insert
out r.bottom
---------------------------------------------------------
type te
Nothing is outputting anything
Autotext autotext8
Trigger $t
/b/i/c/m
te :sub.Sub1 ;;1 hello
ttt :sub.Sub2 ;;1 hello1
ttt :sub.Sub3 ;;2 hello2
#sub Sub1 m
mes "hello"
#sub Sub2 m
mes "hello"
#sub Sub3 m
mes "hello"
Posts: 12,073
Threads: 140
Joined: Dec 2002
Possible reasons:
1. The menu does not have a scrollbar. The function resizes menus that have a scrollbar.
2. The new function does not run, and runs some old version. Delete the old version.
Posts: 1,031
Threads: 246
Joined: Jul 2022
08-13-2022, 09:38 AM
(This post was last modified: 08-13-2022, 10:19 AM by Davider.)
the old version Has been deleted
I deleted the following line and now it seems to have effect
if(GetWinStyle(hlv)&WS_VSCROLL=0) ret
Posts: 12,073
Threads: 140
Joined: Dec 2002
This should work well.
Function autotext_popup_resize
Trigger !v"" "QM_PopupList" /QM
;Resizes QM autotext popup lists. Can change font.
int hwnd=TriggerWindow
int hlv=child("" "SysListView32" hwnd)
if 1 ;;replace 1 with 0 if don't want to change font
,int style=GetWinStyle(hlv)
,__Font f.CreateNew(hlv "Comic Sans MS" 12) ;;change this
,SendMessage hlv WM_SETFONT f 1
,if(style&WS_VSCROLL=0 and style=GetWinStyle(hlv)) ret
else
,if(GetWinStyle(hlv)&WS_VSCROLL=0) ret
int widthPercent=150 ;;change this
RECT r.left=LVIR_BOUNDS; SendMessage(hlv LVM_GETITEMRECT 0 &r)
int ni=SendMessage(hlv LVM_GETITEMCOUNT 0 0)
if(ni>50) ni=50 ;;limit height to 50 items. Change the value if want.
r.bottom*ni
int y cx addWidth
RECT rm; MonitorFromIndex hwnd 0 rm
GetWinXY hwnd 0 y cx; y=rm.bottom-(y+r.bottom)-10; if(y<0) r.bottom+y
addWidth=MulDiv(cx widthPercent 100)-cx
cx+addWidth
siz cx r.bottom+4 hwnd
siz cx-4 r.bottom hlv
if addWidth
,SendMessage(hlv LVM_SETCOLUMNWIDTH 0 SendMessage(hlv LVM_GETCOLUMNWIDTH 0 0)+addWidth-(addWidth/10))
,SendMessage(hlv LVM_SETCOLUMNWIDTH 1 SendMessage(hlv LVM_GETCOLUMNWIDTH 1 0)+(addWidth/10))
wait 0 -WC hwnd
Posts: 1,031
Threads: 246
Joined: Jul 2022
08-13-2022, 11:34 AM
(This post was last modified: 08-13-2022, 12:13 PM by Davider.)
The font settings are not in effect
font size 12 Effective, but 10 has no effect, The previous code can
I want to use font size 10, 12 is too big
Posts: 12,073
Threads: 140
Joined: Dec 2002
Remove this line:
if(style&WS_VSCROLL=0 and style=GetWinStyle(hlv)) ret
Posts: 1,031
Threads: 246
Joined: Jul 2022
@ Gintaras
Thanks for your help!
Works well now
|