FINAL CUT
fcheckbox.h
1 /***********************************************************************
2 * fcheckbox.h - Widget FCheckBox *
3 * *
4 * This file is part of the FINAL CUT widget toolkit *
5 * *
6 * Copyright 2014-2022 Markus Gans *
7 * *
8 * FINAL CUT is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation; either version 3 of *
11 * the License, or (at your option) any later version. *
12 * *
13 * FINAL CUT is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this program. If not, see *
20 * <http://www.gnu.org/licenses/>. *
21 ***********************************************************************/
22 
23 /* Inheritance diagram
24  * ═══════════════════
25  *
26  * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏
27  * ▕ FVTerm ▏ ▕ FObject ▏
28  * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏
29  * ▲ ▲
30  * │ │
31  * └─────┬─────┘
32  * │
33  * ▕▔▔▔▔▔▔▔▔▔▏
34  * ▕ FWidget ▏
35  * ▕▁▁▁▁▁▁▁▁▁▏
36  * ▲
37  * │
38  * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
39  * ▕ FToggleButton ▏
40  * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
41  * ▲
42  * │
43  * ▕▔▔▔▔▔▔▔▔▔▔▔▏
44  * ▕ FCheckBox ▏
45  * ▕▁▁▁▁▁▁▁▁▁▁▁▏
46  */
47 
48 #ifndef FCHECKBOX_H
49 #define FCHECKBOX_H
50 
51 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT)
52  #error "Only <final/final.h> can be included directly."
53 #endif
54 
55 #include "final/widget/ftogglebutton.h"
56 
57 namespace finalcut
58 {
59 
60 //----------------------------------------------------------------------
61 // class FCheckBox
62 //----------------------------------------------------------------------
63 
64 class FCheckBox : public FToggleButton
65 {
66  public:
67  // Constructors
68  explicit FCheckBox (FWidget* = nullptr);
69  explicit FCheckBox (const FString&, FWidget* = nullptr);
70 
71  // Destructor
72  ~FCheckBox() noexcept override;
73 
74  // Accessor
75  auto getClassName() const -> FString override;
76 
77  private:
78  // Methods
79  void init();
80  void draw() override;
81  void drawCheckButton();
82  void drawChecked();
83  void drawUnchecked();
84 };
85 
86 // FCheckBox inline functions
87 //----------------------------------------------------------------------
88 inline auto FCheckBox::getClassName() const -> FString
89 { return "FCheckBox"; }
90 
91 } // namespace finalcut
92 
93 #endif // FCHECKBOX_H
Definition: class_template.cpp:25
Definition: fcheckbox.h:64
Definition: fstring.h:79
Definition: fwidget.h:129
Definition: ftogglebutton.h:62