mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-26 07:58:52 +01:00
adapt to do queries too
This commit is contained in:
parent
06023b3d03
commit
3b428dee73
1 changed files with 13 additions and 2 deletions
|
@ -41,6 +41,9 @@ stuffTextInField( HWND hDlg, CEAppGlobals* globals, XWStreamCtxt* stream )
|
|||
XP_FREE( globals->mpool, sbuf );
|
||||
|
||||
SetDlgItemText( hDlg, ID_EDITTEXT, wbuf );
|
||||
|
||||
/* This isn't working to stop the highlighting of text */
|
||||
/* SendDlgItemMessage( hDlg, ID_EDITTEXT, EM_SETSEL, 0, 0L ); */
|
||||
} /* stuffTextInField */
|
||||
|
||||
LRESULT CALLBACK
|
||||
|
@ -51,22 +54,29 @@ StrBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
XP_U16 id;
|
||||
|
||||
if ( message == WM_INITDIALOG ) {
|
||||
SetWindowLong( hDlg, GWL_USERDATA, (long)lParam );
|
||||
init = (StrBoxInit*)lParam;
|
||||
|
||||
globals = init->globals;
|
||||
SetWindowLong( hDlg, GWL_USERDATA, (long)globals );
|
||||
|
||||
if ( !!init->title ) {
|
||||
SendMessage( hDlg, WM_SETTEXT, 0, (long)init->title );
|
||||
}
|
||||
|
||||
if ( !init->isQuery ) {
|
||||
ceShowOrHide( hDlg, IDCANCEL, XP_FALSE );
|
||||
/* also want to expand the text box to the bottom */
|
||||
/* ceCenterCtl( hDlg, IDOK ); */
|
||||
}
|
||||
|
||||
positionDlg( hDlg );
|
||||
|
||||
stuffTextInField( hDlg, globals, init->stream );
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
globals = (CEAppGlobals*)GetWindowLong( hDlg, GWL_USERDATA );
|
||||
init = (StrBoxInit*)GetWindowLong( hDlg, GWL_USERDATA );
|
||||
|
||||
switch (message) {
|
||||
|
||||
case WM_COMMAND:
|
||||
|
@ -75,6 +85,7 @@ StrBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
init->result = id;
|
||||
EndDialog(hDlg, id);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue