diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-26 17:41:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-26 17:41:34 +0300 |
commit | 45373ed8b8906f1a7e715b8c830f91fc1b46649a (patch) | |
tree | a7ea46c2cafe4c3b1c372263a40cfd50b81d5ef5 /src | |
parent | 4ac8a5589cd54abe47f1c80c67b2a8265764528a (diff) |
standard color table exported from core
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/colorchooser.cpp | 40 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 |
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
|