Clapkit
Loading...
Searching...
No Matches
ckDropdown.h
Go to the documentation of this file.
1/*
2 *
3 * Clapkit
4 * ----------------------------------------------------------------------
5 * A wrapper for creating a 'generalized' app for Classic MacOS
6 * that (hopefully) can be ported easily to other platforms.
7 *
8 * CKDropdown
9 * ----------------------------------------------------------------------
10 * Defines a dropdown list control.
11 *
12 */
13
14#pragma once
15
16#include "ckApp.h"
17#include "ckControlToolbox.h"
19
25
26 public:
27 CKDropdown(const CKControlInitParams& params);
28 virtual ~CKDropdown();
29 virtual void AddedToWindow(CKWindow* window);
30 virtual bool HandleEvent(const CKEvent& evt);
31 virtual void RaisePropertyChange(const char* propertyName);
32
33 protected:
34 CKDropdown(const CKControlInitParams& params, CKControlType forcedType);
35
36 private:
37 virtual void __ReflectToOS();
38
39 public:
43
44 protected:
45 MenuID __menuId;
46 MenuHandle __menu = nullptr;
47 bool __rebuildMenu = false;
49};
Defines the base of all UIControls that are managed by Macintosh Toolbox.
Definition ckControlToolbox.h:27
Defines a dropdown control.
Definition ckDropdown.h:24
CKProperty< std::vector< const char * > > items
Definition ckDropdown.h:41
CKProperty< int > selectedIndex
Definition ckDropdown.h:42
MenuHandle __menu
Definition ckDropdown.h:46
CKProperty< int > labelWidth
Definition ckDropdown.h:40
virtual bool HandleEvent(const CKEvent &evt)
Definition ckDropdown.cpp:102
MenuID __menuId
Definition ckDropdown.h:45
virtual ~CKDropdown()
Definition ckDropdown.cpp:28
virtual void AddedToWindow(CKWindow *window)
Definition ckDropdown.cpp:35
virtual void RaisePropertyChange(const char *propertyName)
Definition ckDropdown.cpp:117
bool __rebuildMenu
Definition ckDropdown.h:47
int __lastRaisedSelectedIndex
Definition ckDropdown.h:48
Defines an observable value.
Definition ckProperty.h:60
A base for controls that have a 'main' boolean or custom property.
Definition ck_pValueContainingControl.h:28
Defines a window. Window type (modal, document) is determined by CKWindowInitParams and CKWindowType.
Definition ckWindow.h:89
CKControlType
Defines a control type (i.e. PushButton, Checkbox, etc.)
Definition ckTypes.h:51
Initialization parameters for a CKControl.
Definition ckControl.h:27
Defines an event raised by the framework, mostly for user actions.
Definition ckTypes.h:490