Cross-platform examples with API functions for all 3 platforms (keep in mind that some examples on MacOS are still only working for Carbon and don't work with Cocoa):DoubleDutch wrote:It would be good if some of the examples where all three platforms had their own code would be added.
- Check if Gadget is disabled
- Check if Gadget is visable
- Display website in default browser
- Drag image from WebGadget onto ImageGadget and display image path
- Get double click time
- Get IP addresses from host name
- Get MAC address from remote computer
- Get computer name
- Get user idle time
- Get UTC Time from different countries
- OpenGL Demo
ButtonGadget:
- Toggle text justification between center and left
Custom Gadgets:
- TimePicker using SpinButtons and TextGadget
- Windows-like TimePicker
ComboBoxGadget:
- Enable and disable ComboBox and keep background white
Cursor:
- Change cursor into PNG image
- Hide and show cursor
EditorGadget:
- Add line and keep it visible
- Center text
- Convert text containing tags to RTF (supporting bold, italic and underlined characters)
- Detect right click and display context menu
- Enable word wrap
- Get number of lines
- Get single text line from wrapped text block
- Select line after line and keep line visible
- Search in EditorGadget for text line double clicked in a ListIconGadget and select that line
- Select and deselect all the text
- Set cursor
ExplorerListGadget:
- Select a row
- Select and unselect a row (without API)
ExplorerTreeGadget:
- Similar look and behaviour in Linux and MacOS as in Windows
HyperLinkGadget:
- Detect right click and display popup menu
ListIconGadget:
- Count number of columns
- Detect left click on cell
- Detect left click on header cell
- Detect movement of mouse wheel
- Display double-clicked row at top of list
- Display selected row in center of Gadget
- Get all selected items
- Get and set row height
- Get currently visible top row
- GetGadgetItemImage()
- Hide title header
- Set column justification
- Toggle multi selection of items
ListViewGadget:
- Get selected rows without iterating over all rows
- Get row at top of list
PanelGadget:
- Get absolute position of gadget on panel
ScrollBarGadget:
- Live scrolling
StringGadget:
- Align text right
- Autoselect text on mouse over gadget
- Center text
- Detect read only mode
- Detect right click and suppress context menu
- Get and set cursor position
- Get and set placeholder text
- Get and set selected text
- Set cursor to end of text
- Toggle read only state
- Toggle vertical centering
TextGadget:
- Toggle vertical centering
ToolBar:
- Detect if toolbar button is enabled or disabled
TreeGadget:
- Get row height
- GetGadgetItemImage()
WebGadget:
- Drag image from WebGadget to ImageGadget and display image path
Window:
- Change transparency
- Detect end of resizing
- Get background color of window and set same background color in CanvasGadget
- Set background image
Some examples have already been implemented in PB like "Get double click time", "Enable word wrap" or "Get computer name"...
DoubleDutch wrote:Maybe there should be a special bit of the forum where you can post API code that works on all three platforms that Fred & co can consider for inclusion in the main code core?
It would be nice to have a subforum for cross-platform API code...