1 /* 2 Copyright (C) 2013-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: DkClockView.cpt 12 */ 13 14 /** @file DkClockView.h Header file for the DkClockView module. 15 */ 16 17 #ifndef DKCLOCKVIEW_H_INCLUDED 18 /** Avoid multiple inclusions. */ 19 #define DKCLOCKVIEW_H_INCLUDED 1 20 21 22 class DkClockView : public DkWxBufferedControl 23 { 24 private: 25 26 #if wxCHECK_VERSION(3,0,0) 27 wxDECLARE_DYNAMIC_CLASS(DkClockView); 28 #else 29 DECLARE_DYNAMIC_CLASS(DkClockView) 30 #endif 31 32 /** Event table. 33 */ 34 #if wxCHECK_VERSION(3,0,0) 35 wxDECLARE_EVENT_TABLE(); 36 #else 37 DECLARE_EVENT_TABLE() 38 #endif 39 40 protected: 41 42 /** Black colour for normal mode. 43 */ 44 wxColour cBlack; 45 46 /** Red colour for alert mode. 47 */ 48 wxColour cRed; 49 50 /** Clock data to show. 51 */ 52 DkClockData *cld; 53 54 /** Widget type name. 55 */ 56 static wxChar const windowtypename[]; 57 58 /** Flag: Use red colour instead of black. 59 */ 60 bool bUseRed; 61 62 public: 63 64 /** Default constructor. 65 */ 66 DkClockView(); 67 68 /** Constructor. 69 @param wParent Parent window. 70 @param wid Window ID. 71 @param clockData Clock data to show. 72 @param pos Window position. 73 @param size Window size. 74 @param style Window style. 75 */ 76 DkClockView( 77 wxWindow *wParent, 78 wxWindowID wid, 79 DkClockData *clockData, 80 const wxPoint & pos = wxDefaultPosition, 81 const wxSize & size = wxDefaultSize, 82 long style = 0L 83 ); 84 85 /** Create window after using the default constructor. 86 @param wParent Parent window. 87 @param wid Window ID. 88 @param clockData Clock data to show. 89 @param pos Window position. 90 @param size Window size. 91 @param style Window style. 92 @return true on success, false on error. 93 */ 94 bool 95 Create( 96 wxWindow *wParent, 97 wxWindowID wid, 98 DkClockData *clockData, 99 const wxPoint & pos = wxDefaultPosition, 100 const wxSize & size = wxDefaultSize, 101 long style = 0L 102 ); 103 104 /** Draw operation. 105 @param pdc Device context to draw to. 106 @param event Event to process. 107 @param buffered Flag: Drawing into bitmap buffer. 108 @param clWidth Client area width. 109 @param clHeight Client area height. 110 */ 111 void 112 PaintOperation( 113 wxDC & pdc, 114 wxPaintEvent & event, 115 bool buffered, 116 int clWidth, 117 int clHeight 118 ); 119 120 /** Handler for mouse click. 121 @param event Event to process. 122 */ 123 void 124 OnLeftDown(wxMouseEvent & event); 125 126 /** Get red component of normal clock colour. 127 @return Red value. 128 */ 129 int 130 getNormalRed(void) const; 131 132 /** Get green component of normal clock colour. 133 @return Green value. 134 */ 135 int 136 getNormalGreen(void) const; 137 138 /** Get blue component of normal clock colour. 139 @return Blue value. 140 */ 141 int 142 getNormalBlue(void) const; 143 144 /** Get red component of alert clock colour. 145 @return Red value. 146 */ 147 int 148 getAlertRed(void) const; 149 150 /** Get green component of alert clock colour. 151 @return Green value. 152 */ 153 int 154 getAlertGreen(void) const; 155 156 /** Get blue component of alert clock colour. 157 @return Blue value. 158 */ 159 int 160 getAlertBlue(void) const; 161 162 /** Set normal colour. 163 @param r Red value. 164 @param g Green value. 165 @param b Blue value. 166 */ 167 void 168 setNormal(int r, int g, int b); 169 170 /** Set alert colour. 171 @param r Red value. 172 @param g Green value. 173 @param b Blue value. 174 */ 175 void 176 setAlert(int r, int g, int b); 177 }; 178 179 180 #endif 181