25 #ifndef JUCE_COMBOBOX_H_INCLUDED
26 #define JUCE_COMBOBOX_H_INCLUDED
71 void setEditableText (
bool isEditable);
76 bool isTextEditable()
const noexcept;
99 void addItem (
const String& newItemText,
int newItemId);
104 void addItemList (
const StringArray& items,
int firstItemIdOffset);
121 void addSectionHeading (
const String& headingName);
131 void setItemEnabled (
int itemId,
bool shouldBeEnabled);
134 bool isItemEnabled (
int itemId)
const noexcept;
138 void changeItemText (
int itemId,
const String& newText);
159 String getItemText (
int index)
const;
165 int getItemId (
int index)
const noexcept;
170 int indexOfItemId (
int itemId)
const noexcept;
200 void setSelectedId (
int newItemId,
212 int getSelectedItemIndex()
const;
224 void setSelectedItemIndex (
int newItemIndex,
264 virtual void showPopup();
273 virtual void addItemsToMenu (
PopupMenu&)
const;
291 virtual void comboBoxChanged (
ComboBox* comboBoxThatHasChanged) = 0;
295 void addListener (Listener* listener);
298 void removeListener (Listener* listener);
304 void setTextWhenNothingSelected (
const String& newMessage);
309 String getTextWhenNothingSelected()
const;
317 void setTextWhenNoChoicesAvailable (
const String& newMessage);
322 String getTextWhenNoChoicesAvailable()
const;
326 void setTooltip (
const String& newTooltip)
override;
332 void setScrollWheelEnabled (
bool enabled)
noexcept;
347 backgroundColourId = 0x1000b00,
348 textColourId = 0x1000a00,
349 outlineColourId = 0x1000c00,
350 buttonColourId = 0x1000d00,
351 arrowColourId = 0x1000e00,
362 virtual void drawComboBox (
Graphics&,
int width,
int height,
bool isButtonDown,
363 int buttonX,
int buttonY,
int buttonW,
int buttonH,
370 virtual void positionComboBoxText (
ComboBox&,
Label& labelToPosition) = 0;
375 void labelTextChanged (
Label*)
override;
377 void enablementChanged()
override;
379 void colourChanged()
override;
385 void handleAsyncUpdate()
override;
397 void lookAndFeelChanged()
override;
401 void resized()
override;
403 bool keyStateChanged (
bool)
override;
405 bool keyPressed (
const KeyPress&)
override;
407 void valueChanged (
Value&)
override;
409 void parentHierarchyChanged()
override;
421 ItemInfo (
const String&,
int itemId,
bool isEnabled,
bool isHeading);
427 bool isEnabled : 1, isHeading : 1;
433 bool isButtonDown, separatorPending, menuActive, scrollWheelEnabled;
434 float mouseWheelAccumulator;
437 String textWhenNothingSelected, noChoicesMessage;
439 ItemInfo* getItemForId (
int)
const noexcept;
440 ItemInfo* getItemForIndex (
int)
const noexcept;
441 bool selectIfEnabled (
int index);
442 bool nudgeSelectedItem (
int delta);
444 void showPopupIfNotActive();
452 #endif // JUCE_COMBOBOX_H_INCLUDED
Definition: juce_KeyPress.h:37
String getTooltip() override
Definition: juce_ComboBox.h:387
bool isPopupActive() const noexcept
Definition: juce_ComboBox.h:270
static const String empty
Definition: juce_String.h:152
Definition: juce_Font.h:39
void showEditor()
Definition: juce_Label.cpp:210
#define noexcept
Definition: juce_CompilerSupport.h:141
Value & getSelectedIdAsValue()
Definition: juce_ComboBox.h:188
Definition: juce_NotificationType.h:38
Definition: juce_ComboBox.h:358
Definition: juce_Justification.h:38
FocusChangeType
Definition: juce_Component.h:1702
Definition: juce_Value.h:130
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_AsyncUpdater.h:39
virtual ~LookAndFeelMethods()
Definition: juce_ComboBox.h:360
Definition: juce_Label.h:34
NotificationType
Definition: juce_NotificationType.h:33
Justification getJustificationType() const noexcept
Definition: juce_Label.h:120
Definition: juce_ComboBox.h:284
Definition: juce_ListenerList.h:69
String getText(bool returnActiveEditorContents=false) const
Definition: juce_Label.cpp:77
Definition: juce_Component.h:33
Definition: juce_ScopedPointer.h:70
Definition: juce_MouseEvent.h:329
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
ColourIds
Definition: juce_ComboBox.h:345
Definition: juce_StringArray.h:39
void setJustificationType(Justification justification)
Definition: juce_Label.cpp:117
Definition: juce_OwnedArray.h:55
Definition: juce_Value.h:44
Definition: juce_GraphicsContext.h:42
Definition: juce_Label.h:180
void setText(const String &newText, NotificationType notification)
Definition: juce_Label.cpp:56
Definition: juce_ComboBox.h:44
virtual ~Listener()
Definition: juce_ComboBox.h:288
Definition: juce_MouseEvent.h:36