VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
GenericStringListDataBrowserSource Class Reference

Generic string list data browser source. More...

+ Inheritance diagram for GenericStringListDataBrowserSource:

Public Types

using StringVector = std::vector< UTF8String >
 
- Public Types inherited from IDataBrowserDelegate
enum  Flags { kRowSelected = 1 << 1 }
 

Public Member Functions

 GenericStringListDataBrowserSource (const StringVector *stringList, GenericStringListDataBrowserSourceSelectionChanged *delegate=nullptr)
 
 ~GenericStringListDataBrowserSource () noexcept override
 
void setStringList (const StringVector *stringList)
 
const StringVectorgetStringList () const
 
void setupUI (const CColor &selectionColor, const CColor &fontColor, const CColor &rowlineColor, const CColor &rowBackColor, const CColor &rowAlteranteBackColor, CFontRef font=nullptr, int32_t rowHeight=-1, CCoord textInset=2.)
 
- Public Member Functions inherited from DataBrowserDelegateAdapter
bool dbGetColumnDescription (int32_t index, CCoord &minWidth, CCoord &maxWidth, CDataBrowser *browser) override
 
void dbSetCurrentColumnWidth (int32_t index, const CCoord &width, CDataBrowser *browser) override
 the width of a column has changed More...
 
CCoord dbGetHeaderHeight (CDataBrowser *browser) override
 return height of header More...
 
bool dbGetLineWidthAndColor (CCoord &width, CColor &color, CDataBrowser *browser) override
 return the line width and color More...
 
void dbDrawHeader (CDrawContext *context, const CRect &size, int32_t column, int32_t flags, CDataBrowser *browser) override
 draw the db header More...
 
void dbAttached (CDataBrowser *browser) override
 databrowser view was attached to a parent More...
 
void dbRemoved (CDataBrowser *browser) override
 databrowser view will be removed from its parent More...
 
CMouseEventResult dbOnMouseDown (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse button was pressed on a cell More...
 
CMouseEventResult dbOnMouseMoved (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse was moved over a cell More...
 
CMouseEventResult dbOnMouseUp (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse button was released on a cell More...
 
void dbOnDragEnterBrowser (IDataPackage *drag, CDataBrowser *browser) override
 
void dbOnDragExitBrowser (IDataPackage *drag, CDataBrowser *browser) override
 
DragOperation dbOnDragEnterCell (int32_t row, int32_t column, const CPoint &where, IDataPackage *drag, CDataBrowser *browser) override
 
DragOperation dbOnDragMoveInCell (int32_t row, int32_t column, const CPoint &where, IDataPackage *drag, CDataBrowser *browser) override
 
void dbOnDragExitCell (int32_t row, int32_t column, IDataPackage *drag, CDataBrowser *browser) override
 
bool dbOnDropInCell (int32_t row, int32_t column, const CPoint &where, IDataPackage *drag, CDataBrowser *browser) override
 
void dbSelectionChanged (CDataBrowser *browser) override
 the selection of the db changed More...
 
void dbCellTextChanged (int32_t row, int32_t column, UTF8StringPtr newText, CDataBrowser *browser) override
 the text of the cell changed beginTextEdit was called for More...
 
void dbCellSetupTextEdit (int32_t row, int32_t column, CTextEdit *textEditControl, CDataBrowser *browser) override
 beginTextEdit calls this, so you can setup the textedit control More...
 
int32_t dbOnKeyDown (const VstKeyCode &key, CDataBrowser *browser) override
 
- Public Member Functions inherited from IDataBrowserDelegate
virtual ~IDataBrowserDelegate () noexcept=default
 
- Public Member Functions inherited from CBaseObject
 CBaseObject ()=default
 
 ~CBaseObject () noexcept override=default
 
 CBaseObject (const CBaseObject &o)
 
CBaseObjectoperator= (const CBaseObject &obj)
 
- Public Member Functions inherited from ReferenceCounted< T >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0 More...
 
void remember () override
 increase refcount More...
 
virtual int32_t getNbReference () const
 get refcount More...
 
virtual void beforeDelete ()
 

Protected Member Functions

void drawRowBackground (CDrawContext *context, const CRect &size, int32_t row, int32_t flags, CDataBrowser *browser) const
 
void drawRowString (CDrawContext *context, const CRect &size, int32_t row, int32_t flags, CDataBrowser *browser) const
 
int32_t dbGetNumRows (CDataBrowser *browser) override
 return number of rows for CDataBrowser browser More...
 
int32_t dbGetNumColumns (CDataBrowser *browser) override
 return number of columns for CDataBrowser browser More...
 
bool dbGetColumnDescription (int32_t index, CCoord &minWidth, CCoord &maxWidth, CDataBrowser *browser) override
 
CCoord dbGetCurrentColumnWidth (int32_t index, CDataBrowser *browser) override
 return current width of index column More...
 
void dbSetCurrentColumnWidth (int32_t index, const CCoord &width, CDataBrowser *browser) override
 the width of a column has changed More...
 
CCoord dbGetRowHeight (CDataBrowser *browser) override
 return height of one row More...
 
bool dbGetLineWidthAndColor (CCoord &width, CColor &color, CDataBrowser *browser) override
 return the line width and color More...
 
void dbDrawHeader (CDrawContext *context, const CRect &size, int32_t column, int32_t flags, CDataBrowser *browser) override
 draw the db header More...
 
void dbDrawCell (CDrawContext *context, const CRect &size, int32_t row, int32_t column, int32_t flags, CDataBrowser *browser) override
 draw a db cell More...
 
CMouseEventResult dbOnMouseDown (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse button was pressed on a cell More...
 
CMouseEventResult dbOnMouseMoved (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse was moved over a cell More...
 
CMouseEventResult dbOnMouseUp (const CPoint &where, const CButtonState &buttons, int32_t row, int32_t column, CDataBrowser *browser) override
 mouse button was released on a cell More...
 
void dbSelectionChanged (CDataBrowser *browser) override
 the selection of the db changed More...
 
void dbCellTextChanged (int32_t row, int32_t column, UTF8StringPtr newText, CDataBrowser *browser) override
 the text of the cell changed beginTextEdit was called for More...
 
void dbCellSetupTextEdit (int32_t row, int32_t column, CTextEdit *textEditControl, CDataBrowser *browser) override
 beginTextEdit calls this, so you can setup the textedit control More...
 
int32_t dbOnKeyDown (const VstKeyCode &key, CDataBrowser *browser) override
 
void dbAttached (CDataBrowser *browser) override
 databrowser view was attached to a parent More...
 
void dbRemoved (CDataBrowser *browser) override
 databrowser view will be removed from its parent More...
 
CMessageResult notify (CBaseObject *sender, IdStringPtr message) override
 

Protected Attributes

const StringVectorstringList
 
int32_t rowHeight
 
CColor fontColor
 
CColor selectionColor
 
CColor rowlineColor
 
CColor rowBackColor
 
CColor rowAlternateBackColor
 
CPoint textInset
 
CHoriTxtAlign textAlignment
 
SharedPointer< CFontDescdrawFont
 
CDataBrowserdataBrowser
 
GenericStringListDataBrowserSourceSelectionChangeddelegate
 
SharedPointer< CVSTGUITimertimer
 
std::string keyDownFindString
 

Detailed Description

Generic string list data browser source.

Member Typedef Documentation

◆ StringVector

using StringVector = std::vector<UTF8String>

Constructor & Destructor Documentation

◆ GenericStringListDataBrowserSource()

◆ ~GenericStringListDataBrowserSource()

~GenericStringListDataBrowserSource ( )
overridedefaultnoexcept

Member Function Documentation

◆ dbAttached()

void dbAttached ( CDataBrowser browser)
overrideprotectedvirtual

databrowser view was attached to a parent

Implements IDataBrowserDelegate.

◆ dbCellSetupTextEdit()

void dbCellSetupTextEdit ( int32_t  row,
int32_t  column,
CTextEdit textEditControl,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

beginTextEdit calls this, so you can setup the textedit control

Implements IDataBrowserDelegate.

◆ dbCellTextChanged()

void dbCellTextChanged ( int32_t  row,
int32_t  column,
UTF8StringPtr  newText,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

the text of the cell changed beginTextEdit was called for

Implements IDataBrowserDelegate.

◆ dbDrawCell()

void dbDrawCell ( CDrawContext context,
const CRect size,
int32_t  row,
int32_t  column,
int32_t  flags,
CDataBrowser browser 
)
overrideprotectedvirtual

draw a db cell

Implements DataBrowserDelegateAdapter.

◆ dbDrawHeader()

void dbDrawHeader ( CDrawContext context,
const CRect size,
int32_t  column,
int32_t  flags,
CDataBrowser browser 
)
overrideprotectedvirtual

draw the db header

Implements IDataBrowserDelegate.

◆ dbGetColumnDescription()

bool dbGetColumnDescription ( int32_t  index,
CCoord minWidth,
CCoord maxWidth,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

Implements IDataBrowserDelegate.

◆ dbGetCurrentColumnWidth()

CCoord dbGetCurrentColumnWidth ( int32_t  index,
CDataBrowser browser 
)
overrideprotectedvirtual

return current width of index column

Implements DataBrowserDelegateAdapter.

◆ dbGetLineWidthAndColor()

bool dbGetLineWidthAndColor ( CCoord width,
CColor color,
CDataBrowser browser 
)
overrideprotectedvirtual

return the line width and color

Implements IDataBrowserDelegate.

◆ dbGetNumColumns()

int32_t dbGetNumColumns ( CDataBrowser browser)
inlineoverrideprotectedvirtual

return number of columns for CDataBrowser browser

Implements DataBrowserDelegateAdapter.

◆ dbGetNumRows()

int32_t dbGetNumRows ( CDataBrowser browser)
overrideprotectedvirtual

return number of rows for CDataBrowser browser

Implements DataBrowserDelegateAdapter.

◆ dbGetRowHeight()

CCoord dbGetRowHeight ( CDataBrowser browser)
overrideprotectedvirtual

return height of one row

Implements DataBrowserDelegateAdapter.

◆ dbOnKeyDown()

int32_t dbOnKeyDown ( const VstKeyCode key,
CDataBrowser browser 
)
overrideprotectedvirtual

Implements IDataBrowserDelegate.

◆ dbOnMouseDown()

CMouseEventResult dbOnMouseDown ( const CPoint where,
const CButtonState buttons,
int32_t  row,
int32_t  column,
CDataBrowser browser 
)
overrideprotectedvirtual

mouse button was pressed on a cell

Implements IDataBrowserDelegate.

◆ dbOnMouseMoved()

CMouseEventResult dbOnMouseMoved ( const CPoint where,
const CButtonState buttons,
int32_t  row,
int32_t  column,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

mouse was moved over a cell

Implements IDataBrowserDelegate.

◆ dbOnMouseUp()

CMouseEventResult dbOnMouseUp ( const CPoint where,
const CButtonState buttons,
int32_t  row,
int32_t  column,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

mouse button was released on a cell

Implements IDataBrowserDelegate.

◆ dbRemoved()

void dbRemoved ( CDataBrowser browser)
overrideprotectedvirtual

databrowser view will be removed from its parent

Implements IDataBrowserDelegate.

◆ dbSelectionChanged()

void dbSelectionChanged ( CDataBrowser browser)
overrideprotectedvirtual

the selection of the db changed

Implements IDataBrowserDelegate.

◆ dbSetCurrentColumnWidth()

void dbSetCurrentColumnWidth ( int32_t  index,
const CCoord width,
CDataBrowser browser 
)
inlineoverrideprotectedvirtual

the width of a column has changed

Implements IDataBrowserDelegate.

◆ drawRowBackground()

void drawRowBackground ( CDrawContext context,
const CRect size,
int32_t  row,
int32_t  flags,
CDataBrowser browser 
) const
protected

◆ drawRowString()

void drawRowString ( CDrawContext context,
const CRect size,
int32_t  row,
int32_t  flags,
CDataBrowser browser 
) const
protected

◆ getStringList()

const StringVector* getStringList ( ) const
inline

◆ notify()

CMessageResult notify ( CBaseObject sender,
IdStringPtr  message 
)
overrideprotectedvirtual

Reimplemented from CBaseObject.

◆ setStringList()

void setStringList ( const StringVector stringList)

◆ setupUI()

void setupUI ( const CColor selectionColor,
const CColor fontColor,
const CColor rowlineColor,
const CColor rowBackColor,
const CColor rowAlteranteBackColor,
CFontRef  font = nullptr,
int32_t  rowHeight = -1,
CCoord  textInset = 2. 
)

Member Data Documentation

◆ dataBrowser

CDataBrowser* dataBrowser
protected

◆ delegate

◆ drawFont

SharedPointer<CFontDesc> drawFont
protected

◆ fontColor

CColor fontColor
protected

◆ keyDownFindString

std::string keyDownFindString
protected

◆ rowAlternateBackColor

CColor rowAlternateBackColor
protected

◆ rowBackColor

CColor rowBackColor
protected

◆ rowHeight

int32_t rowHeight
protected

◆ rowlineColor

CColor rowlineColor
protected

◆ selectionColor

CColor selectionColor
protected

◆ stringList

const StringVector* stringList
protected

◆ textAlignment

CHoriTxtAlign textAlignment
protected

◆ textInset

CPoint textInset
protected

◆ timer

SharedPointer<CVSTGUITimer> timer
protected

The documentation for this class was generated from the following files: