summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/colorchooser.cpp40
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
3 files changed, 23 insertions, 19 deletions
diff --git a/src/mir_app/src/colorchooser.cpp b/src/mir_app/src/colorchooser.cpp
index e437c4a5a2..3d4f2004bc 100644
--- a/src/mir_app/src/colorchooser.cpp
+++ b/src/mir_app/src/colorchooser.cpp
@@ -32,6 +32,15 @@ static COLORREF colorTable[] =
RGB(0,255,0), RGB(255,255,0), RGB(255,0,0), RGB(255,255,255)
};
+MIR_APP_DLL(COLORREF*) Srmm_GetColorTable(int *pSize)
+{
+ if (pSize != nullptr)
+ *pSize = _countof(colorTable);
+ return colorTable;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
class CColorChooserDlg : public CDlgBase
{
CCtrlBase m_text;
@@ -175,31 +184,26 @@ public:
break;
case WM_MOUSEMOVE:
+ if (iCurrentHotTrack == -2)
+ return 0; // prevent focussing when not drawn yet!
{
HDC hdc = GetDC(m_hwnd);
- POINT pt;
- RECT rect;
- int but;
+ // weird stuff
+ POINT pt;
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
-
- if (iCurrentHotTrack == -2)
- return 0; // prevent focussing when not drawn yet!
-
- but = CalculateCoordinatesToButton(pt);
-
- // weird stuff
+ int but = CalculateCoordinatesToButton(pt);
if (but != iCurrentHotTrack) {
if (iCurrentHotTrack >= 0) {
- rect = CalculateButtonToCoordinates(iCurrentHotTrack);
+ RECT rect = CalculateButtonToCoordinates(iCurrentHotTrack);
DrawFocusRect(hdc, &rect);
iCurrentHotTrack = -1;
}
iCurrentHotTrack = but;
if (iCurrentHotTrack >= 0) {
- rect = CalculateButtonToCoordinates(iCurrentHotTrack);
+ RECT rect = CalculateButtonToCoordinates(iCurrentHotTrack);
DrawFocusRect(hdc, &rect);
}
}
@@ -208,20 +212,18 @@ public:
break;
case WM_PAINT:
+ RECT rc;
+ GetClientRect(m_hwnd, &rc);
+ rc.top += 20;
{
PAINTSTRUCT ps;
- int iThisRow = 1;
- int iThisColumn = 0;
-
- RECT rc;
- GetClientRect(m_hwnd, &rc);
- rc.top += 20;
-
HDC hdc = BeginPaint(m_hwnd, &ps);
// fill background
FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
+ int iThisRow = 1;
+ int iThisColumn = 0;
for (int i = 0; i < 16; i++) {
// decide place to draw the color block in the window
iThisColumn++;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 055c4aa466..983061b83d 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -488,3 +488,4 @@ Clist_SetStatusMode @464
?MetaSetDefault@MDatabaseCommon@@UAGHPAUDBCachedContact@@@Z @493 NONAME
?EnumResidentSettings@MDatabaseCommon@@UAGHP6AHPBDPAX@Z1@Z @494 NONAME
KillModuleOptions @495
+Srmm_GetColorTable @496
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index fa96e4fb75..83a06250da 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -488,3 +488,4 @@ Clist_SetStatusMode @464
?MetaSetDefault@MDatabaseCommon@@UEAAHPEAUDBCachedContact@@@Z @493 NONAME
?EnumResidentSettings@MDatabaseCommon@@UEAAHP6AHPEBDPEAX@Z1@Z @494 NONAME
KillModuleOptions @495
+Srmm_GetColorTable @496