Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM_ComboBox EM_SETCUEBANNER
#1
Hi,

How to add EM_SETCUEBANNER to QM_ComboBox control? 
The following code only works for the first QM_ComboBox control

Thanks for any advice and help
david


Macro Macro3
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54030080 0x200 32 8 96 12 ""
;4 QM_ComboBox 0x54030242 0x0 32 32 96 13 ""
;5 QM_ComboBox 0x54030242 0x4 32 56 96 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3 4 5"
str e3 qmcb4 qmcb5

qmcb4=
;
;hello
;world
qmcb5=
;
;hello
;world
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) EM_SETCUEBANNER 1 @"Tip txt1"

,SendMessage id(1001 hDlg) EM_SETCUEBANNER 1 @"Tip txt2"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
for ComboBox controls there is a different message to use.
it is CB_SETCUEBANNER
example
Code:
Copy      Help
,SendMessage id(4 hDlg) CB_SETCUEBANNER 0 @"Tip txt2"
,SendMessage id(5 hDlg) CB_SETCUEBANNER 0 @"Tip txt3"    

QM_ComboBox cuebanner text can be set this way . But it is designed to do this way easier
use a csv string and can assign all kinds of settings
read here for more info
QM_ComboBox control
example
 
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54030080 0x200 32 8 96 12 ""
;4 QM_ComboBox 0x54030242 0x0 32 32 96 13 ""
;5 QM_ComboBox 0x54030242 0x4 32 56 96 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3 4 5"
str e3 qmcb4 qmcb5

qmcb4=
;-1,,,Tip txt2
;hello
;world
qmcb5=
;-1,,,Tip txt3
;hello
;world
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) EM_SETCUEBANNER 1 @"Tip txt1"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
Tip txt disappears when the QM_ComboBox control becomes the focus or when internal text is deleted
How to achieve the effect of the Edit control (display Tip text after deleting text and on focus)?

[Image: 1676676610]
#4
this will do what you want

Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54030080 0x200 32 8 96 12 ""
;4 QM_ComboBox 0x54030242 0x0 32 32 96 13 ""
;5 QM_ComboBox 0x54030242 0x4 32 56 96 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3 4 5"
str e3 qmcb4 qmcb5

qmcb4=
;
;hello
;world
qmcb5=
;
;hello
;world
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) EM_SETCUEBANNER 1 @"Tip txt1"
,SendMessage child("" "Edit" id(4 hDlg)) EM_SETCUEBANNER 1 @"Tip txt2"
,SendMessage child("" "Edit" id(5 hDlg)) EM_SETCUEBANNER 1 @"Tip txt3"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#5
Just what I want Smile
Thank you so much!


Forum Jump:


Users browsing this thread: 1 Guest(s)