You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Yes it is, but maybe someone new here hasn't seen this posted and wants to know too
I know the answer is right in front of my face, I've already encountered this but it's been so long.
hDlg calls this function, when the dialog box pops up you can hit ESCAPE and it goes away.
I don't want that.
By removing %IDCANCEL the problem goes away but I want a cancel button, I just want hte user to have to CLICK it.
Code:
'-----------------------------------------------------------------------------------------
Function CreateLicenseFile(hWnd As Long) As Long
Local lResult As Long
Local lDlg As Long
'dialog new etc
Dialog New hWnd,"Create a License agreement or note to user",,, 375,250,%WS_CAPTION Or %WS_SYSMENU Or %WS_THICKFRAME To lDlg
Control Add TextBox, lDlg, %IDLIC_TEXT1 ,"",5,30,365,190,%WS_TABSTOP Or %ES_WANTRETURN Or %ES_MULTILINE Or %WS_VSCROLL,%WS_EX_CLIENTEDGE
Control Add Label, lDlg, %IDLICLABEL1, "Enter license agreement text or a note to user then click Save" ,5,10, 250,20
Control Add Button, lDlg, %IDLIC_SAVE, "&Apply",250,230,45,14,%BS_DEFAULT
Control Add Button, lDlg, %IDCANCEL, "&Cancel",300,230,60,14
Dialog Send lDlg, %WM_SETICON, %ICON_BIG, hIcon
Dialog Show Modal lDlg Call LicenseCreatorProc To lResult
Function = lResult
End Function
'-----------------------------------------------------------------------------------------
CallBack Function LicenseCreatorProc() As Long
Local lResult As Long
Select Case CbMsg
Case %WM_INITDIALOG
Case %WM_COMMAND
Select Case LoWrd(CbWparam)
Case %IDLIC_SAVE
Control Get Text CbHndl,%IDLIC_TEXT1 To g_LicenseText
Dialog End CbHndl,%TRUE
Case %IDCANCEL
If CbCtlMsg = %BN_CLICKED Then Dialog End CbHndl,%FALSE
End Select
End Select
End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: