Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dock tags window somewhere in UI
#1
Would it be possible in a future version to have the option to dock the 'tags' window somewhere?
For example below the items list (bottom left). O
Or at the bottom right, where the output/search pane is? (There is often white space there at the far right, albeit small)

With the tags window I mean the window which is accessible with ALT+F7

Not really important, but may help to use it more.
#2
Function dock_qm_tags_window
Trigger !cv"Tags" "#32770" "" "" "" 0x2 /QM     Help - how to add the trigger to the macro
Code:
Copy      Help
;^<-- Paste this in the Trigger field on the toolbar: !cv"Tags" "#32770" "" "" "" 0x2 /QM
;This function starts when the Tags window opened, and runs until closed.
;Moves the Tags window to the right-bottom of the QM window and keeps it there when you resize etc QM or resize/minimize the docked Tags.
;Tested on Windows 10 and XP.


int wTags=TriggerWindow
if(!wTags) end "To run this, set trigger 'window created & visible' for QM 'Tags' dialog of QM."

int wQM=_hwndqm
int wPane=id(2206 _hwndqm) ;;QM_Scc

SetParent wTags wQM
;SetWinStyle wTags GetWinStyle(wTags)|WS_CHILD&~WS_POPUP ;;removes menu bar

rep
,if IsWindowVisible(wQM) and !IsIconic(wQM)
,,if !IsWindow(wTags) ;;closed
,,,SendMessageW wQM WM_SIZE 0 0 ;;restores control sizes
,,,break
,,sub.MoveSize
,0.5


#sub MoveSize v

RECT rQM rPane rTags
GetClientRect wPane &rPane; MapWindowPoints wPane wQM +&rPane 2
GetWindowRect wTags &rTags; int cxTags=rTags.right-rTags.left
GetClientRect wQM &rQM; int xTags=rQM.right-cxTags

;MoveWindow is slow...
MapWindowPoints 0 wQM +&rTags 2
if(rTags.left=xTags and rTags.top=rPane.top and rTags.bottom=rPane.bottom and rTags.right=rQM.right and rPane.right=xTags) ret

MoveWindow wPane rPane.left rPane.top xTags-rPane.left rPane.bottom-rPane.top 1
MoveWindow wTags xTags rPane.top cxTags rPane.bottom-rPane.top 1

;adjust the Tags child controls too. Remove this code if don't need.
int c1(id(3 wTags)) c2(id(4 wTags))
GetClientRect wTags &rTags
int xSeparator=rTags.right/2
MoveWindow c1 0 0 xSeparator-8 rTags.bottom 1
MoveWindow c2 xSeparator 0 rTags.right-xSeparator rTags.bottom 1
TO_LvAdjustColumnWidth c1 1
TO_LvAdjustColumnWidth c2 1
#3
wow!
THANK YOU!!!
#4
Sorry, small request:
Is it possible for the left pane (contains tags) and right pane (contains QM items) in the Tags window to have their width each to be 50% of the total width. (this means auto adjusting when the user resizes width).
Now the right pane in it's default state is to small width-wise.
#5
Updated.
Dock tags window somewhere in UI
#6
wooow
Thank you!!!!
#7
I want to replace the tags window with another window which is a QM dialog which I created myself.
I modified the code to have it check for the below dialog (Dialog3) and place it at the bottom right corner.
The problem is that that I can not interact with the dialog (can not click upper menubar or buttons).

The dialog (Dialog3, below) is a simple default dialog with a default menubar at the top.
I replaced the trigger with "Dialog3" and made sure the following is present (modifed the inserted code)
Code:
Copy      Help
int wTags=TriggerWindow

Within the "MoveSize" subfunction below, I have disabled the code under the comment
Code:
Copy      Help
adjust the Tags child controls too. Remove this code if don't need.

The below dialog get's placed and moved correctly, but I can not interact with it.

Function Dialog3
Code:
Copy      Help
str md=
;BEGIN MENU
;>&File
;,&Open :501 0x0 0x0 Co
;,&Save :502 0x0 0x0 Cs
;,>Submenu
;,,Item1 :551
;,,Item2 :552
;,,<
;,-
;,E&xit :2
;,<
;>&Edit
;,Cu&t :601
;,&Copy :602
;,&Paste :603
;,<
;>&Help
;,&About :901
;,<
;END MENU

;;menu bar example:
;if(!ShowDialog(dd &sub.DlgProc &controls 0 0 0 0 0 0 0 0 md)) ret
;;popup menu example:
;int i=ShowMenu(md); out i

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x8 0 0 224 136 "Dialog3"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0 0 0 0 0 0 0 0 0 md)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#8
Tested on Windows 10. Menu works. For controls add DT_SetAutoSizeControls.

Function Dialog206
Code:
Copy      Help
str md=
;BEGIN MENU
;>&File
;,&Open :501 0x0 0x0 Co
;,&Save :502 0x0 0x0 Cs
;,>Submenu
;,,Item1 :551
;,,Item2 :552
;,,<
;,-
;,E&xit :2
;,<
;>&Edit
;,Cu&t :601
;,&Copy :602
;,&Paste :603
;,<
;>&Help
;,&About :901
;,<
;END MENU

;;menu bar example:
;if(!ShowDialog(dd &sub.DlgProc &controls 0 0 0 0 0 0 0 0 md)) ret
;;popup menu example:
;int i=ShowMenu(md); out i

str dd=
;BEGIN DIALOG
;0 "" 0x90CC0AC8 0x8 0 0 224 136 "Dialog3"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040400 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0 0 0 0 0 0 0 0 0 md)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetAutoSizeControls hDlg "1m 2m"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 501
,out "Open"
,
,case IDOK
,case IDCANCEL
ret 1
#9
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)