Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Explorer-style dialog
#1
Sample dialog with toolbar, tree view, list view and status bar controls, with images.

Feb 15, 2007
Added custom draw.


Attached Files Image(s)
   

.qml   Dialog Explorer.qml (Size: 13.01 KB / Downloads: 1,294)
#2
how to use the SysListView32 column titles for sorting the items ?
(click on column title to toggle ASC/DESC)
pi
#3
SysListView32, SysHeader32 in Dialog

download the second attachment
#4
please give an example for toolbar actions (you left that blank)

Code:
Copy      Help
NMHDR* nh=+lParam
sel nh.idFrom
,case 3 ;;toolbar
,,sel nh.code
,,,case NM_RCLICK
,,,,out "which button clicked me ?"
pi
#5
Code:
Copy      Help
,case 3 ;;toolbar
,sel nh.code
,,case NM_RCLICK
,,NMMOUSE* mo=+nh
,,if(mo.dwItemSpec=-1) ret ;;not on button
,,out "right click on button %i" mo.dwItemSpec

note that different messages use different types, not necessary NMMOUSE. I cannot give all examples. Look in MSDN library.
#6
WM_SETCURSOR's wParam and lParam contain some useful information. See MSDN library.
#7
can you tell how to make it work, so that we have text color
for tb buttons.
or is it the wrong attempt ?

i ask, because my toolbar now has the taskbar background, but the text
labels are black. Confusedhock:

DEX_TBCustomDraw
Code:
Copy      Help
;/DEX_Main
function# NMTBCUSTOMDRAW*cd

sel cd.nmcd.dwDrawStage
,case CDDS_PREPAINT ret CDRF_NOTIFYITEMDRAW ;;yes, notify me to draw items
,case CDDS_ITEMPREPAINT
,,sel cd.nmcd.dwItemSpec
,,,case 1001 cd.clrText=0x222222;out "i am here"
,,,case 1002 cd.clrText=0x222222
,,,case 1003 cd.clrText=0xFF0000
,,,case else ret
pi
#8
You probably know from custom draw documentation that not everything works if XP visual styles are enabled. Either disable visual styles for tb, or draw text yourself, which is quite difficult but possible (qm toolbars do it).

Code:
Copy      Help
,case WM_INITDIALOG
,SetWindowTheme id(3 hDlg) L"" L""
#9
i do not understand.

i still don't know how to set the text color for my tb buttons.
and how to make the active button look like been pushed.
pi
#10
Your DEX_TBCustomDraw is correct. Maybe button ids are different in your app, but it works well if called from DEX_Dialog, when visual styles are disabled (SetWindowTheme called).

Quote:and how to make the active button look like been pushed

Don't know, see toolbar button states in MSDN.


Forum Jump:


Users browsing this thread: 1 Guest(s)