1 // XABPriorityCtrl.h - XABPriorityCtrl widget header
3 // (c) 2017 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __WIDGETS_XABPRIORITYCTRL_H__
20 #define __WIDGETS_XABPRIORITYCTRL_H__
24 class XABPriorityCtrl : public wxPanel
27 wxWindow *parentControl = nullptr;
29 wxFlexGridSizer *mainSizer = nullptr;
30 wxFlexGridSizer *sliderSizer = nullptr;
31 wxBoxSizer *sliderLabelSizer = nullptr;
32 wxCheckBox *chkPriority = nullptr;
33 wxTextCtrl *txtPriority = nullptr;
34 wxSlider *sliPriority = nullptr;
35 wxStaticText *lowLabel = nullptr;
36 wxStaticText *highLabel = nullptr;
38 void UpdateTextValue();
39 void UpdateSlider(int value);
40 void SliderEvent(wxCommandEvent &event);
41 void TextEvent(wxCommandEvent &event);
42 void EnableControls(wxCommandEvent &event);
44 XABPriorityCtrl(wxWindow *parent);
46 void EnablePriority(bool enable);
47 bool IsPriorityChecked();
49 void SetValue(int value);