From 957da0541115fb11626cdff5e5f95ac2daf5b100 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Sun, 22 Oct 2017 18:19:50 +0200 Subject: StartPosition: move options to UI classes (#1007) * StartPosition: move options to UI classes * StartPosition: rearrange controls to correct TABSTOP path * StartPosition: futher switch to UI classes --- plugins/StartPosition/src/options.h | 93 +++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 plugins/StartPosition/src/options.h (limited to 'plugins/StartPosition/src/options.h') diff --git a/plugins/StartPosition/src/options.h b/plugins/StartPosition/src/options.h new file mode 100644 index 0000000000..8066cddbf7 --- /dev/null +++ b/plugins/StartPosition/src/options.h @@ -0,0 +1,93 @@ +/* +Copyright (C) 2012-17 Miranda NG project (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 . +*/ + +#pragma once + +#include "stdafx.h" + +enum ClistAlign : BYTE +{ + left, + right +}; + +enum ClistState : BYTE +{ + hidden, + minimized, + normal +}; + +struct ClistOptions +{ + CMOption isDocked; + CMOption state; + + CMOption x; + CMOption y; + CMOption width; + CMOption 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 setTopPosition; + CMOption setBottomPosition; + CMOption setSidePosition; + CMOption clistAlign; + CMOption setClistWidth; + CMOption setClistStartState; + CMOption clistState; + + CMOption pixelsFromTop; + CMOption pixelsFromBottom; + CMOption pixelsFromSide; + CMOption clistWidth; + + StartPositionOptions(); +}; + +class COptionsDlg : public CPluginDlgBase +{ + CCtrlCheck chkPositionTop, chkPositionBottom, chkPositionSide, chkFromLeft, chkFromRight, chkWidth; + CCtrlEdit edtPositionTop, edtPositionBottom, edtPositionSide, edtWidth; + CCtrlCheck chkStartState, chkStartHidden, chkStartNormal; + +public: + COptionsDlg(); + + virtual void OnInitDialog() override; + virtual 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*); +}; -- cgit v1.2.3