Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto Text - TS Menus Menu Listitem Limit
#1
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
Code:
Copy      Help
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;"
#2
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.
#3
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 .
#4
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.

Code:
Copy      Help
css= :mac "Menu38" ;;submenu

Menu Menu38
Code:
Copy      Help
a :"margin-right:auto;"
b :"width:70%;height:9%;"
c :"color:black;"
d :"font-size:small;"
#5
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 Smile .
#6
This may be better:

TS Menu TS Menu6
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/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.
#7
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 Smile
#8
Code: https://www.quickmacros.com/forum/showth...9#pid35679
#9
@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:
#10
Code: https://www.quickmacros.com/forum/showth...9#pid35679
#11
autotext items are still not displayed

Function autotext_pop_resize
Trigger !v"" "QM_PopupList" /QM     Help - how to add the trigger to the macro
Code:
Copy      Help
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
#12
Try to remove the GetWinXY line.
#13
Still doesn't work
#14
Before the first siz line insert
out r.bottom
What it displays in the output?
#15
Before the first siz line insert
out r.bottom
---------------------------------------------------------
type te 
Nothing is outputting anything

Autotext autotext8
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/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"
 

#16
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.
#17
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
#18
This should work well.

Function autotext_popup_resize
Trigger !v"" "QM_PopupList" /QM     Help - how to add the trigger to the macro
Code:
Copy      Help
;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
#19
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
#20
Remove this line:
if(style&WS_VSCROLL=0 and style=GetWinStyle(hlv)) ret
#21
@Gintaras
Thanks for your help!
Works well now


Forum Jump:


Users browsing this thread: 1 Guest(s)