24 #ifndef FXSCROLLAREA_H 25 #include "FXScrollArea.h" 33 ICONLIST_EXTENDEDSELECT = 0,
34 ICONLIST_SINGLESELECT = 0x00100000,
35 ICONLIST_BROWSESELECT = 0x00200000,
36 ICONLIST_MULTIPLESELECT = 0x00300000,
37 ICONLIST_AUTOSIZE = 0x00400000,
38 ICONLIST_DETAILED = 0,
39 ICONLIST_MINI_ICONS = 0x00800000,
40 ICONLIST_BIG_ICONS = 0x01000000,
42 ICONLIST_COLUMNS = 0x02000000,
43 ICONLIST_NORMAL = ICONLIST_EXTENDEDSELECT
69 FXIconItem():bigIcon(
nullptr),miniIcon(
nullptr),data(
nullptr),state(0){}
70 virtual void draw(
const FXIconList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
71 virtual FXint hitItem(
const FXIconList* list,FXint rx,FXint ry,FXint rw=1,FXint rh=1)
const;
73 virtual void drawBigIcon(
const FXIconList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
74 virtual void drawMiniIcon(
const FXIconList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
75 virtual void drawDetails(
const FXIconList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
91 virtual void setText(
const FXString& txt);
97 virtual void setBigIcon(
FXIcon* icn,FXbool owned=
false);
103 virtual void setMiniIcon(
FXIcon* icn,FXbool owned=
false);
115 virtual void setFocus(FXbool focus);
118 FXbool
hasFocus()
const {
return (state&FOCUS)!=0; }
121 virtual void setSelected(FXbool selected);
127 virtual void setEnabled(FXbool enabled);
130 FXbool
isEnabled()
const {
return (state&DISABLED)==0; }
133 virtual void setDraggable(FXbool draggable);
139 virtual FXString getTipText()
const;
142 virtual FXint getWidth(
const FXIconList* list)
const;
145 virtual FXint getHeight(
const FXIconList* list)
const;
148 virtual void create();
151 virtual void detach();
154 virtual void destroy();
157 virtual void save(
FXStream& store)
const;
168 typedef FXint (*FXIconListSortFunc)(
const FXIconItem*,
const FXIconItem*);
172 typedef FXObjectListOf<FXIconItem> FXIconItemList;
212 FXIconListSortFunc sortfunc;
214 FXColor selbackColor;
215 FXColor seltextColor;
231 void startLasso(FXint ax,FXint ay);
232 void updateLasso(FXint cx,FXint cy);
234 void getrowscols(FXint& nr,FXint& nc,FXint w,FXint h)
const;
235 void lassoChanged(FXint ox,FXint oy,FXint ow,FXint oh,FXint nx,FXint ny,FXint nw,FXint nh,FXbool notify);
236 virtual void moveContents(FXint x,FXint y);
238 static FXint compareSection(
const FXchar *p,
const FXchar* q,FXint s);
239 static FXint compareSectionCase(
const FXchar *p,
const FXchar* q,FXint s);
244 long onPaint(
FXObject*,FXSelector,
void*);
245 long onEnter(
FXObject*,FXSelector,
void*);
246 long onLeave(
FXObject*,FXSelector,
void*);
247 long onUngrabbed(
FXObject*,FXSelector,
void*);
248 long onKeyPress(
FXObject*,FXSelector,
void*);
249 long onKeyRelease(
FXObject*,FXSelector,
void*);
250 long onLeftBtnPress(
FXObject*,FXSelector,
void*);
251 long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
252 long onRightBtnPress(
FXObject*,FXSelector,
void*);
253 long onRightBtnRelease(
FXObject*,FXSelector,
void*);
254 long onMouseWheel(
FXObject*,FXSelector,
void*);
255 long onMotion(
FXObject*,FXSelector,
void*);
256 long onQueryTip(
FXObject*,FXSelector,
void*);
257 long onQueryHelp(
FXObject*,FXSelector,
void*);
258 long onTipTimer(
FXObject*,FXSelector,
void*);
259 long onCmdSelectAll(
FXObject*,FXSelector,
void*);
260 long onCmdDeselectAll(
FXObject*,FXSelector,
void*);
261 long onCmdSelectInverse(
FXObject*,FXSelector,
void*);
262 long onCmdArrangeByRows(
FXObject*,FXSelector,
void*);
263 long onUpdArrangeByRows(
FXObject*,FXSelector,
void*);
264 long onCmdArrangeByColumns(
FXObject*,FXSelector,
void*);
265 long onUpdArrangeByColumns(
FXObject*,FXSelector,
void*);
266 long onCmdShowDetails(
FXObject*,FXSelector,
void*);
267 long onUpdShowDetails(
FXObject*,FXSelector,
void*);
268 long onCmdShowBigIcons(
FXObject*,FXSelector,
void*);
269 long onUpdShowBigIcons(
FXObject*,FXSelector,
void*);
270 long onCmdShowMiniIcons(
FXObject*,FXSelector,
void*);
271 long onUpdShowMiniIcons(
FXObject*,FXSelector,
void*);
272 long onChgHeader(
FXObject*,FXSelector,
void*);
273 long onClkHeader(
FXObject*,FXSelector,
void*);
274 long onFocusIn(
FXObject*,FXSelector,
void*);
275 long onFocusOut(
FXObject*,FXSelector,
void*);
276 long onClicked(
FXObject*,FXSelector,
void*);
277 long onDoubleClicked(
FXObject*,FXSelector,
void*);
278 long onTripleClicked(
FXObject*,FXSelector,
void*);
279 long onCommand(
FXObject*,FXSelector,
void*);
280 long onAutoScroll(
FXObject*,FXSelector,
void*);
281 long onLookupTimer(
FXObject*,FXSelector,
void*);
282 long onCmdSetValue(
FXObject*,FXSelector,
void*);
283 long onCmdGetIntValue(
FXObject*,FXSelector,
void*);
284 long onCmdSetIntValue(
FXObject*,FXSelector,
void*);
292 ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
298 ID_ARRANGE_BY_COLUMNS,
310 virtual void create();
313 virtual void detach();
316 virtual void recalc();
319 virtual void layout();
322 virtual FXint getContentWidth();
325 virtual FXint getContentHeight();
328 virtual FXint getVisibleY()
const;
331 virtual FXint getVisibleHeight()
const;
334 virtual FXbool canFocus()
const;
337 virtual void setFocus();
340 virtual void killFocus();
343 virtual void resize(FXint w,FXint h);
346 virtual void position(FXint x,FXint y,FXint w,FXint h);
361 void setHeaders(
const FXchar** strings,FXint size=1);
364 void setHeaders(
const FXString& strings,FXint size=1);
367 void appendHeader(
const FXString& text,
FXIcon *icon=
nullptr,FXint size=1);
370 void removeHeader(FXint index);
373 void setHeaderText(FXint index,
const FXString& text);
376 FXString getHeaderText(FXint index)
const;
379 void setHeaderIcon(FXint index,
FXIcon *icon);
382 FXIcon* getHeaderIcon(FXint index)
const;
385 void setHeaderSize(FXint index,FXint size);
388 FXint getHeaderSize(FXint index)
const;
391 FXint getNumHeaders()
const;
397 FXint setItem(FXint index,
FXIconItem* item,FXbool notify=
false);
400 FXint setItem(FXint index,
const FXString& text,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
403 FXint fillItems(
const FXchar** strings,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
406 FXint fillItems(
const FXString* strings,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
409 FXint fillItems(
const FXString& strings,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
412 FXint insertItem(FXint index,
FXIconItem* item,FXbool notify=
false);
415 FXint insertItem(FXint index,
const FXString& text,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
418 FXint appendItem(
FXIconItem* item,FXbool notify=
false);
421 FXint appendItem(
const FXString& text,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
424 FXint prependItem(
FXIconItem* item,FXbool notify=
false);
427 FXint prependItem(
const FXString& text,
FXIcon *big=
nullptr,
FXIcon* mini=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
430 FXint moveItem(FXint newindex,FXint oldindex,FXbool notify=
false);
433 FXIconItem* extractItem(FXint index,FXbool notify=
false);
436 void removeItem(FXint index,FXbool notify=
false);
439 void clearItems(FXbool notify=
false);
448 virtual FXint getItemAt(FXint x,FXint y)
const;
460 FXint findItem(
const FXString&
string,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP)
const;
469 FXint findItemByData(FXptr ptr,FXint start=-1,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP)
const;
472 virtual void makeItemVisible(FXint index);
475 void setItemText(FXint index,
const FXString& text);
478 FXString getItemText(FXint index)
const;
481 void setItemBigIcon(FXint index,
FXIcon* icon,FXbool owned=
false);
484 FXIcon* getItemBigIcon(FXint index)
const;
487 void setItemMiniIcon(FXint index,
FXIcon* icon,FXbool owned=
false);
490 FXIcon* getItemMiniIcon(FXint index)
const;
493 void setItemData(FXint index,FXptr ptr);
496 FXptr getItemData(FXint index)
const;
499 FXbool isItemSelected(FXint index)
const;
502 FXbool isItemCurrent(FXint index)
const;
505 FXbool isItemVisible(FXint index)
const;
508 FXbool isItemEnabled(FXint index)
const;
511 FXint hitItem(FXint index,FXint x,FXint y,FXint ww=1,FXint hh=1)
const;
514 void updateItem(FXint index)
const;
517 virtual FXbool enableItem(FXint index);
520 virtual FXbool disableItem(FXint index);
523 virtual FXbool selectItem(FXint index,FXbool notify=
false);
526 virtual FXbool deselectItem(FXint index,FXbool notify=
false);
529 virtual FXbool toggleItem(FXint index,FXbool notify=
false);
532 virtual FXbool selectInRectangle(FXint x,FXint y,FXint w,FXint h,FXbool notify=
false);
535 virtual FXbool extendSelection(FXint index,FXbool notify=
false);
538 virtual FXbool selectAll(FXbool notify=
false);
541 virtual FXbool killSelection(FXbool notify=
false);
544 virtual void setCurrentItem(FXint index,FXbool notify=
false);
550 void setAnchorItem(FXint index);
565 void setFont(
FXFont* fnt);
574 void setTextColor(FXColor clr);
580 void setSelBackColor(FXColor clr);
586 void setSelTextColor(FXColor clr);
589 void setItemSpace(FXint s);
595 FXuint getListStyle()
const;
598 void setListStyle(FXuint style);
601 void setHelpText(
const FXString& text);
607 virtual void save(
FXStream& store)
const;
FXptr getData() const
Get item's user data.
Definition: FXIconList.h:112
FXint getItemWidth() const
Return item width.
Definition: FXIconList.h:442
FXColor getTextColor() const
Return normal text color.
Definition: FXIconList.h:571
void setData(FXptr ptr)
Change item's user data.
Definition: FXIconList.h:109
FXFont * getFont() const
Return text font.
Definition: FXIconList.h:568
FXIconItem(const FXString &text, FXIcon *bi=nullptr, FXIcon *mi=nullptr, FXptr ptr=nullptr)
Construct new item with given text, icons, and user-data.
Definition: FXIconList.h:88
FXint getAnchorItem() const
Return anchor item index, or -1 if none.
Definition: FXIconList.h:553
FXint getNumCols() const
Return number of columns.
Definition: FXIconList.h:355
A File List widget provides an icon rich view of the file system.
Definition: FXFileList.h:131
FXint getNumItems() const
Return number of items.
Definition: FXIconList.h:349
Base composite.
Definition: FXComposite.h:32
FXbool isSelected() const
Return true if this item is selected.
Definition: FXIconList.h:124
FXColor getSelBackColor() const
Return selected text background.
Definition: FXIconList.h:577
FXint getItemSpace() const
Return maximum item space.
Definition: FXIconList.h:592
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXColor getSelTextColor() const
Return selected text color.
Definition: FXIconList.h:583
FXbool hasFocus() const
Return true if item has focus.
Definition: FXIconList.h:118
Abstract Device Context.
Definition: FXDC.h:153
FXIcon * getMiniIcon() const
Return item's mini icon.
Definition: FXIconList.h:106
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
void setSortFunc(FXIconListSortFunc func)
Change sort function.
Definition: FXIconList.h:562
const FXString & getText() const
Return item's text label.
Definition: FXIconList.h:94
Icon item.
Definition: FXIconList.h:55
FXint getCurrentItem() const
Return current item index, or -1 if none.
Definition: FXIconList.h:547
FXival no() const
Return number of objects.
Definition: FXObjectList.h:59
A Icon List Widget displays a list of items, each with a text and optional icon.
Definition: FXIconList.h:200
const FXString & getHelpText() const
Get the status line help text for this widget.
Definition: FXIconList.h:604
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
FXIconListSortFunc getSortFunc() const
Return sort function.
Definition: FXIconList.h:559
FXbool isDraggable() const
Return true if this item is draggable.
Definition: FXIconList.h:136
FXbool isEnabled() const
Return true if this item is enabled.
Definition: FXIconList.h:130
FXint getItemHeight() const
Return item height.
Definition: FXIconList.h:445
FXIcon * getBigIcon() const
Return item's big icon.
Definition: FXIconList.h:100
Font class.
Definition: FXFont.h:137
FXint getNumRows() const
Return number of rows.
Definition: FXIconList.h:352
FXHeader * getHeader() const
Return header control.
Definition: FXIconList.h:358
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42