-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathCustomComboBoxes.h
More file actions
32 lines (26 loc) · 962 Bytes
/
CustomComboBoxes.h
File metadata and controls
32 lines (26 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "CustomTextControls.h"
#include "LinkedControl.h"
#include "SharedComboPopup.h"
class AGEComboBox : public wxComboCtrl
{
public:
AGEComboBox(wxWindow *parent, wxArrayString *choices, int width = AGETextCtrl::LARGE, bool pass = true);
inline int GetCount() const { return popup->GetCount(); }
inline int GetSelection() const { return popup->GetSelection(); }
inline void SwapList(wxArrayString *choices) { popup->Imbue(choices); }
void SetSelection(int n);
void Flash();
private:
SharedComboPopup *popup;
};
class LinkedComboBox : public AGEComboBox, public LinkedControl
{
public:
LinkedComboBox(wxWindow *parent, AGETextCtrl *link, wxArrayString *choices,
bool connect = true, int width = AGETextCtrl::LARGE);
inline void OnChoose(wxCommandEvent &event) override;
inline void SetChoice(int value) override;
private:
inline void EnableControl(bool yes) override { Enable(yes); }
};