Added new function LockWindow for flickering problems workaround, fixed crash on NSISdl, fixed focus button redraw
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3115 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a97fc1a9b2
commit
48a62f51e8
11 changed files with 89 additions and 31 deletions
|
@ -42,7 +42,7 @@ HICON g_hIcon;
|
|||
#endif
|
||||
|
||||
int dlg_offset;
|
||||
|
||||
int ui_dlg_visible=0; // At start main window is not visible
|
||||
int g_quit_flag; // set when Quit has been called (meaning bail out ASAP)
|
||||
|
||||
#if NSIS_MAX_INST_TYPES > 32 || NSIS_MAX_INST_TYPES < 1
|
||||
|
@ -354,9 +354,9 @@ static int CALLBACK WINAPI BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lPara
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
BOOL bNextPage=FALSE;
|
||||
if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT)
|
||||
{
|
||||
page *this_page;
|
||||
|
@ -383,9 +383,9 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
SetDlgItemTextFromLang(hwndDlg,IDC_VERSTR,LANG_BRANDING);
|
||||
SetClassLong(hwndDlg,GCL_HICON,(long)g_hIcon);
|
||||
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT)
|
||||
if (!(g_quit_flag = ExecuteCodeSegment(g_header->code_onGUIInit,NULL)))
|
||||
g_quit_flag = ExecuteCodeSegment(g_header->code_onGUIInit,NULL);
|
||||
#endif
|
||||
ShowWindow(hwndDlg,SW_SHOW);
|
||||
//ShowWindow(hwndDlg, SW_SHOW);
|
||||
}
|
||||
|
||||
this_page=g_pages+m_page;
|
||||
|
@ -406,7 +406,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
SendMessage(m_curwnd, WM_NOTIFY_INIGO_MONTOYA, 0, 0);
|
||||
|
||||
nextPage:
|
||||
|
||||
bNextPage=FALSE;
|
||||
m_page+=m_delta;
|
||||
this_page+=m_delta;
|
||||
|
||||
|
@ -452,6 +452,7 @@ nextPage:
|
|||
|
||||
#ifdef NSIS_SUPPORT_CODECALLBACKS
|
||||
if (ExecuteCodeSegment(this_page->prefunc, NULL) || !this_page->dlg_id) {
|
||||
bNextPage=TRUE;
|
||||
goto nextPage;
|
||||
}
|
||||
#endif //NSIS_SUPPORT_CODECALLBACKS
|
||||
|
@ -461,7 +462,7 @@ nextPage:
|
|||
if (g_exec_flags.abort) SetFocus(m_hwndCancel);
|
||||
else if (g_exec_flags.autoclose) goto nextPage;
|
||||
else SetFocus(m_hwndOK); // without focus button, the system Beeps every time user press one key
|
||||
return 0;
|
||||
goto skipPage;
|
||||
}
|
||||
|
||||
// update g_this_page for the dialog proc
|
||||
|
@ -498,6 +499,18 @@ nextPage:
|
|||
//XGE End
|
||||
}
|
||||
}
|
||||
|
||||
skipPage:
|
||||
|
||||
if (!ui_dlg_visible && m_curwnd)
|
||||
{
|
||||
ShowWindow(hwndDlg, SW_SHOW);
|
||||
ui_dlg_visible = TRUE;
|
||||
}
|
||||
|
||||
if (bNextPage)
|
||||
goto nextPage;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -514,6 +527,7 @@ nextPage:
|
|||
if (uMsg == WM_NOTIFY_CUSTOM_READY) {
|
||||
DestroyWindow(m_curwnd);
|
||||
m_curwnd = (HWND)wParam;
|
||||
goto skipPage;
|
||||
}
|
||||
if (uMsg == WM_CLOSE)
|
||||
{
|
||||
|
@ -559,7 +573,7 @@ nextPage:
|
|||
else
|
||||
{
|
||||
// Forward WM_COMMANDs to inner dialogs, can be custom ones
|
||||
SendMessage(m_curwnd, uMsg, wParam, lParam);
|
||||
//SendMessage(m_curwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}
|
||||
return HandleStaticBkColor();
|
||||
|
|
|
@ -221,6 +221,8 @@
|
|||
// __TIMESTAMP__ - date & time according to the current locale
|
||||
#define NSIS_SUPPORT_STANDARD_PREDEFINES
|
||||
|
||||
#define NSIS_LOCKWINDOW_SUPPORT
|
||||
|
||||
// Added by Ximon Eighteen 5th August 2002
|
||||
// If this is uncommented the following changes/new features are
|
||||
// turned on :-
|
||||
|
|
|
@ -1557,6 +1557,15 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
}
|
||||
break;
|
||||
#endif//NSIS_CONFIG_COMPONENTPAGE
|
||||
|
||||
#ifdef NSIS_LOCKWINDOW_SUPPORT
|
||||
case EW_LOCKWINDOW:
|
||||
{
|
||||
SendMessage(g_hwnd, WM_SETREDRAW, parm0 && ui_dlg_visible, 0);
|
||||
if ( parm0 )
|
||||
InvalidateRect(g_hwnd, NULL, FALSE);
|
||||
}
|
||||
#endif //NSIS_LOCKWINDOW_SUPPORT
|
||||
}
|
||||
|
||||
g_exec_flags.exec_error += exec_error;
|
||||
|
|
|
@ -178,6 +178,10 @@ enum
|
|||
// instructions not actually implemented in exehead, but used in compiler.
|
||||
EW_GETLABELADDR, // both of these get converted to EW_ASSIGNVAR
|
||||
EW_GETFUNCTIONADDR,
|
||||
|
||||
#ifdef NSIS_LOCKWINDOW_SUPPORT
|
||||
EW_LOCKWINDOW,
|
||||
#endif
|
||||
};
|
||||
|
||||
#define FH_FLAGS_MASK 15
|
||||
|
|
|
@ -7,6 +7,9 @@ int NSISCALL ui_doinstall(void);
|
|||
void NSISCALL update_status_text(int strtab, const char *text2);
|
||||
extern int ui_st_updateflag;
|
||||
|
||||
extern int ui_dlg_visible;
|
||||
extern HWND m_curwnd;
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
void NSISCALL build_g_logfile(void);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue