summaryrefslogtreecommitdiff
path: root/plugins/StartPosition/src/options.h
blob: ed3dcfb5f37e3f9201a9bdc8d9fc0264f3fa5e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
Copyright (C) 2012-18 Miranda NG team (https://miranda-ng.org)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "stdafx.h"

enum ClistAlign : BYTE
{
    left,
    right
};

enum ClistState : BYTE
{
    hidden,
    minimized,
    normal
};

struct ClistOptions
{
    CMOption<BYTE> isDocked;
    CMOption<BYTE> state;

    CMOption<DWORD> x;
    CMOption<DWORD> y;
    CMOption<DWORD> width;
    CMOption<DWORD> height;

    ClistOptions() :
        isDocked(CLIST_MODULE_NAME, "Docked", 0),
        state(CLIST_MODULE_NAME, "State", ClistState::normal),
        x(CLIST_MODULE_NAME, "x", 0),
        y(CLIST_MODULE_NAME, "y", 0),
        width(CLIST_MODULE_NAME, "Width", 150),
        height(CLIST_MODULE_NAME, "Height", 350)
    { }
};

struct StartPositionOptions
{
    CMOption<BYTE> setTopPosition;
    CMOption<BYTE> setBottomPosition;
    CMOption<BYTE> setSidePosition;
    CMOption<BYTE> clistAlign;
    CMOption<BYTE> setClistWidth;
    CMOption<BYTE> setClistStartState;
    CMOption<BYTE> clistState;

    CMOption<DWORD> pixelsFromTop;
    CMOption<DWORD> pixelsFromBottom;
    CMOption<DWORD> pixelsFromSide;
    CMOption<DWORD> clistWidth;

    StartPositionOptions();
};

class COptionsDlg : public CPluginDlgBase
{
    CCtrlCheck chkPositionTop, chkPositionBottom, chkPositionSide, chkFromLeft, chkFromRight, chkWidth;
    CCtrlEdit edtPositionTop, edtPositionBottom, edtPositionSide, edtWidth;
    CCtrlCheck chkStartState, chkStartHidden, chkStartNormal;

public:
    COptionsDlg();

    void OnInitDialog() override;
    void OnApply() override;

private:
    void removeOldSettings();

    void onCheck_PositionTop(CCtrlCheck*);
    void onCheck_PositionBottom(CCtrlCheck*);
    void onCheck_PositionSide(CCtrlCheck*);
    void onCheck_Width(CCtrlCheck*);
    void onCheck_StartState(CCtrlCheck*);
};