"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "other-licenses/7zstub/src/Windows/Control/Dialog.h" between
UXP-2019.03.27.tar.gz and UXP-2019.06.08.tar.gz

About: Basilisk is a full-featured, optimized browser derived from the code behind the pre-Servo Firefox browser (29–56 era). UXP = Unified XUL Platform. Source code.

Dialog.h  (UXP-2019.03.27):Dialog.h  (UXP-2019.06.08)
// Windows/Control/Dialog.h // Windows/Control/Dialog.h
#ifndef __WINDOWS_CONTROL_DIALOG_H #ifndef __WINDOWS_CONTROL_DIALOG_H
#define __WINDOWS_CONTROL_DIALOG_H #define __WINDOWS_CONTROL_DIALOG_H
#include "Windows/Window.h" #include "../Window.h"
#include "Windows/Defs.h"
namespace NWindows { namespace NWindows {
namespace NControl { namespace NControl {
class CDialog: public CWindow class CDialog: public CWindow
{ {
public: public:
CDialog(HWND wndow = NULL): CWindow(wndow){}; CDialog(HWND wnd = NULL): CWindow(wnd){};
virtual ~CDialog() {}; virtual ~CDialog() {};
HWND GetItem(int itemID) const HWND GetItem(int itemID) const
{ return GetDlgItem(_window, itemID); } { return GetDlgItem(_window, itemID); }
bool EnableItem(int itemID, bool enable) const bool EnableItem(int itemID, bool enable) const
{ return BOOLToBool(::EnableWindow(GetItem(itemID), BoolToBOOL(enable))); } { return BOOLToBool(::EnableWindow(GetItem(itemID), BoolToBOOL(enable))); }
bool ShowItem(int itemID, int cmdShow) const
{ return BOOLToBool(::ShowWindow(GetItem(itemID), cmdShow)); }
bool ShowItem_Bool(int itemID, bool show) const
{ return ShowItem(itemID, show ? SW_SHOW: SW_HIDE); }
bool HideItem(int itemID) const { return ShowItem(itemID, SW_HIDE); }
bool SetItemText(int itemID, LPCTSTR s) bool SetItemText(int itemID, LPCTSTR s)
{ return BOOLToBool(SetDlgItemText(_window, itemID, s)); } { return BOOLToBool(SetDlgItemText(_window, itemID, s)); }
#ifndef _UNICODE #ifndef _UNICODE
bool SetItemText(int itemID, LPCWSTR s) bool SetItemText(int itemID, LPCWSTR s)
{ {
CWindow window(GetItem(itemID)); CWindow window(GetItem(itemID));
return window.SetText(s); return window.SetText(s);
} }
#endif #endif
skipping to change at line 50 skipping to change at line 57
{ {
CWindow window(GetItem(itemID)); CWindow window(GetItem(itemID));
return window.GetText(string, maxCount); return window.GetText(string, maxCount);
} }
*/ */
#endif #endif
bool SetItemInt(int itemID, UINT value, bool isSigned) bool SetItemInt(int itemID, UINT value, bool isSigned)
{ return BOOLToBool(SetDlgItemInt(_window, itemID, value, BoolToBOOL(isSigne d))); } { return BOOLToBool(SetDlgItemInt(_window, itemID, value, BoolToBOOL(isSigne d))); }
bool GetItemInt(int itemID, bool isSigned, UINT &value) bool GetItemInt(int itemID, bool isSigned, UINT &value)
{ {
BOOL result; BOOL result;
value = GetDlgItemInt(_window, itemID, &result, BoolToBOOL(isSigned)); value = GetDlgItemInt(_window, itemID, &result, BoolToBOOL(isSigned));
return BOOLToBool(result); return BOOLToBool(result);
} }
HWND GetNextGroupItem(HWND control, bool previous) HWND GetNextGroupItem(HWND control, bool previous)
{ return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); } { return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); }
HWND GetNextTabItem(HWND control, bool previous) HWND GetNextTabItem(HWND control, bool previous)
{ return GetNextDlgTabItem(_window, control, BoolToBOOL(previous)); } { return GetNextDlgTabItem(_window, control, BoolToBOOL(previous)); }
bool MapRect(LPRECT rect) bool MapRect(LPRECT rect)
{ return BOOLToBool(MapDialogRect(_window, rect)); } { return BOOLToBool(MapDialogRect(_window, rect)); }
bool IsMessage(LPMSG message) bool IsMessage(LPMSG message)
skipping to change at line 87 skipping to change at line 94
bool IsButtonCheckedBool(int buttonID) const bool IsButtonCheckedBool(int buttonID) const
{ return (IsButtonChecked(buttonID) == BST_CHECKED); } { return (IsButtonChecked(buttonID) == BST_CHECKED); }
bool CheckRadioButton(int firstButtonID, int lastButtonID, int checkButtonID) bool CheckRadioButton(int firstButtonID, int lastButtonID, int checkButtonID)
{ return BOOLToBool(::CheckRadioButton(_window, firstButtonID, lastButtonID, checkButtonID)); } { return BOOLToBool(::CheckRadioButton(_window, firstButtonID, lastButtonID, checkButtonID)); }
virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam); virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
virtual bool OnInit() { return true; } virtual bool OnInit() { return true; }
virtual bool OnCommand(WPARAM wParam, LPARAM lParam); virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
virtual bool OnCommand(int code, int itemID, LPARAM lParam); virtual bool OnCommand(int code, int itemID, LPARAM lParam);
virtual void OnHelp(LPHELPINFO helpInfo) { OnHelp(); }; virtual bool OnSize(WPARAM /* wParam */, int /* xSize */, int /* ySize */) { r
eturn false; }
/*
#ifdef UNDER_CE
virtual void OnHelp(void *) { OnHelp(); }
#else
virtual void OnHelp(LPHELPINFO) { OnHelp(); }
#endif
*/
virtual void OnHelp() {}; virtual void OnHelp() {};
virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
virtual void OnOK() {}; virtual void OnOK() {};
virtual void OnCancel() {}; virtual void OnCancel() {};
virtual bool OnNotify(UINT controlID, LPNMHDR lParam) { return false; } virtual void OnClose() {}
virtual bool OnTimer(WPARAM timerID, LPARAM callback) { return false; } virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */) { return fal
se; }
virtual bool OnTimer(WPARAM /* timerID */, LPARAM /* callback */) { return fal
se; }
LONG_PTR SetMsgResult(LONG_PTR newLongPtr ) LONG_PTR SetMsgResult(LONG_PTR newLongPtr )
{ return SetLongPtr(DWLP_MSGRESULT, newLongPtr); } { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); }
LONG_PTR GetMsgResult() const LONG_PTR GetMsgResult() const
{ return GetLongPtr(DWLP_MSGRESULT); } { return GetLongPtr(DWLP_MSGRESULT); }
bool GetMargins(int margin, int &x, int &y);
int Units_To_Pixels_X(int units);
bool GetItemSizes(int id, int &x, int &y);
void GetClientRectOfItem(int id, RECT &rect);
bool MoveItem(int id, int x, int y, int width, int height, bool repaint = true
);
void NormalizeSize(bool fullNormalize = false);
void NormalizePosition();
}; };
class CModelessDialog: public CDialog class CModelessDialog: public CDialog
{ {
public: public:
bool Create(LPCTSTR templateName, HWND parentWindow); bool Create(LPCTSTR templateName, HWND parentWindow);
bool Create(UINT resID, HWND parentWindow) { return Create(MAKEINTRESOURCEW(re sID), parentWindow); }
#ifndef _UNICODE #ifndef _UNICODE
bool Create(LPCWSTR templateName, HWND parentWindow); bool Create(LPCWSTR templateName, HWND parentWindow);
#endif #endif
virtual void OnOK() { Destroy(); } virtual void OnOK() { Destroy(); }
virtual void OnCancel() { Destroy(); } virtual void OnCancel() { Destroy(); }
virtual void OnClose() { Destroy(); }
}; };
class CModalDialog: public CDialog class CModalDialog: public CDialog
{ {
public: public:
INT_PTR Create(LPCTSTR templateName, HWND parentWindow); INT_PTR Create(LPCTSTR templateName, HWND parentWindow);
INT_PTR Create(UINT resID, HWND parentWindow) INT_PTR Create(UINT resID, HWND parentWindow) { return Create(MAKEINTRESOURCEW
{ return Create(MAKEINTRESOURCEW(resID), parentWindow); } (resID), parentWindow); }
#ifndef _UNICODE #ifndef _UNICODE
INT_PTR Create(LPCWSTR templateName, HWND parentWindow); INT_PTR Create(LPCWSTR templateName, HWND parentWindow);
#endif #endif
bool End(INT_PTR result) bool End(INT_PTR result) { return BOOLToBool(::EndDialog(_window, result)); }
{ return BOOLToBool(::EndDialog(_window, result)); }
virtual void OnOK() { End(IDOK); } virtual void OnOK() { End(IDOK); }
virtual void OnCancel() { End(IDCANCEL); } virtual void OnCancel() { End(IDCANCEL); }
virtual void OnClose() { End(IDCLOSE); }
}; };
class CDialogChildControl: public NWindows::CWindow class CDialogChildControl: public NWindows::CWindow
{ {
public:
int m_ID; int m_ID;
public:
void Init(const NWindows::NControl::CDialog &parentDialog, int id) void Init(const NWindows::NControl::CDialog &parentDialog, int id)
{ {
m_ID = id; m_ID = id;
Attach(parentDialog.GetItem(id)); Attach(parentDialog.GetItem(id));
} }
}; };
bool IsDialogSizeOK(int xSize, int ySize);
}} }}
#endif #endif
 End of changes. 16 change blocks. 
16 lines changed or deleted 50 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)