wx

v2.6-rc0

Wx Release Notes

This document describes the changes made to the Wx application.

Wx 2.6

Fixed Bugs and Malfunctions

The examples for wx are now only installed in one place (in doc/examples).

Own Id: OTP-20119 Aux Id: ERIERL-1315, PR-11032

Improvements and New Features

Documentation about how to validate the SBOM using sigstore has been added.

Own Id: OTP-19766 Aux Id: GH-10151, PR-10187

Added support for -unsafe attributes, which is used to mark functions as unsafe to use.

This is similar to but separate from deprecation, and the compiler will by default now generate warnings for calls to functions in Erlang/OTP that are known to be always unsafe.

Furthermore, xref can now be used to find calls to functions in another application that lack a -doc attribute (undocumented_function_calls), calls to functions in another application marked -doc false. (private_function_calls), as well as calls to unsafe functions (unsafe_function_calls).

Own Id: OTP-20066 Aux Id: PR-10839

Wx 2.5.4.1

Fixed Bugs and Malfunctions

The examples for wx are now only installed in one place (in doc/examples).

Own Id: OTP-20119 Aux Id: ERIERL-1315, PR-11032

Wx 2.5.4

Improvements and New Features

Release applications, tests, and documentation are now placed in their respective directories. Source SBOM with more packages.

A make release application places only the necessary code in the release folder. The main change is that the documentation and examples are not part of the release folder anymore.

make release_docs places the documentation in the released code under the doc folder.

make release_tests places the tests in their own directory. It used to be the case that some source code was mixed with the tests, and this should not happen anymore.

The Software Bill of Materials places the examples folders as if they are part of the SPDX-otp-<app>-doc packge, instead of placing examples as if they were running source code.

Overall, this change cleans up many things that were not quite correct by definition, and everything should still continue to work as expected. To test a release, one can still run ./Install -minimal \pwd`and add the release to thePATH. After that, one can run tests as usual, going into the released tests directory, enteringtest_server` and running the emulator.

Improves the source Software-Bill-of-Materials

The improvements adds new SPDX relations for asmjit and zlib to be optional_components_of the Erlang/OTP project.

The autoconf scripts in make and erts have now been categorised as build_tool_of the Erlang/OTP project.

All remaining configure, configure.ac, config.h.in, Makefile.in, Makefile.src, EMakefile, and GNUMakefile are now part of a specific SPDX package with relation build_tool_of the Erlang/OTP project.

Own Id: OTP-19886 Aux Id: PR-10434

Wx 2.5.3

Fixed Bugs and Malfunctions

Fix getting wxImage pixel values. For example, wxImage:getRed(Image) returned the wrong value.

Creating OpenGL windows should now work again.

Own Id: OTP-19823 Aux Id: PR-10314

Fixed reading out of array bounds and potential memory leaks.

Own Id: OTP-19843 Aux Id: PR-10353

Improvements and New Features

Updated the vendor dependencies SHA to improve the accuracy of the source SBOM with purl pointing to the exact vendor commit that Erlang/OTP builds upon.

Own Id: OTP-19777 Aux Id: PR-10216

Wx 2.5.2

Fixed Bugs and Malfunctions

NIFs and linked-in drivers are now loadable when running in an Erlang source tree on Windows.

Own Id: OTP-19686 Aux Id: PR-9969

Now avoiding that wx crashes the VM when running on OTP28+ due to one of the new compiler hardening options.

Own Id: OTP-19724 Aux Id: GH-9972, PR-10084

Improvements and New Features

wx was missing licenses that come from OpenGL documentation and wxWidgets documentation.

Own Id: OTP-19735 Aux Id: PR-10094

Wx 2.5.1

Fixed Bugs and Malfunctions

Don't include gl.beam in pre-built source tar file, since it depends on local configure results.

Own Id: OTP-19700 Aux Id: PR-10024

Wx 2.5

Improvements and New Features

Fixed licenses in files and added ORT curations to the following apps: otp, eldap, erl_interface, eunit, parsetools, stdlib, syntax_tools, and ERTS.

Own Id: OTP-19478 Aux Id: PR-9376, PR-9402, PR-9819

Added support for compiling Erlang/OTP for Windows on ARM64.

Own Id: OTP-19480 Aux Id: PR-8734

When compiling C/C++ code on Unix systems, the compiler hardening flags suggested by the Open Source Security Foundation are now enabled by default. To disable them, pass --disable-security-hardening-flags to configure.

Own Id: OTP-19519 Aux Id: PR-9441

The license and copyright header has changed format to include an SPDX-License-Identifier. At the same time, most files have been updated to follow a uniform standard for license headers.

Own Id: OTP-19575 Aux Id: PR-9670

Wx 2.4.3.1

Fixed Bugs and Malfunctions

Fixed reading out of array bounds and potential memory leaks.

Own Id: OTP-19843 Aux Id: PR-10353

Wx 2.4.3

Fixed Bugs and Malfunctions

Documentation has been improved.

Own Id: OTP-19190

Wx 2.4.2

Improvements and New Features

The documentation has been migrated to use Markdown and ExDoc.

Own Id: OTP-18955 Aux Id: PR-8026

Wx 2.4.1.1

Fixed Bugs and Malfunctions

Fixed reading out of array bounds and potential memory leaks.

Own Id: OTP-19843 Aux Id: PR-10353

Wx 2.4.1

Fixed Bugs and Malfunctions

Add option to silence wx depracation macros.

Own Id: OTP-18988 Aux Id: PR-7750

Wx 2.4

Improvements and New Features

Guards have been added to gen_*:start* API functions to catch bad arguments earlier. Before this change, in some cases, a bad argument could tag along and cause the server to fail later, right after start.

Own Id: OTP-18857 Aux Id: GH-7685

Wx 2.3.1

Fixed Bugs and Malfunctions

The wx application would fail to build on macOS with Xcode 15.

Own Id: OTP-18768 Aux Id: PR-7670

Wx 2.3

Improvements and New Features

Runtime dependencies have been updated.

Own Id: OTP-18350

The implementation has been fixed to use proc_lib:init_fail/2,3 where appropriate, instead of proc_lib:init_ack/1,2.

* POTENTIAL INCOMPATIBILITY *

Own Id: OTP-18490 Aux Id: OTP-18471, GH-6339, PR-6843

Wx 2.2.2.1

Fixed Bugs and Malfunctions

The wx application would fail to build on macOS with Xcode 15.

Own Id: OTP-18768 Aux Id: PR-7670

Wx 2.2.2

Fixed Bugs and Malfunctions

Improve debug prints from the nifs. Some minor fixes for wxWidgets-3.2. Fixed OpenGL debug functions.

Own Id: OTP-18512

Wx 2.2.1

Fixed Bugs and Malfunctions

Added environment variable WX_MACOS_NON_GUI_APP to allow user to override OSXIsGUIApplication behavior.

Own Id: OTP-18213 Aux Id: PR-6113

Wx 2.2

Improvements and New Features

Input for configure scripts adapted to autoconf 2.71.

Own Id: OTP-17414 Aux Id: PR-4967

Added aux1Down and aux2Down fields to the wxMouseState record. Since one record have been changed a recompilation of user code might be required.

* POTENTIAL INCOMPATIBILITY *

Own Id: OTP-17950

Add mac specific menubar functions.

Own Id: OTP-18008 Aux Id: PR-5816

Wx 2.1.4

Fixed Bugs and Malfunctions

Fix build failure with wxWidgets-3.1.6.

Own Id: OTP-18064 Aux Id: GH-5893

Improvements and New Features

Enable the possibility to build wx on windows with wxWidgets-3.1.6.

Own Id: OTP-18061 Aux Id: GH-5883

Wx 2.1.3

Fixed Bugs and Malfunctions

Fixed a bug in callback handling which could lead to a unresponsive gui.

Own Id: OTP-17982 Aux Id: GH-5758

Wx 2.1.2

Fixed Bugs and Malfunctions

Removed the static_data option from wxImage creation functions, as it was broken and could lead to crashes. Now image data is always copied to wxWidgets as was the default behavior.

Removed some non working wxGridEvent event types, which have there own events in newer wxWidgets versions, and added a couple of event types that where missing in wx.

Own Id: OTP-17947

Wx 2.1.1

Fixed Bugs and Malfunctions

Fix crash in cleanup code when a gui application is exiting.

Fix errors in the OpenGL wrapper that could cause crashes and improve the documentation.

Own Id: OTP-17745

Wx 2.1

Fixed Bugs and Malfunctions

Fix crash when closing an application.

Own Id: OTP-17507

Some functions with overloaded color arguments could not be used. For example the copy constructor wxTextAttr:new(TextAttr) did not work.

Own Id: OTP-17577 Aux Id: GH-4999

Improvements and New Features

Added the Microsoft Edge WebView loader dll to the installer on windows.

Own Id: OTP-17325

Handle specific Mac gui application events.

Own Id: OTP-17438 Aux Id: PR-4780

Wx 2.0.1

Fixed Bugs and Malfunctions

Fix build problems when wxWidgets are built with -enable-std.

Own Id: OTP-17407 Aux Id: GH-4834

Commit of generated configure script.

Own Id: OTP-17420 Aux Id: OTP-17398, GH-4821

Wx 2.0

Fixed Bugs and Malfunctions

Fix compiler warnings produced by the clang compiler.

Own Id: OTP-17105 Aux Id: PR-2872

Improvements and New Features

The application has been completely rewritten in order to use wxWidgets version 3 as its base.

Add basic documentation generated from the wxWidgets project.

Own Id: OTP-16800

The experimental HiPE application has been removed, together with all related functionality in other applications.

* POTENTIAL INCOMPATIBILITY *

Own Id: OTP-16963

Added support for wxWebView.

Own Id: OTP-17213 Aux Id: PR-3027

Due to the support of the new backend versions some API incompatibilities have been introduced. Examples of changes are:
wxWindowDC default creators have been removed
wxClientDC default creators have been removed
wxPaintDC default creators have been removed
wxWindow:setVirtualSizeHints() has been deprecated in wxWidgets and removed
wxWindow:makeModal() has been deprecated in wxWidgets and removed
wxToolBar:add/insertTool without label have been deprecated in wxWidgets and removed
wxStyledTextCtrl some functions have changed arguments from boolean to int
wxSizerItem:new() Some arguments have become options
Removed deprecated wxSizerItem:setWindow() use assignWindow()
Removed deprecated wxSizerItem:setSpacer() use assignSpacer()
Removed deprecated wxSizerItem:setSpacer() use assignSpacer()
Removed deprecated wxSizerItem:setSizer() use assignSizer()
wxMenu append/insert/prepend have changed return value and lost IsCheckable argument
wxListCtrl:setItem/4 changed return value
wxImage:convertToGreyscale() options have changed
wxGridSizer:wxGridSizer() options have changed
wxGrid API have many changes
wxGraphicsRenderer:createGradientBrush() uses GradientStops now
wxGraphicsRenderer:createPen() have been removed
wxGraphicsRenderer:createGradientBrush() uses GradientStops now
wxGLCanvas API is incompatible
wxFlexGridSizer:wxFlexGridSizer() options have changed
wxDisplay:new() options have changed
wxCalendarDateAttr:new(ColText [,OptList]) have been removed
wxBitmapButton:set/getBitmapSelected() have been removed

* POTENTIAL INCOMPATIBILITY *

Own Id: OTP-17219 Aux Id: OTP-16800

Wx 1.9.3.1

Fixed Bugs and Malfunctions

Commit of generated configure script.

Own Id: OTP-17420 Aux Id: OTP-17398, GH-4821

Wx 1.9.3

Fixed Bugs and Malfunctions

Fixed wx initialization on mac, top level menus did not always work on newer MacOS versions. The menus will not work until wxWidgets-3.1.5 is released and used on these MacOS versions.

Own Id: OTP-17187

Wx 1.9.2

Fixed Bugs and Malfunctions

Add popup menu callback to wxTaskBarIcon:new/1.

Own Id: OTP-16983 Aux Id: PR-2743

Wx 1.9.1

Fixed Bugs and Malfunctions

Fix various compiler warnings on 64-bit Windows.

Own Id: OTP-15800

Improvements and New Features

Refactored the internal handling of deprecated and removed functions.

Own Id: OTP-16469

Wx 1.9.0.1

Fixed Bugs and Malfunctions

Commit of generated configure script.

Own Id: OTP-17420 Aux Id: OTP-17398, GH-4821

Wx 1.9

Improvements and New Features

Added wxWindow:isShownOnScreen/1, wxMouseEvent:getWheelAxis and mac specific menubar functions. Fixed defines that have changed in newer wxWidgets versions, that caused some literals to become run-time dependent on wxWidgets version.

Own Id: OTP-16285

Wx 1.8.9

Fixed Bugs and Malfunctions

Fix a driver bug that could crashes when allocating memory.

Own Id: OTP-15883 Aux Id: PR-2261

Wx 1.8.8

Fixed Bugs and Malfunctions

All incorrect (that is, all) uses of "can not" has been corrected to "cannot" in source code comments, documentation, examples, and so on.

Own Id: OTP-14282 Aux Id: PR-1891

Wx 1.8.7

Fixed Bugs and Malfunctions

Improved support for wxWidgets 3.1.3 which have changed wxFONTWEIGTH, also added wxGCDC and wxDisplay modules.

Fixed a crash on Mojave and check for events more often.

Own Id: OTP-15587

Wx 1.8.6

Fixed Bugs and Malfunctions

Fixed delayed delete bug which caused wx applications to crash on Mojave.

Own Id: OTP-15426 Aux Id: ERL-755

Wx 1.8.5

Fixed Bugs and Malfunctions

Fixed compilation warning on Darwin.

Own Id: OTP-15230 Aux Id: PR-1860

Wx 1.8.4

Improvements and New Features

Changed implementation so wx can now be built towards wxWidgets-3.1.1.

Own Id: OTP-15027

Wx 1.8.3

Fixed Bugs and Malfunctions

wx crashes in otp 20.1 if empty binaries was sent down as arguments.

Own Id: OTP-14688

Wx 1.8.2

Fixed Bugs and Malfunctions

Do not deprecate wxGraphicsContext:createLinearGradientBrush/7 and wxGraphicsContext:createRadialGradientBrush/8 which are still available in wxWidgets-3.0.

Own Id: OTP-14539

Improvements and New Features

General Unicode improvements.

Own Id: OTP-14462

Wx 1.8.1

Fixed Bugs and Malfunctions

Fix a livelock that could be caused by wx:batch/1.

Own Id: OTP-14289

Wx 1.8

Fixed Bugs and Malfunctions

Allow string arguments to be binaries as specified, i.e. unicode:chardata().

Own Id: OTP-13934 Aux Id: ERL-270

Improvements and New Features

Add wxWindow:dragAcceptFiles/2 and wxDropFilesEvent to support simple drag and drop from file browser.

Own Id: OTP-13933

Wx 1.7.1

Fixed Bugs and Malfunctions

Increased the stacksize for the wx thread. The default stacksize on Windows is 1MB which is not enough if the user created many nested dialogs.

Own Id: OTP-13816

Wx 1.7

Fixed Bugs and Malfunctions

Fixed bugs which could cause called functions to be invoked twice or not at all when callbacks where invoked at the same time.

Own Id: OTP-13491

Improvements and New Features

Changed atom 'boolean' fields in #wxMouseState{} to 'boolean()'.

Moved out arguments in wxListCtrl:hitTest to result.

Removed no-op functions in wxGauge that have been removed from wxWidgets-3.1.

* POTENTIAL INCOMPATIBILITY *

Own Id: OTP-13553

Wx 1.6.1

Fixed Bugs and Malfunctions

Fixed commands with multiple binaries, such as wxImage:new/4. Added wxWindow:SetDoubleBuffered/1, wxWindow:isDoubleBuffered/1, wxWindow:setTransparent/2 and wxWindow:canSetTransparent/1. Fixed timing issues.

Own Id: OTP-13404

Wx 1.6

Improvements and New Features

Add wxOverlay and make wxPostScripDC optional to make it easier to build on windows.

Correct some function specifications.

The driver implementation have been optimized and now invokes commands after events have been sent to erlang.

Own Id: OTP-13160

Wx 1.5

Improvements and New Features

Extend AUI functionality.

Own Id: OTP-12961

Wx 1.4

Fixed Bugs and Malfunctions

The undocumented option generic_debug for gen_server has been removed.

Own Id: OTP-12183

Remove raise condition where wx could crash during emulator stoppage.

Own Id: OTP-12734

Improvements and New Features

Use wxWidgets-3.0, if found, as default backend on windows.

Own Id: OTP-12632

Add missing fields in some events records. May require a recompilation of user applications.

Own Id: OTP-12660

Wx 1.3.3

Fixed Bugs and Malfunctions

Fix timing related crash during wx application stop.

Own Id: OTP-12374

Wx 1.3.2

Fixed Bugs and Malfunctions

Fixed a minor typo in the graphicsContext example.

Own Id: OTP-12259

Improvements and New Features

Distribute autoconf helpers to applications at build time instead of having multiple identical copies committed in the repository.

Own Id: OTP-12348

Wx 1.3.1

Fixed Bugs and Malfunctions

Implement --enable-sanitizers[=sanitizers]. Similar to debugging with Valgrind, it's very useful to enable -fsanitize= switches to catch bugs at runtime.

Own Id: OTP-12153

Wx 1.3

Fixed Bugs and Malfunctions

Fix delayed destroy for wxPaintDC objects which could cause an eternal loop for modal dialogs.

Fix wxSL_LABELS compatibility between wxWidgets-2.8 and wxWidgets-3.0 versions

Own Id: OTP-11985

Improvements and New Features

Add missing classes wxPopup[Transient]Window, wxActivateEvent and wxTextCtrl:cahngeValue/2 function.

Own Id: OTP-11986

Wx 1.2

Fixed Bugs and Malfunctions

Refactored C++ code, fixed crashes and a deadlock on linux.

Own Id: OTP-11586

Some local implementations of removing the last element from a list are replaced by lists:droplast/1. Note that this requires at least stdlib-2.0, which is the stdlib version delivered in OTP 17.0. (Thanks to Hans Svensson)

Own Id: OTP-11678

Reworked the internal event handling to avoid crashes in destroy objects. Thanks Tom for the bug report.

Own Id: OTP-11699

Application upgrade (appup) files are corrected for the following applications:

asn1, common_test, compiler, crypto, debugger, dialyzer, edoc, eldap, erl_docgen, et, eunit, gs, hipe, inets, observer, odbc, os_mon, otp_mibs, parsetools, percept, public_key, reltool, runtime_tools, ssh, syntax_tools, test_server, tools, typer, webtool, wx, xmerl

A new test utility for testing appup files is added to test_server. This is now used by most applications in OTP.

(Thanks to Tobias Schlager)

Own Id: OTP-11744

Wx 1.1.2

Fixed Bugs and Malfunctions

Fixed a problem which caused the debugger to crash when closing a window. Fixed static linking on mac.

Own Id: OTP-11444

Wx 1.1.1

Fixed Bugs and Malfunctions

wx initialization hanged with wxWidgets-3.0 on mac. Fixed a crash with wxListBox on wxWidgets-3.0 (thanks Sergei Golovan) Fixed documentation links. Fixed event callbacks cleanup.

Own Id: OTP-11393

Improve documentation (Thanks to Boris Mühmer)

Own Id: OTP-11505

Improvements and New Features

Fix silent make rules (Thanks to Anthony Ramine)

Own Id: OTP-11515

Wx 1.0

Fixed Bugs and Malfunctions

Add {silent_start, boolean()} option to wx:new/1 in order to be able to suppress error messages during startup of wx. (Thanks to Håkan Mattsson)

Own Id: OTP-10585

Fix wxTreeCtrl:getBoundingRect/2 and wxTreeCtrl:hitTest/1. wxTreeCtrl:hitTest now returns a tuple not bug compatible with previous releases but needed.

Own Id: OTP-10743

Improvements and New Features

The wx application now compiles and is usable with the unstable development branch of wxWidgets-2.9. Some functions are currently not available in wxWidgets-2.9 and their erlang counterparts are marked as deprecated. They will generate an error if called when linked against wxWidgets-2.9 libraries. This means that wx can now be built on 64bit MacOsX, but keep in mind that wxWidgets-2.9 is still a development branch and needs (a lot) more work before it becomes stable.

Own Id: OTP-10407 Aux Id: kunagi-262 [173]

Wx 0.99.2

Improvements and New Features

Fix errors in wxDC and wxGraphicsContext api.

Add wxTaskBarIcon.

Add wxStyledTextControl:setEdgeMode/2.

Add type and specs for all functions and records.

Own Id: OTP-9947

Wx 0.99.1

Fixed Bugs and Malfunctions

Fixed a deadlock in the driver, which could happen if a callback caused another callback to be invoked.

Own Id: OTP-9725

Improvements and New Features

Implemented wxSystemOptions.

Load Opengl from libGL.so.1 instead libGL.so to work around linux problems.

Own Id: OTP-9702

Wx 0.99

Fixed Bugs and Malfunctions

wx: fix obsolete guard warning (list/1) (Thanks to Tuncer Ayaz)

Own Id: OTP-9513

XML files have been corrected.

Own Id: OTP-9550 Aux Id: OTP-9541

Improvements and New Features

Support virtual tables in wxListCtrl.

Own Id: OTP-9415

Wx 0.98.10

Fixed Bugs and Malfunctions

Fixed wx app files on mac and solaris. Thanks Jachym Holecek and Joe Williams.

Own Id: OTP-9324

Wx 0.98.9

Fixed Bugs and Malfunctions

Wx crashed if graphics could not be initiated, for instance if DISPLAY was not available.

Wx could crash during startup, thanks Boris Muhmer for extra ordinary testing.

Own Id: OTP-9080

Wx on MacOS X generated complains on stderr about certain cocoa functions not being called from the "Main thread". This is now corrected.

Own Id: OTP-9081

Wx 0.98.8

Improvements and New Features

Add wxSystemSettings which was missing in the previous release, despite previous comments.

Fix an external loop when stopping erlang nicely.

Separate OpenGL to it's own dynamic loaded library, so other graphic libraries can reuse the gl module and it will not waste memory if not used.

Own Id: OTP-8951

Wx 0.98.7

Fixed Bugs and Malfunctions

Fix crash (segmentation fault) in callback handling.

Own Id: OTP-8766

Improvements and New Features

Add wxSystemSettings module.

Add wxTreeCtrl:editLabel/2.

Own Id: OTP-8767

Wx 0.98.6

Improvements and New Features

Calling sys:get_status() for processes that have globally registered names that were not atoms would cause a crash. Corrected. (Thanks to Steve Vinoski.)

Own Id: OTP-8656

Wx 0.98.5

Fixed Bugs and Malfunctions

Corrected incorrectly generated wxFileDialog:getPaths/1. Reported by Jason/hornja.

Own Id: OTP-8330

Fixed a memory reference bug which caused unexplained {badarg, Int} exits when running multiple wx applications.

Own Id: OTP-8461

Improvements and New Features

Added wxListCtrl:getEditCtrl/1 (not available on Mac).

Own Id: OTP-8408

Cleanups suggested by tidier and modernization of types and specs.

Own Id: OTP-8455

Changed representation of wxTreeItem to be an integer. This saves memory, where the driver do not need to keep a object reference to each tree item.

Added getFirstChild and getNextChild to wxTreeCtrl.

Own Id: OTP-8462

Wx 0.98.4

Improvements and New Features

Added wx_object improvements from Mazen.

Fixed pid issues, reported by Mazen.

Added wxLogNull class, reported by Amit Murthy.

Various configure fixes.

Own Id: OTP-8243 Aux Id: seq11418

The documentation is now built with open source tools (xsltproc and fop) that exists on most platforms. One visible change is that the frames are removed.

Own Id: OTP-8250

wx now builds with wxWidgets 2.8.4 or a later 2.8 release, thanks Nico Kruber.

Own Id: OTP-8292

Wx 0.98.3

Fixed Bugs and Malfunctions

Added wxListCtrl sorting and build fixes supplied by Paul Hampson. Thanks.

Own Id: OTP-8126

Improvements and New Features

wxHtmlWindow class implemented.

All exceptions from callbacks are now caught and written to the log.

Some defines where wrong in 'wx.hrl'.

wx:batch/1 and friends could hang forever if for instance a breakpoint was set inside the fun. That caused all wx applications to hang.

Added missing wxAuiPaneInfo constructor and destructor.

Added wxAuiNotebookEvent and wxAuiManagerEvent.

Calling non supported wxWidgets functions hanged instead of crashed.

Update OpenGL to version 3.1 and added some of the missing glu functions.

Fixed wxRadioBox which inherited the wrong class, thanks Atilla Erdodi.

Own Id: OTP-8083

Removed some of the automatic garbage collecting after application exit, user will get a warning instead so he can correct the code.

Own Id: OTP-8138

Wx 0.98.2

Improvements and New Features

Olle Mattson have made a large demo, see examples/demo/, that triggered the following bugs and new features:

New book controls.

Added wxToolbar:addTool/6.

Empty binaries will be used to indicate NULL where applicable.

Own Id: OTP-7943

Applied patch from Nico Kruber, which fixes building on some wxwidgets installations.

Open source

Wx 0.98.1

Improvements and New Features

Added xrcctrl/3 to wxXmlResource and added a resource example.

Added several event types and events records and fixed a couple of event related bugs.

Event callbacks can now use wxEvtHandler:connect/2.

Error handling and debugging aid have been improved.

Added wxSplitterWindow and wxGauge:pulse and a couple of missing macros in wx.hrl.

Thanks to Steve Davis for feedback and bug reports.

Own Id: OTP-7875

Wx 0.98

Improvements and New Features

A first beta release of wxErlang.

Own Id: OTP-7859

wx the erlang binding of wxWidgets

The wx application is an erlang binding of wxWidgets. This document describes the erlang mapping to wxWidgets and it's implementation. It is not a complete users guide to wxWidgets. If you need that, you will have to read the wxWidgets documentation instead. wx tries to keep a one-to-one mapping with the original API so that the original documentation and examples shall be as easy as possible to use.

Wx examples and test suite can be found in the erlang src release. They can also provide some help on how to use the API.

This is currently a very brief introduction to wx. The application is still under development, which means the interface may change, and the test suite currently have a poor coverage ratio.

Contents

Introduction

Multiple processes and memory handling

Event Handling

Acknowledgments

Introduction

The original wxWidgets is an object-oriented (C++) API and that is reflected in the erlang mapping. In most cases each class in wxWidgets is represented as a module in erlang. This gives the wx application a huge interface, spread over several modules, and it all starts with the wx module. The wx module contains functions to create and destroy the GUI, i.e. wx:new/0, wx:destroy/0, and some other useful functions.

Objects or object references in wx should be seen as erlang processes rather than erlang terms. When you operate on them they can change state, e.g. they are not functional objects as erlang terms are. Each object has a type or rather a class, which is manipulated with the corresponding module or by sub-classes of that object. Type checking is done so that a module only operates on it's objects or inherited classes.

An object is created with new and destroyed with destroy. Most functions in the classes are named the same as their C++ counterpart, except that for convenience, in erlang they start with a lowercase letter and the first argument is the object reference. Optional arguments are last and expressed as tagged tuples in any order.

For example the wxWindow C++ class is implemented in the wxWindow erlang module and the member wxWindow::CenterOnParent is thus wxWindow:centerOnParent. The following C++ code:

  wxWindow MyWin = new wxWindow();
  MyWin.CenterOnParent(wxVERTICAL);
  ...
  delete MyWin;

would in erlang look like:

  MyWin = wxWindow:new(),
  wxWindow:centerOnParent(MyWin, [{dir,?wxVERTICAL}]),
  ...
  wxWindow:destroy(MyWin),

When you are reading wxWidgets documentation or the examples, you will notice that some of the most basic classes are missing in wx, they are directly mapped to corresponding erlang terms:

wxPoint is represented by {Xcoord,Ycoord}

wxSize is represented by {Width,Height}

wxRect is represented by {Xcoord,Ycoord,Width,Height}

wxColour is represented by {Red,Green,Blue[,Alpha]}

wxString is represented by unicode:charlist()

wxGBPosition is represented by {Row,Column}

wxGBSpan is represented by {RowSpan,ColumnSPan}

wxGridCellCoords is represented by {Row,Column}

In the places where the erlang API differs from the original one it should be obvious from the erlang documentation which representation has been used. E.g. the C++ arrays and/or lists are sometimes represented as erlang lists and sometimes as tuples.

Colours are represented with {Red,Green,Blue[,Alpha]}, the Alpha value is optional when used as an argument to functions, but it will always be returned from wx functions.

Defines, enumerations and global variables exists in wx.hrl as defines. Most of these defines are constants but not all. Some are platform dependent and therefore the global variables must be instantiated during runtime. These will be acquired from the driver with a call, so not all defines can be used in matching statements. Class local enumerations will be prefixed with the class name and a underscore as in ClassName_Enum.

Additionally some global functions, i.e. non-class functions, exist in the wx_misc module.

Wx is implemented as a (threaded) driver and a rather direct interface to the C++ API, with the drawback that if the erlang programmer does an error, it might crash the emulator.

Since the driver is threaded it requires a smp enabled emulator, that provides a thread safe interface to the driver.

Multiple processes and memory handling

The intention is that each erlang application calls wx:new() once to setup it's GUI which creates an environment and a memory mapping. To be able to use wx from several processes in your application, you must share the environment. You can get the active environment with wx:get_env/0 and set it in the new processes with wx:set_env/1. Two processes or applications which have both called wx:new() will not be able use each others objects.

  wx:new(),
  MyWin = wxFrame:new(wx:null(), 42, "Example", []),
  Env = wx:get_env(),
  spawn(fun() ->
           wx:set_env(Env),
           %% Here you can do wx calls from your helper process.
           ...
        end),
  ...

When wx:destroy/0 is invoked or when all processes in the application have died, the memory is deleted and all windows created by that application are closed.

The wx application never cleans or garbage collects memory as long as the user application is alive. Most of the objects are deleted when a window is closed, or at least all the objects which have a parent argument that is non null. By using wxCLASS:destroy/1 when possible you can avoid an increasing memory usage. This is especially important when wxWidgets assumes or recommends that you (or rather the C++ programmer) have allocated the object on the stack since that will never be done in the erlang binding. For example wxDC class or its sub-classes or wxSizerFlags.

Currently the dialogs show modal function freezes wxWidgets until the dialog is closed. That is intended but in erlang where you can have several GUI applications running at the same time it causes trouble. This will hopefully be fixed in future wxWidgets releases.

Event Handling

Event handling in wx differs most from the original API. You must specify every event you want to handle in wxWidgets, that is the same in the erlang binding but you can choose to receive the events as messages or handle them with callback funs.

Otherwise the event subscription is handled as wxWidgets dynamic event-handler connection. You subscribe to events of a certain type from objects with an ID or within a range of IDs. The callback fun is optional, if not supplied the event will be sent to the process that called connect/2. Thus, a handler is a callback fun or a process which will receive an event message.

Events are handled in order from bottom to top, in the widgets hierarchy, by the last subscribed handler first. Depending on if wxEvent:skip() is called the event will be handled by the other handler(s) afterwards. Most of the events have default event handler(s) installed.

Message events looks like #wx{id=integer(), obj=wx:wxObject(), userData=term(), event=Rec }. The id is the identifier of the object that received the event. The obj field contains the object that you used connect on. The userData field contains a user supplied term, this is an option to connect. And the event field contains a record with event type dependent information. The first element in the event record is always the type you subscribed to. For example if you subscribed to key_up events you will receive the #wx{event=Event} where Event will be a wxKey event record where Event#wxKey.type = key_up.

In wxWidgets the developer has to call wxEvent:skip() if he wants the event to be processed by other handlers. You can do the same in wx if you use callbacks. If you want the event as messages you just don't supply a callback and you can set the skip option in connect call to true or false, the default it is false. True means that you get the message but let the subsequent handlers also handle the event. If you want to change this behavior dynamically you must use callbacks and call wxEvent:skip().

Callback event handling is done by using the optional callback fun/2 when attaching the handler. The fun(#wx{},wxObject() must take two arguments where the first is the same as with message events described above and the second is an object reference to the actual event object. With the event object you can call wxEvent:skip() and access all the data. When using callbacks you must call wxEvent:skip() by yourself if you want any of the events to be forwarded to the following handlers. The actual event objects are deleted after the fun returns.

The callbacks are always invoked by another process and have exclusive usage of the GUI when invoked. This means that a callback fun cannot use the process dictionary and should not make calls to other processes. Calls to another process inside a callback fun may cause a deadlock if the other process is waiting on completion of his call to the GUI.

Acknowledgments

Mats-Ola Persson wrote the initial wxWidgets binding as part of his master thesis. The current version is a total re-write but many ideas have been reused. The reason for the re-write was mostly due to the limited requirements he had been given by us.

Also thanks to the wxWidgets team that develops and supports it so we have something to use.

gl

Erlang wrapper functions for OpenGL

Standard OpenGL API

This documents the functions as a brief version of the complete OpenGL reference pages.

Summary

Types

clamp()

enum()

f()

i()

m12()

m16()

matrix()

mem()

offset()

Functions

accum(Op, Value)

The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices.

activeShaderProgram(Pipeline, Program)

gl:activeShaderProgram/2 sets the linked program named by Program to be the active program for the program pipeline object Pipeline. The active program in the active program pipeline object is the target of calls to gl:uniform() when no program has been made current through a call to gl:useProgram/1.

activeTexture(Texture)

gl:activeTexture/1 selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation dependent, but must be at least 80.

alphaFunc(Func, Ref)

The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. gl:alphaFunc/2 specifies the reference value and the comparison function. The comparison is performed only if alpha testing is enabled. By default, it is not enabled. (See gl:enable/1 and gl:disable/1 of ?GL_ALPHA_TEST.)

areTexturesResident(Textures)

GL establishes a ``working set'' of textures that are resident in texture memory. These textures can be bound to a texture target much more efficiently than textures that are not resident.

arrayElement(I)

gl:arrayElement/1 commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify vertex and attribute data for point, line, and polygon primitives. If ?GL_VERTEX_ARRAY is enabled when gl:arrayElement/1 is called, a single vertex is drawn, using vertex and attribute data taken from location I of the enabled arrays. If ?GL_VERTEX_ARRAY is not enabled, no drawing occurs but the attributes corresponding to the enabled arrays are modified.

attachShader(Program, Shader)

In order to create a complete shader program, there must be a way to specify the list of things that will be linked together. Program objects provide this mechanism. Shaders that are to be linked together in a program object must first be attached to that program object. gl:attachShader/2 attaches the shader object specified by Shader to the program object specified by Program. This indicates that Shader will be included in link operations that will be performed on Program.

'begin'(Mode)

Equivalent to '\'end\''/0.

beginConditionalRender(Id, Mode)

Equivalent to endConditionalRender/0.

beginQuery(Target, Id)

Equivalent to endQuery/1.

beginQueryIndexed(Target, Index, Id)

Equivalent to endQueryIndexed/2.

beginTransformFeedback(PrimitiveMode)

Equivalent to endTransformFeedback/0.

bindAttribLocation(Program, Index, Name)

gl:bindAttribLocation/3 is used to associate a user-defined attribute variable in the program object specified by Program with a generic vertex attribute index. The name of the user-defined attribute variable is passed as a null terminated string in Name. The generic vertex attribute index to be bound to this variable is specified by Index. When Program is made part of current state, values provided via the generic vertex attribute Index will modify the value of the user-defined attribute variable specified by Name.

bindBuffer(Target, Buffer)

gl:bindBuffer/2 binds a buffer object to the specified buffer binding point. Calling gl:bindBuffer/2 with Target set to one of the accepted symbolic constants and Buffer set to the name of a buffer object binds that buffer object name to the target. If no buffer object with name Buffer exists, one is created with that name. When a buffer object is bound to a target, the previous binding for that target is automatically broken.

bindBufferBase(Target, Index, Buffer)

gl:bindBufferBase/3 binds the buffer object Buffer to the binding point at index Index of the array of targets specified by Target. Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or glMapBuffer. In addition to binding Buffer to the indexed buffer binding target, gl:bindBufferBase/3 also binds Buffer to the generic buffer binding point specified by Target.

bindBufferRange(Target, Index, Buffer, Offset, Size)

gl:bindBufferRange/5 binds a range the buffer object Buffer represented by Offset and Size to the binding point at index Index of the array of targets specified by Target. Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or glMapBuffer. In addition to binding a range of Buffer to the indexed buffer binding target, gl:bindBufferRange/5 also binds the range to the generic buffer binding point specified by Target.

bindBuffersBase(Target, First, Buffers)

gl:bindBuffersBase/3 binds a set of Count buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. If Buffers is ?NULL then gl:bindBuffersBase/3 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferBase/3, with the exception that the non-indexed Target is not changed by gl:bindBuffersBase/3

bindBuffersRange(Target, First, Buffers, Offsets, Sizes)

gl:bindBuffersRange/5 binds a set of Count ranges from buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. Offsets specifies the address of an array containing Count starting offsets within the buffers, and Sizes specifies the address of an array of Count sizes of the ranges. If Buffers is ?NULL then Offsets and Sizes are ignored and gl:bindBuffersRange/5 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferRange/5, with the exception that the non-indexed Target is not changed by gl:bindBuffersRange/5

bindFragDataLocation(Program, Color, Name)

gl:bindFragDataLocation/3 explicitly specifies the binding of the user-defined varying out variable Name to fragment shader color number ColorNumber for program Program. If Name was bound previously, its assigned binding is replaced with ColorNumber. Name must be a null-terminated string. ColorNumber must be less than ?GL_MAX_DRAW_BUFFERS.

bindFragDataLocationIndexed(Program, ColorNumber, Index, Name)

gl:bindFragDataLocationIndexed/4 specifies that the varying out variable Name in Program should be bound to fragment color ColorNumber when the program is next linked. Index may be zero or one to specify that the color be used as either the first or second color input to the blend equation, respectively.

bindFramebuffer(Target, Framebuffer)

gl:bindFramebuffer/2 binds the framebuffer object with name Framebuffer to the framebuffer target specified by Target. Target must be either ?GL_DRAW_FRAMEBUFFER, ?GL_READ_FRAMEBUFFER or ?GL_FRAMEBUFFER. If a framebuffer object is bound to ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling gl:bindFramebuffer/2 with Target set to ?GL_FRAMEBUFFER binds Framebuffer to both the read and draw framebuffer targets. Framebuffer is the name of a framebuffer object previously returned from a call to gl:genFramebuffers/1, or zero to break the existing binding of a framebuffer object to Target.

bindImageTexture(Unit, Texture, Level, Layered, Layer, Access, Format)

gl:bindImageTexture/7 binds a single level of a texture to an image unit for the purpose of reading and writing it from shaders. Unit specifies the zero-based index of the image unit to which to bind the texture level. Texture specifies the name of an existing texture object to bind to the image unit. If Texture is zero, then any existing binding to the image unit is broken. Level specifies the level of the texture to bind to the image unit.

bindImageTextures(First, Textures)

gl:bindImageTextures/2 binds images from an array of existing texture objects to a specified number of consecutive image units. Count specifies the number of texture objects whose names are stored in the array Textures. That number of texture names are read from the array and bound to the Count consecutive texture units starting from First. If the name zero appears in the Textures array, any existing binding to the image unit is reset. Any non-zero entry in Textures must be the name of an existing texture object. When a non-zero entry in Textures is present, the image at level zero is bound, the binding is considered layered, with the first layer set to zero, and the image is bound for read-write access. The image unit format parameter is taken from the internal format of the image at level zero of the texture object. For cube map textures, the internal format of the positive X image of level zero is used. If Textures is ?NULL then it is as if an appropriately sized array containing only zeros had been specified.

bindProgramPipeline(Pipeline)

gl:bindProgramPipeline/1 binds a program pipeline object to the current context. Pipeline must be a name previously returned from a call to gl:genProgramPipelines/1. If no program pipeline exists with name Pipeline then a new pipeline object is created with that name and initialized to the default state vector.

bindRenderbuffer(Target, Renderbuffer)

gl:bindRenderbuffer/2 binds the renderbuffer object with name Renderbuffer to the renderbuffer target specified by Target. Target must be ?GL_RENDERBUFFER. Renderbuffer is the name of a renderbuffer object previously returned from a call to gl:genRenderbuffers/1, or zero to break the existing binding of a renderbuffer object to Target.

bindSampler(Unit, Sampler)

gl:bindSampler/2 binds Sampler to the texture unit at index Unit. Sampler must be zero or the name of a sampler object previously returned from a call to gl:genSamplers/1. Unit must be less than the value of ?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS.

bindSamplers(First, Samplers)

gl:bindSamplers/2 binds samplers from an array of existing sampler objects to a specified number of consecutive sampler units. Count specifies the number of sampler objects whose names are stored in the array Samplers. That number of sampler names is read from the array and bound to the Count consecutive sampler units starting from First.

bindTexture(Target, Texture)

gl:bindTexture/2 lets you create or use a named texture. Calling gl:bindTexture/2 with Target set to ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, ?GL_TEXTURE_BUFFER, ?GL_TEXTURE_2D_MULTISAMPLE or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY and Texture set to the name of the new texture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken.

bindTextures(First, Textures)

gl:bindTextures/2 binds an array of existing texture objects to a specified number of consecutive texture units. Count specifies the number of texture objects whose names are stored in the array Textures. That number of texture names are read from the array and bound to the Count consecutive texture units starting from First. The target, or type of texture is deduced from the texture object and each texture is bound to the corresponding target of the texture unit. If the name zero appears in the Textures array, any existing binding to any target of the texture unit is reset and the default texture for that target is bound in its place. Any non-zero entry in Textures must be the name of an existing texture object. If Textures is ?NULL then it is as if an appropriately sized array containing only zeros had been specified.

bindTextureUnit(Unit, Texture)

gl:bindTextureUnit/2 binds an existing texture object to the texture unit numbered Unit.

bindTransformFeedback(Target, Id)

gl:bindTransformFeedback/2 binds the transform feedback object with name Id to the current GL state. Id must be a name previously returned from a call to gl:genTransformFeedbacks/1. If Id has not previously been bound, a new transform feedback object with name Id and initialized with the default transform state vector is created.

bindVertexArray(Array)

gl:bindVertexArray/1 binds the vertex array object with name Array. Array is the name of a vertex array object previously returned from a call to gl:genVertexArrays/1, or zero to break the existing vertex array object binding.

bindVertexBuffer(Bindingindex, Buffer, Offset, Stride)

Equivalent to vertexArrayVertexBuffer/5.

bindVertexBuffers(First, Buffers, Offsets, Strides)

Equivalent to vertexArrayVertexBuffers/5.

bitmap(Width, Height, Xorig, Yorig, Xmove, Ymove, Bitmap)

A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap are not modified.

blendColor(Red, Green, Blue, Alpha)

The ?GL_BLEND_COLOR may be used to calculate the source and destination blending factors. The color components are clamped to the range [0 1] before being stored. See gl:blendFunc/2 for a complete description of the blending operations. Initially the ?GL_BLEND_COLOR is set to (0, 0, 0, 0).

blendEquation(Mode)

Equivalent to blendEquationi/2.

blendEquationi(Buf, Mode)

The blend equations determine how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). This function sets both the RGB blend equation and the alpha blend equation to a single equation. gl:blendEquationi/2 specifies the blend equation for a single draw buffer whereas gl:blendEquation/1 sets the blend equation for all draw buffers.

blendEquationSeparate(ModeRGB, ModeAlpha)

Equivalent to blendEquationSeparatei/3.

blendEquationSeparatei(Buf, ModeRGB, ModeAlpha)

The blend equations determines how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). These functions specify one blend equation for the RGB-color components and one blend equation for the alpha component. gl:blendEquationSeparatei/3 specifies the blend equations for a single draw buffer whereas gl:blendEquationSeparate/2 sets the blend equations for all draw buffers.

blendFunc(Sfactor, Dfactor)

Equivalent to blendFunci/3.

blendFunci(Buf, Src, Dst)

Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use gl:enable/1 and gl:disable/1 with argument ?GL_BLEND to enable and disable blending.

blendFuncSeparate(SfactorRGB, DfactorRGB, SfactorAlpha, DfactorAlpha)

Equivalent to blendFuncSeparatei/5.

blendFuncSeparatei(Buf, SrcRGB, DstRGB, SrcAlpha, DstAlpha)

Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use gl:enable/1 and gl:disable/1 with argument ?GL_BLEND to enable and disable blending.

blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter)

gl:blitFramebuffer/10 and glBlitNamedFramebuffer transfer a rectangle of pixel values from one region of a read framebuffer to another region of a draw framebuffer.

bufferData(Target, Size, Data, Usage)

gl:bufferData/4 and glNamedBufferData create a new data store for a buffer object. In case of gl:bufferData/4, the buffer object currently bound to Target is used. For glNamedBufferData, a buffer object associated with ID specified by the caller in Buffer will be used instead.

bufferStorage(Target, Size, Data, Flags)

gl:bufferStorage/4 and glNamedBufferStorage create a new immutable data store. For gl:bufferStorage/4, the buffer object currently bound to Target will be initialized. For glNamedBufferStorage, Buffer is the name of the buffer object that will be configured. The size of the data store is specified by Size. If an initial data is available, its address may be supplied in Data. Otherwise, to create an uninitialized data store, Data should be ?NULL.

bufferSubData(Target, Offset, Size, Data)

gl:bufferSubData/4 and glNamedBufferSubData redefine some or all of the data store for the specified buffer object. Data starting at byte offset Offset and extending for Size bytes is copied to the data store from the memory pointed to by Data. Offset and Size must define a range lying entirely within the buffer object's data store.

callList(List)

gl:callList/1 causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list. If List has not been defined as a display list, gl:callList/1 is ignored.

callLists(Lists)

gl:callLists/1 causes each display list in the list of names passed as Lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored.

checkFramebufferStatus(Target)

gl:checkFramebufferStatus/1 and glCheckNamedFramebufferStatus return the completeness status of a framebuffer object when treated as a read or draw framebuffer, depending on the value of Target.

clampColor(Target, Clamp)

gl:clampColor/2 controls color clamping that is performed during gl:readPixels/7. Target must be ?GL_CLAMP_READ_COLOR. If Clamp is ?GL_TRUE, read color clamping is enabled; if Clamp is ?GL_FALSE, read color clamping is disabled. If Clamp is ?GL_FIXED_ONLY, read color clamping is enabled only if the selected read buffer has fixed point components and disabled otherwise.

clear(Mask)

gl:clear/1 sets the bitplane area of the window to values previously selected by gl:clearColor/4, gl:clearDepth/1, and gl:clearStencil/1. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using gl:drawBuffer/1.

clearAccum(Red, Green, Blue, Alpha)

gl:clearAccum/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the accumulation buffer.

clearBufferData(Target, Internalformat, Format, Type, Data)

Equivalent to clearBufferuiv/3.

clearBufferfi(Buffer, Drawbuffer, Depth, Stencil)

Equivalent to clearBufferuiv/3.

clearBufferfv(Buffer, Drawbuffer, Value)

Equivalent to clearBufferuiv/3.

clearBufferiv(Buffer, Drawbuffer, Value)

Equivalent to clearBufferuiv/3.

clearBufferSubData(Target, Internalformat, Offset, Size, Format, Type, Data)

Equivalent to clearBufferuiv/3.

clearBufferuiv(Buffer, Drawbuffer, Value)

These commands clear a specified buffer of a framebuffer to specified value(s). For gl:clearBuffer*(), the framebuffer is the currently bound draw framebuffer object. For glClearNamedFramebuffer*, Framebuffer is zero, indicating the default draw framebuffer, or the name of a framebuffer object.

clearColor(Red, Green, Blue, Alpha)

gl:clearColor/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the color buffers. Values specified by gl:clearColor/4 are clamped to the range [0 1].

clearDepth(Depth)

Equivalent to clearDepthf/1.

clearDepthf(D)

gl:clearDepth/1 specifies the depth value used by gl:clear/1 to clear the depth buffer. Values specified by gl:clearDepth/1 are clamped to the range [0 1].

clearIndex(C)

gl:clearIndex/1 specifies the index used by gl:clear/1 to clear the color index buffers. C is not clamped. Rather, C is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2 m-1, where m is the number of bits in a color index stored in the frame buffer.

clearStencil(S)

gl:clearStencil/1 specifies the index used by gl:clear/1 to clear the stencil buffer. S is masked with 2 m-1, where m is the number of bits in the stencil buffer.

clearTexImage(Texture, Level, Format, Type, Data)

gl:clearTexImage/5 fills all an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. Further, Texture may not be the name of a buffer texture, nor may its internal format be compressed.

clearTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Data)

gl:clearTexSubImage/11 fills all or part of an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. Further, Texture may not be the name of a buffer texture, nor may its internal format be compressed.

clientActiveTexture(Texture)

gl:clientActiveTexture/1 selects the vertex array client state parameters to be modified by gl:texCoordPointer/4, and enabled or disabled with gl:enableClientState/1 or gl:disableClientState/1, respectively, when called with a parameter of ?GL_TEXTURE_COORD_ARRAY.

clientWaitSync(Sync, Flags, Timeout)

gl:clientWaitSync/3 causes the client to block and wait for the sync object specified by Sync to become signaled. If Sync is signaled when gl:clientWaitSync/3 is called, gl:clientWaitSync/3 returns immediately, otherwise it will block and wait for up to Timeout nanoseconds for Sync to become signaled.

clipControl(Origin, Depth)

gl:clipControl/2 controls the clipping volume behavior and the clip coordinate to window coordinate transformation behavior.

clipPlane(Plane, Equation)

Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. gl:clipPlane/2 allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axis, against which all geometry is clipped. To determine the maximum number of additional clipping planes, call gl:getIntegerv/1 with argument ?GL_MAX_CLIP_PLANES. All implementations support at least six such clipping planes. Because the resulting clipping region is the intersection of the defined half-spaces, it is always convex.

color3b(Red, Green, Blue)

Equivalent to color4usv/1.

color3bv/1

Equivalent to color4usv/1.

color3d(Red, Green, Blue)

Equivalent to color4usv/1.

color3dv/1

Equivalent to color4usv/1.

color3f(Red, Green, Blue)

Equivalent to color4usv/1.

color3fv/1

Equivalent to color4usv/1.

color3i(Red, Green, Blue)

Equivalent to color4usv/1.

color3iv/1

Equivalent to color4usv/1.

color3s(Red, Green, Blue)

Equivalent to color4usv/1.

color3sv/1

Equivalent to color4usv/1.

color3ub(Red, Green, Blue)

Equivalent to color4usv/1.

color3ubv/1

Equivalent to color4usv/1.

color3ui(Red, Green, Blue)

Equivalent to color4usv/1.

color3uiv/1

Equivalent to color4usv/1.

color3us(Red, Green, Blue)

Equivalent to color4usv/1.

color3usv/1

Equivalent to color4usv/1.

color4b(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4bv/1

Equivalent to color4usv/1.

color4d(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4dv/1

Equivalent to color4usv/1.

color4f(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4fv/1

Equivalent to color4usv/1.

color4i(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4iv/1

Equivalent to color4usv/1.

color4s(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4sv/1

Equivalent to color4usv/1.

color4ub(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4ubv/1

Equivalent to color4usv/1.

color4ui(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4uiv/1

Equivalent to color4usv/1.

color4us(Red, Green, Blue, Alpha)

Equivalent to color4usv/1.

color4usv/1

The GL stores both a current single-valued color index and a current four-valued RGBA color. gl:color() sets a new four-valued RGBA color. gl:color() has two major variants: gl:color3() and gl:color4(). gl:color3() variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly. gl:color4() variants specify all four color components explicitly.

colorMask(Red, Green, Blue, Alpha)

Equivalent to colorMaski/5.

colorMaski(Index, R, G, B, A)

gl:colorMask/4 and gl:colorMaski/5 specify whether the individual color components in the frame buffer can or cannot be written. gl:colorMaski/5 sets the mask for a specific draw buffer, whereas gl:colorMask/4 sets the mask for all draw buffers. If Red is ?GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted.

colorMaterial(Face, Mode)

gl:colorMaterial/2 specifies which material parameters track the current color. When ?GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by Mode, of the material or materials specified by Face, track the current color at all times.

colorPointer(Size, Type, Stride, Ptr)

gl:colorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3 or 4. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

colorSubTable(Target, Start, Count, Format, Type, Data)

gl:colorSubTable/6 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels referenced by Data replace the portion of the existing table from indices Start to start+count-1, inclusive. This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

colorTable(Target, Internalformat, Width, Format, Type, Table)

gl:colorTable/6 may be used in two ways: to test the actual size and color resolution of a lookup table given a particular set of parameters, or to load the contents of a color lookup table. Use the targets ?GL_PROXY_* for the first case and the other targets for the second case.

colorTableParameterfv(Target, Pname, Params)

Equivalent to colorTableParameteriv/3.

colorTableParameteriv(Target, Pname, Params)

gl:colorTableParameter() is used to specify the scale factors and bias terms applied to color components when they are loaded into a color table. Target indicates which color table the scale and bias terms apply to; it must be set to ?GL_COLOR_TABLE, ?GL_POST_CONVOLUTION_COLOR_TABLE, or ?GL_POST_COLOR_MATRIX_COLOR_TABLE.

compileShader(Shader)

gl:compileShader/1 compiles the source code strings that have been stored in the shader object specified by Shader.

compressedTexImage1D(Target, Level, Internalformat, Width, Border, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

compressedTexImage2D(Target, Level, Internalformat, Width, Height, Border, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

compressedTexImage3D(Target, Level, Internalformat, Width, Height, Depth, Border, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

compressedTexSubImage1D(Target, Level, Xoffset, Width, Format, ImageSize, Data)

Equivalent to compressedTextureSubImage1D/7.

compressedTexSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data)

Equivalent to compressedTextureSubImage2D/9.

compressedTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, ImageSize, Data)

Equivalent to compressedTextureSubImage3D/11.

compressedTextureSubImage1D(Texture, Level, Xoffset, Width, Format, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

compressedTextureSubImage2D(Texture, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

compressedTextureSubImage3D(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, ImageSize, Data)

Texturing allows elements of an image array to be read by shaders.

convolutionFilter1D(Target, Internalformat, Width, Format, Type, Image)

gl:convolutionFilter1D/6 builds a one-dimensional convolution filter kernel from an array of pixels.

convolutionFilter2D(Target, Internalformat, Width, Height, Format, Type, Image)

gl:convolutionFilter2D/7 builds a two-dimensional convolution filter kernel from an array of pixels.

convolutionParameterf(Target, Pname, Params)

Equivalent to convolutionParameteriv/3.

convolutionParameterfv(Target, Pname, Params)

Equivalent to convolutionParameteriv/3.

convolutionParameteri(Target, Pname, Params)

Equivalent to convolutionParameteriv/3.

convolutionParameteriv(Target, Pname, Params)

gl:convolutionParameter() sets the value of a convolution parameter.

copyBufferSubData(ReadTarget, WriteTarget, ReadOffset, WriteOffset, Size)

gl:copyBufferSubData/5 and glCopyNamedBufferSubData copy part of the data store attached to a source buffer object to the data store attached to a destination buffer object. The number of basic machine units indicated by Size is copied from the source at offset ReadOffset to the destination at WriteOffset. ReadOffset, WriteOffset and Size are in terms of basic machine units.

copyColorSubTable(Target, Start, X, Y, Width)

gl:copyColorSubTable/5 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels copied from the framebuffer replace the portion of the existing table from indices Start to start+x-1, inclusive. This region may not include any entries outside the range of the color table, as was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

copyColorTable(Target, Internalformat, X, Y, Width)

gl:copyColorTable/5 loads a color table with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:colorTable/6).

copyConvolutionFilter1D(Target, Internalformat, X, Y, Width)

gl:copyConvolutionFilter1D/5 defines a one-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter1D/6).

copyConvolutionFilter2D(Target, Internalformat, X, Y, Width, Height)

gl:copyConvolutionFilter2D/6 defines a two-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter2D/7).

copyImageSubData(SrcName, SrcTarget, SrcLevel, SrcX, SrcY, SrcZ, DstName, DstTarget, DstLevel, DstX, DstY, DstZ, SrcWidth, SrcHeight, SrcDepth)

gl:copyImageSubData/15 may be used to copy data from one image (i.e. texture or renderbuffer) to another. gl:copyImageSubData/15 does not perform general-purpose conversions such as scaling, resizing, blending, color-space, or format conversions. It should be considered to operate in a manner similar to a CPU memcpy. CopyImageSubData can copy between images with different internal formats, provided the formats are compatible.

copyPixels(X, Y, Width, Height, Type)

gl:copyPixels/5 copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined.

copyTexImage1D(Target, Level, Internalformat, X, Y, Width, Border)

gl:copyTexImage1D/7 defines a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER.

copyTexImage2D(Target, Level, Internalformat, X, Y, Width, Height, Border)

gl:copyTexImage2D/8 defines a two-dimensional texture image, or cube-map texture image with pixels from the current ?GL_READ_BUFFER.

copyTexSubImage1D(Target, Level, Xoffset, X, Y, Width)

gl:copyTexSubImage1D/6 and glCopyTextureSubImage1D replace a portion of a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage1D/7). For gl:copyTexSubImage1D/6, the texture object that is bound to Target will be used for the process. For glCopyTextureSubImage1D, Texture tells which texture object should be used for the purpose of the call.

copyTexSubImage2D(Target, Level, Xoffset, Yoffset, X, Y, Width, Height)

gl:copyTexSubImage2D/8 and glCopyTextureSubImage2D replace a rectangular portion of a two-dimensional texture image, cube-map texture image, rectangular image, or a linear portion of a number of slices of a one-dimensional array texture with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage2D/9).

copyTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, X, Y, Width, Height)

gl:copyTexSubImage3D/9 and glCopyTextureSubImage3D functions replace a rectangular portion of a three-dimensional or two-dimensional array texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage3D/11).

createBuffers(N)

gl:createBuffers/1 returns N previously unused buffer names in Buffers, each representing a new buffer object initialized as if it had been bound to an unspecified target.

createFramebuffers(N)

gl:createFramebuffers/1 returns N previously unused framebuffer names in Framebuffers, each representing a new framebuffer object initialized to the default state.

createProgram()

gl:createProgram/0 creates an empty program object and returns a non-zero value by which it can be referenced. A program object is an object to which shader objects can be attached. This provides a mechanism to specify the shader objects that will be linked to create a program. It also provides a means for checking the compatibility of the shaders that will be used to create a program (for instance, checking the compatibility between a vertex shader and a fragment shader). When no longer needed as part of a program object, shader objects can be detached.

createProgramPipelines(N)

gl:createProgramPipelines/1 returns N previously unused program pipeline names in Pipelines, each representing a new program pipeline object initialized to the default state.

createQueries(Target, N)

gl:createQueries/2 returns N previously unused query object names in Ids, each representing a new query object with the specified Target.

createRenderbuffers(N)

gl:createRenderbuffers/1 returns N previously unused renderbuffer object names in Renderbuffers, each representing a new renderbuffer object initialized to the default state.

createSamplers(N)

gl:createSamplers/1 returns N previously unused sampler names in Samplers, each representing a new sampler object initialized to the default state.

createShader(Type)

gl:createShader/1 creates an empty shader object and returns a non-zero value by which it can be referenced. A shader object is used to maintain the source code strings that define a shader. ShaderType indicates the type of shader to be created. Five types of shader are supported. A shader of type ?GL_COMPUTE_SHADER is a shader that is intended to run on the programmable compute processor. A shader of type ?GL_VERTEX_SHADER is a shader that is intended to run on the programmable vertex processor. A shader of type ?GL_TESS_CONTROL_SHADER is a shader that is intended to run on the programmable tessellation processor in the control stage. A shader of type ?GL_TESS_EVALUATION_SHADER is a shader that is intended to run on the programmable tessellation processor in the evaluation stage. A shader of type ?GL_GEOMETRY_SHADER is a shader that is intended to run on the programmable geometry processor. A shader of type ?GL_FRAGMENT_SHADER is a shader that is intended to run on the programmable fragment processor.

createShaderProgramv(Type, Strings)

gl:createShaderProgram() creates a program object containing compiled and linked shaders for a single stage specified by Type. Strings refers to an array of Count strings from which to create the shader executables.

createTextures(Target, N)

gl:createTextures/2 returns N previously unused texture names in Textures, each representing a new texture object of the dimensionality and type specified by Target and initialized to the default values for that texture type.

createTransformFeedbacks(N)

gl:createTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids, each representing a new transform feedback object initialized to the default state.

createVertexArrays(N)

gl:createVertexArrays/1 returns N previously unused vertex array object names in Arrays, each representing a new vertex array object initialized to the default state.

cullFace(Mode)

gl:cullFace/1 specifies whether front- or back-facing facets are culled (as specified by mode) when facet culling is enabled. Facet culling is initially disabled. To enable and disable facet culling, call the gl:enable/1 and gl:disable/1 commands with the argument ?GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles.

debugMessageControl(Source, Type, Severity, Ids, Enabled)

gl:debugMessageControl/5 controls the reporting of debug messages generated by a debug context. The parameters Source, Type and Severity form a filter to select messages from the pool of potential messages generated by the GL.

debugMessageInsert(Source, Type, Id, Severity, Buf)

gl:debugMessageInsert/5 inserts a user-supplied message into the debug output queue. Source specifies the source that will be used to classify the message and must be ?GL_DEBUG_SOURCE_APPLICATION or ?GL_DEBUG_SOURCE_THIRD_PARTY. All other sources are reserved for use by the GL implementation. Type indicates the type of the message to be inserted and may be one of ?GL_DEBUG_TYPE_ERROR, ?GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, ?GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, ?GL_DEBUG_TYPE_PORTABILITY, ?GL_DEBUG_TYPE_PERFORMANCE, ?GL_DEBUG_TYPE_MARKER, ?GL_DEBUG_TYPE_PUSH_GROUP, ?GL_DEBUG_TYPE_POP_GROUP, or ?GL_DEBUG_TYPE_OTHER. Severity indicates the severity of the message and may be ?GL_DEBUG_SEVERITY_LOW, ?GL_DEBUG_SEVERITY_MEDIUM, ?GL_DEBUG_SEVERITY_HIGH or ?GL_DEBUG_SEVERITY_NOTIFICATION. Id is available for application defined use and may be any value. This value will be recorded and used to identify the message.

deleteBuffers(Buffers)

gl:deleteBuffers/1 deletes N buffer objects named by the elements of the array Buffers. After a buffer object is deleted, it has no contents, and its name is free for reuse (for example by gl:genBuffers/1). If a buffer object that is currently bound is deleted, the binding reverts to 0 (the absence of any buffer object).

deleteFramebuffers(Framebuffers)

gl:deleteFramebuffers/1 deletes the N framebuffer objects whose names are stored in the array addressed by Framebuffers. The name zero is reserved by the GL and is silently ignored, should it occur in Framebuffers, as are other unused names. Once a framebuffer object is deleted, its name is again unused and it has no attachments. If a framebuffer that is currently bound to one or more of the targets ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER is deleted, it is as though gl:bindFramebuffer/2 had been executed with the corresponding Target and Framebuffer zero.

deleteLists(List, Range)

gl:deleteLists/2 causes a contiguous group of display lists to be deleted. List is the name of the first display list to be deleted, and Range is the number of display lists to delete. All display lists d with list&lt;= d&lt;= list+range-1 are deleted.

deleteProgram(Program)

gl:deleteProgram/1 frees the memory and invalidates the name associated with the program object specified by Program. This command effectively undoes the effects of a call to gl:createProgram/0.

deleteProgramPipelines(Pipelines)

gl:deleteProgramPipelines/1 deletes the N program pipeline objects whose names are stored in the array Pipelines. Unused names in Pipelines are ignored, as is the name zero. After a program pipeline object is deleted, its name is again unused and it has no contents. If program pipeline object that is currently bound is deleted, the binding for that object reverts to zero and no program pipeline object becomes current.

deleteQueries(Ids)

gl:deleteQueries/1 deletes N query objects named by the elements of the array Ids. After a query object is deleted, it has no contents, and its name is free for reuse (for example by gl:genQueries/1).

deleteRenderbuffers(Renderbuffers)

gl:deleteRenderbuffers/1 deletes the N renderbuffer objects whose names are stored in the array addressed by Renderbuffers. The name zero is reserved by the GL and is silently ignored, should it occur in Renderbuffers, as are other unused names. Once a renderbuffer object is deleted, its name is again unused and it has no contents. If a renderbuffer that is currently bound to the target ?GL_RENDERBUFFER is deleted, it is as though gl:bindRenderbuffer/2 had been executed with a Target of ?GL_RENDERBUFFER and a Name of zero.

deleteSamplers(Samplers)

gl:deleteSamplers/1 deletes N sampler objects named by the elements of the array Samplers. After a sampler object is deleted, its name is again unused. If a sampler object that is currently bound to a sampler unit is deleted, it is as though gl:bindSampler/2 is called with unit set to the unit the sampler is bound to and sampler zero. Unused names in samplers are silently ignored, as is the reserved name zero.

deleteShader(Shader)

gl:deleteShader/1 frees the memory and invalidates the name associated with the shader object specified by Shader. This command effectively undoes the effects of a call to gl:createShader/1.

deleteSync(Sync)

gl:deleteSync/1 deletes the sync object specified by Sync. If the fence command corresponding to the specified sync object has completed, or if no gl:waitSync/3 or gl:clientWaitSync/3 commands are blocking on Sync, the object is deleted immediately. Otherwise, Sync is flagged for deletion and will be deleted when it is no longer associated with any fence command and is no longer blocking any gl:waitSync/3 or gl:clientWaitSync/3 command. In either case, after gl:deleteSync/1 returns, the name Sync is invalid and can no longer be used to refer to the sync object.

deleteTextures(Textures)

gl:deleteTextures/1 deletes N textures named by the elements of the array Textures. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (for example by gl:genTextures/1). If a texture that is currently bound is deleted, the binding reverts to 0 (the default texture).

deleteTransformFeedbacks(Ids)

gl:deleteTransformFeedbacks/1 deletes the N transform feedback objects whose names are stored in the array Ids. Unused names in Ids are ignored, as is the name zero. After a transform feedback object is deleted, its name is again unused and it has no contents. If an active transform feedback object is deleted, its name immediately becomes unused, but the underlying object is not deleted until it is no longer active.

deleteVertexArrays(Arrays)

gl:deleteVertexArrays/1 deletes N vertex array objects whose names are stored in the array addressed by Arrays. Once a vertex array object is deleted it has no contents and its name is again unused. If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero and the default vertex array becomes current. Unused names in Arrays are silently ignored, as is the value zero.

depthFunc(Func)

gl:depthFunc/1 specifies the function used to compare each incoming pixel depth value with the depth value present in the depth buffer. The comparison is performed only if depth testing is enabled. (See gl:enable/1 and gl:disable/1 of ?GL_DEPTH_TEST.)

depthMask(Flag)

gl:depthMask/1 specifies whether the depth buffer is enabled for writing. If Flag is ?GL_FALSE, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

depthRange(Near_val, Far_val)

Equivalent to depthRangef/2.

depthRangeArrayv(First, V)

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. Each viewport has an independent depth range specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). gl:depthRangeArray() specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates for each viewport in the range [First, First + Count). Thus, the values accepted by gl:depthRangeArray() are both clamped to this range before they are accepted.

depthRangef(N, F)

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. gl:depthRange/2 specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). Thus, the values accepted by gl:depthRange/2 are both clamped to this range before they are accepted.

depthRangeIndexed(Index, N, F)

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. Each viewport has an independent depth range specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). gl:depthRangeIndexed/3 specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates for a specified viewport. Thus, the values accepted by gl:depthRangeIndexed/3 are both clamped to this range before they are accepted.

detachShader(Program, Shader)

gl:detachShader/2 detaches the shader object specified by Shader from the program object specified by Program. This command can be used to undo the effect of the command gl:attachShader/2.

disable(Cap)

Equivalent to enablei/2.

disableClientState(Cap)

Equivalent to enableClientState/1.

disablei(Target, Index)

Equivalent to enablei/2.

disableVertexArrayAttrib(Vaobj, Index)

Equivalent to enableVertexAttribArray/1.

disableVertexAttribArray(Index)

Equivalent to enableVertexAttribArray/1.

dispatchCompute(Num_groups_x, Num_groups_y, Num_groups_z)

gl:dispatchCompute/3 launches one or more compute work groups. Each work group is processed by the active program object for the compute shader stage. While the individual shader invocations within a work group are executed as a unit, work groups are executed completely independently and in unspecified order. Num_groups_x, Num_groups_y and Num_groups_z specify the number of local work groups that will be dispatched in the X, Y and Z dimensions, respectively.

dispatchComputeIndirect(Indirect)

gl:dispatchComputeIndirect/1 launches one or more compute work groups using parameters stored in the buffer object currently bound to the ?GL_DISPATCH_INDIRECT_BUFFER target. Each work group is processed by the active program object for the compute shader stage. While the individual shader invocations within a work group are executed as a unit, work groups are executed completely independently and in unspecified order. Indirect contains the offset into the data store of the buffer object bound to the ?GL_DISPATCH_INDIRECT_BUFFER target at which the parameters are stored.

drawArrays(Mode, First, Count)

gl:drawArrays/3 specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to gl:drawArrays/3.

drawArraysIndirect(Mode, Indirect)

gl:drawArraysIndirect/2 specifies multiple geometric primitives with very few subroutine calls. gl:drawArraysIndirect/2 behaves similarly to gl:drawArraysInstancedBaseInstance/5, execept that the parameters to gl:drawArraysInstancedBaseInstance/5 are stored in memory at the address given by Indirect.

drawArraysInstanced(Mode, First, Count, Instancecount)

gl:drawArraysInstanced/4 behaves identically to gl:drawArrays/3 except that Instancecount instances of the range of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

drawArraysInstancedBaseInstance(Mode, First, Count, Instancecount, Baseinstance)

gl:drawArraysInstancedBaseInstance/5 behaves identically to gl:drawArrays/3 except that Instancecount instances of the range of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

drawBuffer(Mode)

When colors are written to the frame buffer, they are written into the color buffers specified by gl:drawBuffer/1. One of the following values can be used for default framebuffer

drawBuffers(Bufs)

gl:drawBuffers/1 and glNamedFramebufferDrawBuffers define an array of buffers into which outputs from the fragment shader data will be written. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within Bufs corresponding to the location assigned to that user defined output. The draw buffer used for user defined outputs assigned to locations greater than or equal to N is implicitly set to ?GL_NONE and any data written to such an output is discarded.

drawElements(Mode, Count, Type, Indices)

gl:drawElements/4 specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and so on, and use them to construct a sequence of primitives with a single call to gl:drawElements/4.

drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex)

gl:drawElementsBaseVertex/5 behaves identically to gl:drawElements/4 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

drawElementsIndirect(Mode, Type, Indirect)

gl:drawElementsIndirect/3 specifies multiple indexed geometric primitives with very few subroutine calls. gl:drawElementsIndirect/3 behaves similarly to gl:drawElementsInstancedBaseVertexBaseInstance/7, execpt that the parameters to gl:drawElementsInstancedBaseVertexBaseInstance/7 are stored in memory at the address given by Indirect.

drawElementsInstanced(Mode, Count, Type, Indices, Instancecount)

gl:drawElementsInstanced/5 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

drawElementsInstancedBaseInstance(Mode, Count, Type, Indices, Instancecount, Baseinstance)

gl:drawElementsInstancedBaseInstance/6 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

drawElementsInstancedBaseVertex(Mode, Count, Type, Indices, Instancecount, Basevertex)

gl:drawElementsInstancedBaseVertex/6 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type, Indices, Instancecount, Basevertex, Baseinstance)

gl:drawElementsInstancedBaseVertexBaseInstance/7 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

drawPixels(Width, Height, Format, Type, Pixels)

gl:drawPixels/5 reads pixel data from memory and writes it into the frame buffer relative to the current raster position, provided that the raster position is valid. Use gl:rasterPos() or gl:windowPos() to set the current raster position; use gl:get() with argument ?GL_CURRENT_RASTER_POSITION_VALID to determine if the specified raster position is valid, and gl:get() with argument ?GL_CURRENT_RASTER_POSITION to query the raster position.

drawRangeElements(Mode, Start, End, Count, Type, Indices)

gl:drawRangeElements/6 is a restricted form of gl:drawElements/4. Mode, and Count match the corresponding arguments to gl:drawElements/4, with the additional constraint that all values in the arrays Count must lie between Start and End, inclusive.

drawRangeElementsBaseVertex(Mode, Start, End, Count, Type, Indices, Basevertex)

gl:drawRangeElementsBaseVertex/7 is a restricted form of gl:drawElementsBaseVertex/5. Mode, Count and Basevertex match the corresponding arguments to gl:drawElementsBaseVertex/5, with the additional constraint that all values in the array Indices must lie between Start and End, inclusive, prior to adding Basevertex. Index values lying outside the range [Start, End] are treated in the same way as gl:drawElementsBaseVertex/5. The ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

drawTransformFeedback(Mode, Id)

gl:drawTransformFeedback/2 draws primitives of a type specified by Mode using a count retrieved from the transform feedback specified by Id. Calling gl:drawTransformFeedback/2 is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id.

drawTransformFeedbackInstanced(Mode, Id, Instancecount)

gl:drawTransformFeedbackInstanced/3 draws multiple copies of a range of primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackInstanced/3 is equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id.

drawTransformFeedbackStream(Mode, Id, Stream)

gl:drawTransformFeedbackStream/3 draws primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackStream/3 is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id.

drawTransformFeedbackStreamInstanced(Mode, Id, Stream, Instancecount)

gl:drawTransformFeedbackStreamInstanced/4 draws multiple copies of a range of primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackStreamInstanced/4 is equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id.

edgeFlag(Flag)

Equivalent to edgeFlagv/1.

edgeFlagPointer(Stride, Ptr)

gl:edgeFlagPointer/2 specifies the location and data format of an array of boolean edge flags to use when rendering. Stride specifies the byte stride from one edge flag to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

edgeFlagv/1

Each vertex of a polygon, separate triangle, or separate quadrilateral specified between a gl:'begin'/1/gl:'end'/0 pair is marked as the start of either a boundary or nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. gl:edgeFlag/1 sets the edge flag bit to ?GL_TRUE if Flag is ?GL_TRUE and to ?GL_FALSE otherwise.

enable(Cap)

Equivalent to enablei/2.

enableClientState(Cap)

gl:enableClientState/1 and gl:disableClientState/1 enable or disable individual client-side capabilities. By default, all client-side capabilities are disabled. Both gl:enableClientState/1 and gl:disableClientState/1 take a single argument, Cap, which can assume one of the following values

enablei(Target, Index)

gl:enable/1 and gl:disable/1 enable and disable various capabilities. Use gl:isEnabled/1 or gl:get() to determine the current setting of any capability. The initial value for each capability with the exception of ?GL_DITHER and ?GL_MULTISAMPLE is ?GL_FALSE. The initial value for ?GL_DITHER and ?GL_MULTISAMPLE is ?GL_TRUE.

enableVertexArrayAttrib(Vaobj, Index)

Equivalent to enableVertexAttribArray/1.

enableVertexAttribArray(Index)

gl:enableVertexAttribArray/1 and gl:enableVertexArrayAttrib/2 enable the generic vertex attribute array specified by Index. gl:enableVertexAttribArray/1 uses currently bound vertex array object for the operation, whereas gl:enableVertexArrayAttrib/2 updates state of the vertex array object with ID Vaobj.

'end'()

gl:'begin'/1 and gl:'end'/0 delimit the vertices that define a primitive or a group of like primitives. gl:'begin'/1 accepts a single argument that specifies in which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows

endConditionalRender()

Conditional rendering is started using gl:beginConditionalRender/2 and ended using gl:endConditionalRender/0. During conditional rendering, all vertex array commands, as well as gl:clear/1 and gl:clearBuffer() have no effect if the (?GL_SAMPLES_PASSED) result of the query object Id is zero, or if the (?GL_ANY_SAMPLES_PASSED) result is ?GL_FALSE. The results of commands setting the current vertex state, such as gl:vertexAttrib() are undefined. If the (?GL_SAMPLES_PASSED) result is non-zero or if the (?GL_ANY_SAMPLES_PASSED) result is ?GL_TRUE, such commands are not discarded. The Id parameter to gl:beginConditionalRender/2 must be the name of a query object previously returned from a call to gl:genQueries/1. Mode specifies how the results of the query object are to be interpreted. If Mode is ?GL_QUERY_WAIT, the GL waits for the results of the query to be available and then uses the results to determine if subsequent rendering commands are discarded. If Mode is ?GL_QUERY_NO_WAIT, the GL may choose to unconditionally execute the subsequent rendering commands without waiting for the query to complete.

endList()

Equivalent to newList/2.

endQuery(Target)

gl:beginQuery/2 and gl:endQuery/1 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1. If a query object with name Id does not yet exist it is created with the type determined by Target. Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED, ?GL_PRIMITIVES_GENERATED, ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED. The behavior of the query object depends on its type and is as follows.

endQueryIndexed(Target, Index)

gl:beginQueryIndexed/3 and gl:endQueryIndexed/2 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1. If a query object with name Id does not yet exist it is created with the type determined by Target. Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED, ?GL_PRIMITIVES_GENERATED, ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED. The behavior of the query object depends on its type and is as follows.

endTransformFeedback()

Transform feedback mode captures the values of varying variables written by the vertex shader (or, if active, the geometry shader). Transform feedback is said to be active after a call to gl:beginTransformFeedback/1 until a subsequent call to gl:endTransformFeedback/0. Transform feedback commands must be paired.

evalCoord1d(U)

Equivalent to evalCoord2fv/1.

evalCoord1dv/1

Equivalent to evalCoord2fv/1.

evalCoord1f(U)

Equivalent to evalCoord2fv/1.

evalCoord1fv/1

Equivalent to evalCoord2fv/1.

evalCoord2d(U, V)

Equivalent to evalCoord2fv/1.

evalCoord2dv/1

Equivalent to evalCoord2fv/1.

evalCoord2f(U, V)

Equivalent to evalCoord2fv/1.

evalCoord2fv/1

gl:evalCoord1() evaluates enabled one-dimensional maps at argument U. gl:evalCoord2() does the same for two-dimensional maps using two domain values, U and V. To define a map, call glMap1 and glMap2; to enable and disable it, call gl:enable/1 and gl:disable/1.

evalMesh1(Mode, I1, I2)

Equivalent to evalMesh2/5.

evalMesh2(Mode, I1, I2, J1, J2)

gl:mapGrid() and gl:evalMesh() are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. Mode determines whether the resulting vertices are connected as points, lines, or filled polygons.

evalPoint1(I)

Equivalent to evalPoint2/2.

evalPoint2(I, J)

gl:mapGrid() and gl:evalMesh() are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. gl:evalPoint() can be used to evaluate a single grid point in the same gridspace that is traversed by gl:evalMesh(). Calling gl:evalPoint1/1 is equivalent to calling glEvalCoord1( i.ð u+u 1 ); where ð u=(u 2-u 1)/n

feedbackBuffer(Size, Type, Buffer)

The gl:feedbackBuffer/3 function controls feedback. Feedback, like selection, is a GL mode. The mode is selected by calling gl:renderMode/1 with ?GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL.

fenceSync(Condition, Flags)

gl:fenceSync/2 creates a new fence sync object, inserts a fence command into the GL command stream and associates it with that sync object, and returns a non-zero name corresponding to the sync object.

finish()

gl:finish/0 does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents.

flush()

Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. gl:flush/0 empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.

flushMappedBufferRange(Target, Offset, Length)

Equivalent to flushMappedNamedBufferRange/3.

flushMappedNamedBufferRange(Buffer, Offset, Length)

gl:flushMappedBufferRange/3 indicates that modifications have been made to a range of a mapped buffer object. The buffer object must previously have been mapped with the ?GL_MAP_FLUSH_EXPLICIT_BIT flag.

fogCoordd(Coord)

Equivalent to fogCoordfv/1.

fogCoorddv/1

Equivalent to fogCoordfv/1.

fogCoordf(Coord)

Equivalent to fogCoordfv/1.

fogCoordfv/1

gl:fogCoord() specifies the fog coordinate that is associated with each vertex and the current raster position. The value specified is interpolated and used in computing the fog color (see gl:fog()).

fogCoordPointer(Type, Stride, Pointer)

gl:fogCoordPointer/3 specifies the location and data format of an array of fog coordinates to use when rendering. Type specifies the data type of each fog coordinate, and Stride specifies the byte stride from one fog coordinate to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

fogf(Pname, Param)

Equivalent to fogiv/2.

fogfv(Pname, Params)

Equivalent to fogiv/2.

fogi(Pname, Param)

Equivalent to fogiv/2.

fogiv(Pname, Params)

Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. To enable and disable fog, call gl:enable/1 and gl:disable/1 with argument ?GL_FOG.

framebufferParameteri(Target, Pname, Param)

gl:framebufferParameteri/3 and glNamedFramebufferParameteri modify the value of the parameter named Pname in the specified framebuffer object. There are no modifiable parameters of the default draw and read framebuffer, so they are not valid targets of these commands.

framebufferRenderbuffer(Target, Attachment, Renderbuffertarget, Renderbuffer)

gl:framebufferRenderbuffer/4 and glNamedFramebufferRenderbuffer attaches a renderbuffer as one of the logical buffers of the specified framebuffer object. Renderbuffers cannot be attached to the default draw and read framebuffer, so they are not valid targets of these commands.

framebufferTexture1D(Target, Attachment, Textarget, Texture, Level)

Equivalent to framebufferTextureLayer/5.

framebufferTexture2D(Target, Attachment, Textarget, Texture, Level)

Equivalent to framebufferTextureLayer/5.

framebufferTexture3D(Target, Attachment, Textarget, Texture, Level, Zoffset)

Equivalent to framebufferTextureLayer/5.

framebufferTexture(Target, Attachment, Texture, Level)

Equivalent to framebufferTextureLayer/5.

framebufferTextureFaceARB(Target, Attachment, Texture, Level, Face)

Equivalent to framebufferTextureLayer/5.

framebufferTextureLayer(Target, Attachment, Texture, Level, Layer)

These commands attach a selected mipmap level or image of a texture object as one of the logical buffers of the specified framebuffer object. Textures cannot be attached to the default draw and read framebuffer, so they are not valid targets of these commands.

frontFace(Mode)

In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call gl:enable/1 and gl:disable/1 with argument ?GL_CULL_FACE.

frustum(Left, Right, Bottom, Top, Near_val, Far_val)

gl:frustum/6 describes a perspective matrix that produces a perspective projection. The current matrix (see gl:matrixMode/1) is multiplied by this matrix and the result replaces the current matrix, as if gl:multMatrix() were called with the following matrix as its argument

genBuffers(N)

gl:genBuffers/1 returns N buffer object names in Buffers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genBuffers/1.

generateMipmap(Target)

Equivalent to generateTextureMipmap/1.

generateTextureMipmap(Texture)

gl:generateMipmap/1 and gl:generateTextureMipmap/1 generates mipmaps for the specified texture object. For gl:generateMipmap/1, the texture object that is bound to Target. For gl:generateTextureMipmap/1, Texture is the name of the texture object.

genFramebuffers(N)

gl:genFramebuffers/1 returns N framebuffer object names in Ids. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genFramebuffers/1.

genLists(Range)

gl:genLists/1 has one argument, Range. It returns an integer n such that Range contiguous empty display lists, named n, n+1, ..., n+range-1, are created. If Range is 0, if there is no group of Range contiguous names available, or if any error is generated, no display lists are generated, and 0 is returned.

genProgramPipelines(N)

gl:genProgramPipelines/1 returns N previously unused program pipeline object names in Pipelines. These names are marked as used, for the purposes of gl:genProgramPipelines/1 only, but they acquire program pipeline state only when they are first bound.

genQueries(N)

gl:genQueries/1 returns N query object names in Ids. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genQueries/1.

genRenderbuffers(N)

gl:genRenderbuffers/1 returns N renderbuffer object names in Renderbuffers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genRenderbuffers/1.

genSamplers(Count)

gl:genSamplers/1 returns N sampler object names in Samplers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genSamplers/1.

genTextures(N)

gl:genTextures/1 returns N texture names in Textures. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genTextures/1.

genTransformFeedbacks(N)

gl:genTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids. These names are marked as used, for the purposes of gl:genTransformFeedbacks/1 only, but they acquire transform feedback state only when they are first bound.

genVertexArrays(N)

gl:genVertexArrays/1 returns N vertex array object names in Arrays. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genVertexArrays/1.

getActiveAttrib(Program, Index, BufSize)

gl:getActiveAttrib/3 returns information about an active attribute variable in the program object specified by Program. The number of active attributes can be obtained by calling gl:getProgram() with the value ?GL_ACTIVE_ATTRIBUTES. A value of 0 for Index selects the first active attribute variable. Permissible values for Index range from zero to the number of active attribute variables minus one.

getActiveSubroutineName(Program, Shadertype, Index, Bufsize)

gl:getActiveSubroutineName/4 queries the name of an active shader subroutine uniform from the program object given in Program. Index specifies the index of the shader subroutine uniform within the shader stage given by Stage, and must between zero and the value of ?GL_ACTIVE_SUBROUTINES minus one for the shader stage.

getActiveSubroutineUniformName(Program, Shadertype, Index, Bufsize)

gl:getActiveSubroutineUniformName/4 retrieves the name of an active shader subroutine uniform. Program contains the name of the program containing the uniform. Shadertype specifies the stage for which the uniform location, given by Index, is valid. Index must be between zero and the value of ?GL_ACTIVE_SUBROUTINE_UNIFORMS minus one for the shader stage.

getActiveUniform(Program, Index, BufSize)

gl:getActiveUniform/3 returns information about an active uniform variable in the program object specified by Program. The number of active uniform variables can be obtained by calling gl:getProgram() with the value ?GL_ACTIVE_UNIFORMS. A value of 0 for Index selects the first active uniform variable. Permissible values for Index range from zero to the number of active uniform variables minus one.

getActiveUniformBlockiv(Program, UniformBlockIndex, Pname, Params)

gl:getActiveUniformBlockiv/4 retrieves information about an active uniform block within Program.

getActiveUniformBlockName(Program, UniformBlockIndex, BufSize)

gl:getActiveUniformBlockName/3 retrieves the name of the active uniform block at UniformBlockIndex within Program.

getActiveUniformName(Program, UniformIndex, BufSize)

gl:getActiveUniformName/3 returns the name of the active uniform at UniformIndex within Program. If UniformName is not NULL, up to BufSize characters (including a nul-terminator) will be written into the array whose address is specified by UniformName. If Length is not NULL, the number of characters that were (or would have been) written into UniformName (not including the nul-terminator) will be placed in the variable whose address is specified in Length. If Length is NULL, no length is returned. The length of the longest uniform name in Program is given by the value of ?GL_ACTIVE_UNIFORM_MAX_LENGTH, which can be queried with gl:getProgram().

getActiveUniformsiv(Program, UniformIndices, Pname)

gl:getActiveUniformsiv/3 queries the value of the parameter named Pname for each of the uniforms within Program whose indices are specified in the array of UniformCount unsigned integers UniformIndices. Upon success, the value of the parameter for each uniform is written into the corresponding entry in the array whose address is given in Params. If an error is generated, nothing is written into Params.

getAttachedShaders(Program, MaxCount)

gl:getAttachedShaders/2 returns the names of the shader objects attached to Program. The names of shader objects that are attached to Program will be returned in Shaders. The actual number of shader names written into Shaders is returned in Count. If no shader objects are attached to Program, Count is set to 0. The maximum number of shader names that may be returned in Shaders is specified by MaxCount.

getAttribLocation(Program, Name)

gl:getAttribLocation/2 queries the previously linked program object specified by Program for the attribute variable specified by Name and returns the index of the generic vertex attribute that is bound to that attribute variable. If Name is a matrix attribute variable, the index of the first column of the matrix is returned. If the named attribute variable is not an active attribute in the specified program object or if Name starts with the reserved prefix "gl_", a value of -1 is returned.

getBooleani_v(Target, Index)

Equivalent to getIntegerv/1.

getBooleanv(Pname)

Equivalent to getIntegerv/1.

getBufferParameteri64v(Target, Pname)

Equivalent to getBufferParameterivARB/2.

getBufferParameteriv(Target, Pname)

gl:getBufferParameteriv/2 returns in Data a selected parameter of the buffer object specified by Target.

getBufferParameterivARB(Target, Pname)

These functions return in Data a selected parameter of the specified buffer object.

getBufferSubData(Target, Offset, Size, Data)

gl:getBufferSubData/4 and glGetNamedBufferSubData return some or all of the data contents of the data store of the specified buffer object. Data starting at byte offset Offset and extending for Size bytes is copied from the buffer object's data store to the memory pointed to by Data. An error is thrown if the buffer object is currently mapped, or if Offset and Size together define a range beyond the bounds of the buffer object's data store.

getClipPlane(Plane)

gl:getClipPlane/1 returns in Equation the four coefficients of the plane equation for Plane.

getColorTable(Target, Format, Type, Table)

gl:getColorTable/4 returns in Table the contents of the color table specified by Target. No pixel transfer operations are performed, but pixel storage modes that are applicable to gl:readPixels/7 are performed.

getColorTableParameterfv(Target, Pname)

Equivalent to getColorTableParameteriv/2.

getColorTableParameteriv(Target, Pname)

Returns parameters specific to color table Target.

getCompressedTexImage(Target, Lod, Img)

gl:getCompressedTexImage/3 and glGetnCompressedTexImage return the compressed texture image associated with Target and Lod into Pixels. glGetCompressedTextureImage serves the same purpose, but instead of taking a texture target, it takes the ID of the texture object. Pixels should be an array of BufSize bytes for glGetnCompresedTexImage and glGetCompressedTextureImage functions, and of ?GL_TEXTURE_COMPRESSED_IMAGE_SIZE bytes in case of gl:getCompressedTexImage/3. If the actual data takes less space than BufSize, the remaining bytes will not be touched. Target specifies the texture target, to which the texture the data the function should extract the data from is bound to. Lod specifies the level-of-detail number of the desired image.

getConvolutionFilter(Target, Format, Type, Image)

gl:getConvolutionFilter/4 returns the current 1D or 2D convolution filter kernel as an image. The one- or two-dimensional image is placed in Image according to the specifications in Format and Type. No pixel transfer operations are performed on this image, but the relevant pixel storage modes are applied.

getConvolutionParameterfv(Target, Pname)

Equivalent to getConvolutionParameteriv/2.

getConvolutionParameteriv(Target, Pname)

gl:getConvolutionParameter() retrieves convolution parameters. Target determines which convolution filter is queried. Pname determines which parameter is returned

getDebugMessageLog(Count, BufSize)

gl:getDebugMessageLog/2 retrieves messages from the debug message log. A maximum of Count messages are retrieved from the log. If Sources is not NULL then the source of each message is written into up to Count elements of the array. If Types is not NULL then the type of each message is written into up to Count elements of the array. If Id is not NULL then the identifier of each message is written into up to Count elements of the array. If Severities is not NULL then the severity of each message is written into up to Count elements of the array. If Lengths is not NULL then the length of each message is written into up to Count elements of the array.

getDoublei_v(Target, Index)

Equivalent to getIntegerv/1.

getDoublev(Pname)

Equivalent to getIntegerv/1.

getError()

gl:getError/0 returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until gl:getError/0 is called, the error code is returned, and the flag is reset to ?GL_NO_ERROR. If a call to gl:getError/0 returns ?GL_NO_ERROR, there has been no detectable error since the last call to gl:getError/0, or since the GL was initialized.

getFloati_v(Target, Index)

Equivalent to getIntegerv/1.

getFloatv(Pname)

Equivalent to getIntegerv/1.

getFragDataIndex(Program, Name)

gl:getFragDataIndex/2 returns the index of the fragment color to which the variable Name was bound when the program object Program was last linked. If Name is not a varying out variable of Program, or if an error occurs, -1 will be returned.

getFragDataLocation(Program, Name)

gl:getFragDataLocation/2 retrieves the assigned color number binding for the user-defined varying out variable Name for program Program. Program must have previously been linked. Name must be a null-terminated string. If Name is not the name of an active user-defined varying out fragment shader variable within Program, -1 will be returned.

getFramebufferAttachmentParameteriv(Target, Attachment, Pname)

gl:getFramebufferAttachmentParameteriv/3 and glGetNamedFramebufferAttachmentParameteriv return parameters of attachments of a specified framebuffer object.

getFramebufferParameteriv(Target, Pname)

gl:getFramebufferParameteriv/2 and glGetNamedFramebufferParameteriv query parameters of a specified framebuffer object.

getGraphicsResetStatus()

Certain events can result in a reset of the GL context. Such a reset causes all context state to be lost and requires the application to recreate all objects in the affected context.

getHistogram(Target, Reset, Format, Type, Values)

gl:getHistogram/5 returns the current histogram table as a one-dimensional image with the same width as the histogram. No pixel transfer operations are performed on this image, but pixel storage modes that are applicable to 1D images are honored.

getHistogramParameterfv(Target, Pname)

Equivalent to getHistogramParameteriv/2.

getHistogramParameteriv(Target, Pname)

gl:getHistogramParameter() is used to query parameter values for the current histogram or for a proxy. The histogram state information may be queried by calling gl:getHistogramParameter() with a Target of ?GL_HISTOGRAM (to obtain information for the current histogram table) or ?GL_PROXY_HISTOGRAM (to obtain information from the most recent proxy request) and one of the following values for the Pname argument

getInteger64i_v(Target, Index)

Equivalent to getIntegerv/1.

getInteger64v(Pname)

Equivalent to getIntegerv/1.

getIntegeri_v(Target, Index)

Equivalent to getIntegerv/1.

getIntegerv(Pname)

These commands return values for simple state variables in GL. Pname is a symbolic constant indicating the state variable to be returned, and Data is a pointer to an array of the indicated type in which to place the returned data.

getInternalformati64v(Target, Internalformat, Pname, BufSize)

Equivalent to getInternalformativ/4.

getInternalformativ(Target, Internalformat, Pname, BufSize)

No documentation available.

getLightfv(Light, Pname)

Equivalent to getLightiv/2.

getLightiv(Light, Pname)

gl:getLight() returns in Params the value or values of a light source parameter. Light names the light and is a symbolic name of the form ?GL_LIGHT i where i ranges from 0 to the value of ?GL_MAX_LIGHTS - 1. ?GL_MAX_LIGHTS is an implementation dependent constant that is greater than or equal to eight. Pname specifies one of ten light source parameters, again by symbolic name.

getMapdv(Target, Query, V)

Equivalent to getMapiv/3.

getMapfv(Target, Query, V)

Equivalent to getMapiv/3.

getMapiv(Target, Query, V)

glMap1 and glMap2 define evaluators. gl:getMap() returns evaluator parameters. Target chooses a map, Query selects a specific parameter, and V points to storage where the values will be returned.

getMaterialfv(Face, Pname)

Equivalent to getMaterialiv/2.

getMaterialiv(Face, Pname)

gl:getMaterial() returns in Params the value or values of parameter Pname of material Face. Six parameters are defined

getMinmax(Target, Reset, Format, Types, Values)

gl:getMinmax/5 returns the accumulated minimum and maximum pixel values (computed on a per-component basis) in a one-dimensional image of width 2. The first set of return values are the minima, and the second set of return values are the maxima. The format of the return values is determined by Format, and their type is determined by Types.

getMinmaxParameterfv(Target, Pname)

Equivalent to getMinmaxParameteriv/2.

getMinmaxParameteriv(Target, Pname)

gl:getMinmaxParameter() retrieves parameters for the current minmax table by setting Pname to one of the following values

getMultisamplefv(Pname, Index)

gl:getMultisamplefv/2 queries the location of a given sample. Pname specifies the sample parameter to retrieve and must be ?GL_SAMPLE_POSITION. Index corresponds to the sample for which the location should be returned. The sample location is returned as two floating-point values in Val[0] and Val[1], each between 0 and 1, corresponding to the X and Y locations respectively in the GL pixel space of that sample. (0.5, 0.5) this corresponds to the pixel center. Index must be between zero and the value of ?GL_SAMPLES minus one.

getPixelMapfv(Map, Values)

Equivalent to getPixelMapusv/2.

getPixelMapuiv(Map, Values)

Equivalent to getPixelMapusv/2.

getPixelMapusv(Map, Values)

See the gl:pixelMap() reference page for a description of the acceptable values for the Map parameter. gl:getPixelMap() returns in Data the contents of the pixel map specified in Map. Pixel maps are used during the execution of gl:readPixels/7, gl:drawPixels/5, gl:copyPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9. to map color indices, stencil indices, color components, and depth components to other values.

getPolygonStipple()

gl:getPolygonStipple/0 returns to Pattern a 32×32 polygon stipple pattern. The pattern is packed into memory as if gl:readPixels/7 with both height and width of 32, type of ?GL_BITMAP, and format of ?GL_COLOR_INDEX were called, and the stipple pattern were stored in an internal 32×32 color index buffer. Unlike gl:readPixels/7, however, pixel transfer operations (shift, offset, pixel map) are not applied to the returned stipple image.

getProgramBinary(Program, BufSize)

gl:getProgramBinary/2 returns a binary representation of the compiled and linked executable for Program into the array of bytes whose address is specified in Binary. The maximum number of bytes that may be written into Binary is specified by BufSize. If the program binary is greater in size than BufSize bytes, then an error is generated, otherwise the actual number of bytes written into Binary is returned in the variable whose address is given by Length. If Length is ?NULL, then no length is returned.

getProgramInfoLog(Program, BufSize)

gl:getProgramInfoLog/2 returns the information log for the specified program object. The information log for a program object is modified when the program object is linked or validated. The string that is returned will be null terminated.

getProgramInterfaceiv(Program, ProgramInterface, Pname)

gl:getProgramInterfaceiv/3 queries the property of the interface identifed by ProgramInterface in Program, the property name of which is given by Pname.

getProgramiv(Program, Pname)

gl:getProgram() returns in Params the value of a parameter for a specific program object. The following parameters are defined

getProgramPipelineInfoLog(Pipeline, BufSize)

gl:getProgramPipelineInfoLog/2 retrieves the info log for the program pipeline object Pipeline. The info log, including its null terminator, is written into the array of characters whose address is given by InfoLog. The maximum number of characters that may be written into InfoLog is given by BufSize, and the actual number of characters written into InfoLog is returned in the integer whose address is given by Length. If Length is ?NULL, no length is returned.

getProgramPipelineiv(Pipeline, Pname)

gl:getProgramPipelineiv/2 retrieves the value of a property of the program pipeline object Pipeline. Pname specifies the name of the parameter whose value to retrieve. The value of the parameter is written to the variable whose address is given by Params.

getProgramResourceIndex(Program, ProgramInterface, Name)

gl:getProgramResourceIndex/3 returns the unsigned integer index assigned to a resource named Name in the interface type ProgramInterface of program object Program.

getProgramResourceLocation(Program, ProgramInterface, Name)

gl:getProgramResourceLocation/3 returns the location assigned to the variable named Name in interface ProgramInterface of program object Program. Program must be the name of a program that has been linked successfully. ProgramInterface must be one of ?GL_UNIFORM, ?GL_PROGRAM_INPUT, ?GL_PROGRAM_OUTPUT, ?GL_VERTEX_SUBROUTINE_UNIFORM, ?GL_TESS_CONTROL_SUBROUTINE_UNIFORM, ?GL_TESS_EVALUATION_SUBROUTINE_UNIFORM, ?GL_GEOMETRY_SUBROUTINE_UNIFORM, ?GL_FRAGMENT_SUBROUTINE_UNIFORM, ?GL_COMPUTE_SUBROUTINE_UNIFORM, or ?GL_TRANSFORM_FEEDBACK_BUFFER.

getProgramResourceLocationIndex(Program, ProgramInterface, Name)

gl:getProgramResourceLocationIndex/3 returns the fragment color index assigned to the variable named Name in interface ProgramInterface of program object Program. Program must be the name of a program that has been linked successfully. ProgramInterface must be ?GL_PROGRAM_OUTPUT.

getProgramResourceName(Program, ProgramInterface, Index, BufSize)

gl:getProgramResourceName/4 retrieves the name string assigned to the single active resource with an index of Index in the interface ProgramInterface of program object Program. Index must be less than the number of entries in the active resource list for ProgramInterface.

getProgramStageiv(Program, Shadertype, Pname)

gl:getProgramStage() queries a parameter of a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query the parameter. Pname specifies which parameter should be queried. The value or values of the parameter to be queried is returned in the variable whose address is given in Values.

getQueryBufferObjecti64v(Id, Buffer, Pname, Offset)

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectiv(Id, Buffer, Pname, Offset)

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectui64v(Id, Buffer, Pname, Offset)

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectuiv(Id, Buffer, Pname, Offset)

Equivalent to getQueryObjectuiv/2.

getQueryIndexediv(Target, Index, Pname)

gl:getQueryIndexediv/3 returns in Params a selected parameter of the indexed query object target specified by Target and Index. Index specifies the index of the query object target and must be between zero and a target-specific maxiumum.

getQueryiv(Target, Pname)

gl:getQueryiv/2 returns in Params a selected parameter of the query object target specified by Target.

getQueryObjecti64v(Id, Pname)

Equivalent to getQueryObjectuiv/2.

getQueryObjectiv(Id, Pname)

Equivalent to getQueryObjectuiv/2.

getQueryObjectui64v(Id, Pname)

Equivalent to getQueryObjectuiv/2.

getQueryObjectuiv(Id, Pname)

These commands return a selected parameter of the query object specified by Id. gl:getQueryObject() returns in Params a selected parameter of the query object specified by Id. gl:getQueryBufferObject() returns in Buffer a selected parameter of the query object specified by Id, by writing it to Buffer's data store at the byte offset specified by Offset.

getRenderbufferParameteriv(Target, Pname)

gl:getRenderbufferParameteriv/2 and glGetNamedRenderbufferParameteriv query parameters of a specified renderbuffer object.

getSamplerParameterfv(Sampler, Pname)

Equivalent to getSamplerParameteriv/2.

getSamplerParameterIiv(Sampler, Pname)

Equivalent to getSamplerParameteriv/2.

getSamplerParameterIuiv(Sampler, Pname)

Equivalent to getSamplerParameteriv/2.

getSamplerParameteriv(Sampler, Pname)

gl:getSamplerParameter() returns in Params the value or values of the sampler parameter specified as Pname. Sampler defines the target sampler, and must be the name of an existing sampler object, returned from a previous call to gl:genSamplers/1. Pname accepts the same symbols as gl:samplerParameter(), with the same interpretations

getShaderInfoLog(Shader, BufSize)

gl:getShaderInfoLog/2 returns the information log for the specified shader object. The information log for a shader object is modified when the shader is compiled. The string that is returned will be null terminated.

getShaderiv(Shader, Pname)

gl:getShader() returns in Params the value of a parameter for a specific shader object. The following parameters are defined

getShaderPrecisionFormat(Shadertype, Precisiontype)

gl:getShaderPrecisionFormat/2 retrieves the numeric range and precision for the implementation's representation of quantities in different numeric formats in specified shader type. ShaderType specifies the type of shader for which the numeric precision and range is to be retrieved and must be one of ?GL_VERTEX_SHADER or ?GL_FRAGMENT_SHADER. PrecisionType specifies the numeric format to query and must be one of ?GL_LOW_FLOAT, ?GL_MEDIUM_FLOAT``?GL_HIGH_FLOAT, ?GL_LOW_INT, ?GL_MEDIUM_INT, or ?GL_HIGH_INT.

getShaderSource(Shader, BufSize)

gl:getShaderSource/2 returns the concatenation of the source code strings from the shader object specified by Shader. The source code strings for a shader object are the result of a previous call to gl:shaderSource/2. The string returned by the function will be null terminated.

getString(Name)

Equivalent to getStringi/2.

getStringi(Name, Index)

gl:getString/1 returns a pointer to a static string describing some aspect of the current GL connection. Name can be one of the following

getSubroutineIndex(Program, Shadertype, Name)

gl:getSubroutineIndex/3 returns the index of a subroutine uniform within a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query shader subroutine index. Name contains the null-terminated name of the subroutine uniform whose name to query.

getSubroutineUniformLocation(Program, Shadertype, Name)

gl:getSubroutineUniformLocation/3 returns the location of the subroutine uniform variable Name in the shader stage of type Shadertype attached to Program, with behavior otherwise identical to gl:getUniformLocation/2.

getSynciv(Sync, Pname, BufSize)

gl:getSynciv/3 retrieves properties of a sync object. Sync specifies the name of the sync object whose properties to retrieve.

getTexEnvfv(Target, Pname)

Equivalent to getTexEnviv/2.

getTexEnviv(Target, Pname)

gl:getTexEnv() returns in Params selected values of a texture environment that was specified with gl:texEnv(). Target specifies a texture environment.

getTexGendv(Coord, Pname)

Equivalent to getTexGeniv/2.

getTexGenfv(Coord, Pname)

Equivalent to getTexGeniv/2.

getTexGeniv(Coord, Pname)

gl:getTexGen() returns in Params selected parameters of a texture coordinate generation function that was specified using gl:texGen(). Coord names one of the (s, t, r, q) texture coordinates, using the symbolic constant ?GL_S, ?GL_T, ?GL_R, or ?GL_Q.

getTexImage(Target, Level, Format, Type, Pixels)

gl:getTexImage/5, glGetnTexImage and glGetTextureImage functions return a texture image into Pixels. For gl:getTexImage/5 and glGetnTexImage, Target specifies whether the desired texture image is one specified by gl:texImage1D/8 (?GL_TEXTURE_1D), gl:texImage2D/9 (?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_2D or any of ?GL_TEXTURE_CUBE_MAP_*), or gl:texImage3D/10 (?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP_ARRAY). For glGetTextureImage, Texture specifies the texture object name. In addition to types of textures accepted by gl:getTexImage/5 and glGetnTexImage, the function also accepts cube map texture objects (with effective target ?GL_TEXTURE_CUBE_MAP). Level specifies the level-of-detail number of the desired image. Format and Type specify the format and type of the desired image array. See the reference page for gl:texImage1D/8 for a description of the acceptable values for the Format and Type parameters, respectively. For glGetnTexImage and glGetTextureImage functions, bufSize tells the size of the buffer to receive the retrieved pixel data. glGetnTexImage and glGetTextureImage do not write more than BufSize bytes into Pixels.

getTexLevelParameterfv(Target, Level, Pname)

Equivalent to getTexLevelParameteriv/3.

getTexLevelParameteriv(Target, Level, Pname)

gl:getTexLevelParameterfv/3, gl:getTexLevelParameteriv/3, glGetTextureLevelParameterfv and glGetTextureLevelParameteriv return in Params texture parameter values for a specific level-of-detail value, specified as Level. For the first two functions, Target defines the target texture, either ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_PROXY_TEXTURE_1D, ?GL_PROXY_TEXTURE_2D, ?GL_PROXY_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP_POSITIVE_X, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or ?GL_PROXY_TEXTURE_CUBE_MAP. The remaining two take a Texture argument which specifies the name of the texture object.

getTexParameterfv(Target, Pname)

Equivalent to getTexParameteriv/2.

getTexParameterIiv(Target, Pname)

Equivalent to getTexParameteriv/2.

getTexParameterIuiv(Target, Pname)

Equivalent to getTexParameteriv/2.

getTexParameteriv(Target, Pname)

gl:getTexParameter() and glGetTextureParameter return in Params the value or values of the texture parameter specified as Pname. Target defines the target texture. ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, ?GL_TEXTURE_2D_MULTISAMPLE, or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY specify one-, two-, or three-dimensional, one-dimensional array, two-dimensional array, rectangle, cube-mapped or cube-mapped array, two-dimensional multisample, or two-dimensional multisample array texturing, respectively. Pname accepts the same symbols as gl:texParameter(), with the same interpretations

getTransformFeedbackVarying(Program, Index, BufSize)

Information about the set of varying variables in a linked program that will be captured during transform feedback may be retrieved by calling gl:getTransformFeedbackVarying/3. gl:getTransformFeedbackVarying/3 provides information about the varying variable selected by Index. An Index of 0 selects the first varying variable specified in the Varyings array passed to gl:transformFeedbackVaryings/3, and an Index of the value of ?GL_TRANSFORM_FEEDBACK_VARYINGS minus one selects the last such variable.

getUniformBlockIndex(Program, UniformBlockName)

gl:getUniformBlockIndex/2 retrieves the index of a uniform block within Program.

getUniformdv(Program, Location)

Equivalent to getUniformuiv/2.

getUniformfv(Program, Location)

Equivalent to getUniformuiv/2.

getUniformIndices(Program, UniformNames)

gl:getUniformIndices/2 retrieves the indices of a number of uniforms within Program.

getUniformiv(Program, Location)

Equivalent to getUniformuiv/2.

getUniformLocation(Program, Name)

glGetUniformLocationreturns an integer that represents the location of a specific uniform variable within a program object. Name must be a null terminated string that contains no white space. Name must be an active uniform variable name in Program that is not a structure, an array of structures, or a subcomponent of a vector or a matrix. This function returns -1 if Name does not correspond to an active uniform variable in Program, if Name starts with the reserved prefix "gl_", or if Name is associated with an atomic counter or a named uniform block.

getUniformSubroutineuiv(Shadertype, Location)

gl:getUniformSubroutine() retrieves the value of the subroutine uniform at location Location for shader stage Shadertype of the current program. Location must be less than the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the shader currently in use at shader stage Shadertype. The value of the subroutine uniform is returned in Values.

getUniformuiv(Program, Location)

gl:getUniform() and glGetnUniform return in Params the value(s) of the specified uniform variable. The type of the uniform variable specified by Location determines the number of values returned. If the uniform variable is defined in the shader as a boolean, int, or float, a single value will be returned. If it is defined as a vec2, ivec2, or bvec2, two values will be returned. If it is defined as a vec3, ivec3, or bvec3, three values will be returned, and so on. To query values stored in uniform variables declared as arrays, call gl:getUniform() for each element of the array. To query values stored in uniform variables declared as structures, call gl:getUniform() for each field in the structure. The values for uniform variables declared as a matrix will be returned in column major order.

getVertexAttribdv(Index, Pname)

Equivalent to getVertexAttribiv/2.

getVertexAttribfv(Index, Pname)

Equivalent to getVertexAttribiv/2.

getVertexAttribIiv(Index, Pname)

Equivalent to getVertexAttribiv/2.

getVertexAttribIuiv(Index, Pname)

Equivalent to getVertexAttribiv/2.

getVertexAttribiv(Index, Pname)

gl:getVertexAttrib() returns in Params the value of a generic vertex attribute parameter. The generic vertex attribute to be queried is specified by Index, and the parameter to be queried is specified by Pname.

getVertexAttribLdv(Index, Pname)

Equivalent to getVertexAttribiv/2.

hint(Target, Mode)

Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. Target is a symbolic constant indicating the behavior to be controlled, and Mode is another symbolic constant indicating the desired behavior. The initial value for each Target is ?GL_DONT_CARE. Mode can be one of the following

histogram(Target, Width, Internalformat, Sink)

When ?GL_HISTOGRAM is enabled, RGBA color components are converted to histogram table indices by clamping to the range [0,1], multiplying by the width of the histogram table, and rounding to the nearest integer. The table entries selected by the RGBA indices are then incremented. (If the internal format of the histogram table includes luminance, then the index derived from the R color component determines the luminance table entry to be incremented.) If a histogram table entry is incremented beyond its maximum value, then its value becomes undefined. (This is not an error.)

indexd(C)

Equivalent to indexubv/1.

indexdv/1

Equivalent to indexubv/1.

indexf(C)

Equivalent to indexubv/1.

indexfv/1

Equivalent to indexubv/1.

indexi(C)

Equivalent to indexubv/1.

indexiv/1

Equivalent to indexubv/1.

indexMask(Mask)

gl:indexMask/1 controls the writing of individual bits in the color index buffers. The least significant n bits of Mask, where n is the number of bits in a color index buffer, specify a mask. Where a 1 (one) appears in the mask, it's possible to write to the corresponding bit in the color index buffer (or buffers). Where a 0 (zero) appears, the corresponding bit is write-protected.

indexPointer(Type, Stride, Ptr)

gl:indexPointer/3 specifies the location and data format of an array of color indexes to use when rendering. Type specifies the data type of each color index and Stride specifies the byte stride from one color index to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

indexs(C)

Equivalent to indexubv/1.

indexsv/1

Equivalent to indexubv/1.

indexub(C)

Equivalent to indexubv/1.

indexubv/1

gl:index() updates the current (single-valued) color index. It takes one argument, the new value for the current color index.

initNames()

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. gl:initNames/0 causes the name stack to be initialized to its default empty state.

interleavedArrays(Format, Stride, Pointer)

gl:interleavedArrays/3 lets you specify and enable individual color, normal, texture and vertex arrays whose elements are part of a larger aggregate array element. For some implementations, this is more efficient than specifying the arrays separately.

invalidateBufferData(Buffer)

gl:invalidateBufferData/1 invalidates all of the content of the data store of a buffer object. After invalidation, the content of the buffer's data store becomes undefined.

invalidateBufferSubData(Buffer, Offset, Length)

gl:invalidateBufferSubData/3 invalidates all or part of the content of the data store of a buffer object. After invalidation, the content of the specified range of the buffer's data store becomes undefined. The start of the range is given by Offset and its size is given by Length, both measured in basic machine units.

invalidateFramebuffer(Target, Attachments)

gl:invalidateFramebuffer/2 and glInvalidateNamedFramebufferData invalidate the entire contents of a specified set of attachments of a framebuffer.

invalidateSubFramebuffer(Target, Attachments, X, Y, Width, Height)

gl:invalidateSubFramebuffer/6 and glInvalidateNamedFramebufferSubData invalidate the contents of a specified region of a specified set of attachments of a framebuffer.

invalidateTexImage(Texture, Level)

gl:invalidateTexSubImage/8 invalidates all of a texture image. Texture and Level indicated which texture image is being invalidated. After this command, data in the texture image has undefined values.

invalidateTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth)

gl:invalidateTexSubImage/8 invalidates all or part of a texture image. Texture and Level indicated which texture image is being invalidated. After this command, data in that subregion have undefined values. Xoffset, Yoffset, Zoffset, Width, Height, and Depth are interpreted as they are in gl:texSubImage3D/11. For texture targets that don't have certain dimensions, this command treats those dimensions as having a size of 1. For example, to invalidate a portion of a two- dimensional texture, the application would use Zoffset equal to zero and Depth equal to one. Cube map textures are treated as an array of six slices in the z-dimension, where a value of Zoffset is interpreted as specifying face ?GL_TEXTURE_CUBE_MAP_POSITIVE_X + Zoffset.

isBuffer(Buffer)

gl:isBuffer/1 returns ?GL_TRUE if Buffer is currently the name of a buffer object. If Buffer is zero, or is a non-zero value that is not currently the name of a buffer object, or if an error occurs, gl:isBuffer/1 returns ?GL_FALSE.

isEnabled(Cap)

Equivalent to isEnabledi/2.

isEnabledi(Target, Index)

gl:isEnabled/1 returns ?GL_TRUE if Cap is an enabled capability and returns ?GL_FALSE otherwise. Boolean states that are indexed may be tested with gl:isEnabledi/2. For gl:isEnabledi/2, Index specifies the index of the capability to test. Index must be between zero and the count of indexed capabilities for Cap. Initially all capabilities except ?GL_DITHER are disabled; ?GL_DITHER is initially enabled.

isFramebuffer(Framebuffer)

gl:isFramebuffer/1 returns ?GL_TRUE if Framebuffer is currently the name of a framebuffer object. If Framebuffer is zero, or if ?framebuffer is not the name of a framebuffer object, or if an error occurs, gl:isFramebuffer/1 returns ?GL_FALSE. If Framebuffer is a name returned by gl:genFramebuffers/1, by that has not yet been bound through a call to gl:bindFramebuffer/2, then the name is not a framebuffer object and gl:isFramebuffer/1 returns ?GL_FALSE.

isList(List)

gl:isList/1 returns ?GL_TRUE if List is the name of a display list and returns ?GL_FALSE if it is not, or if an error occurs.

isProgram(Program)

gl:isProgram/1 returns ?GL_TRUE if Program is the name of a program object previously created with gl:createProgram/0 and not yet deleted with gl:deleteProgram/1. If Program is zero or a non-zero value that is not the name of a program object, or if an error occurs, gl:isProgram/1 returns ?GL_FALSE.

isProgramPipeline(Pipeline)

gl:isProgramPipeline/1 returns ?GL_TRUE if Pipeline is currently the name of a program pipeline object. If Pipeline is zero, or if ?pipeline is not the name of a program pipeline object, or if an error occurs, gl:isProgramPipeline/1 returns ?GL_FALSE. If Pipeline is a name returned by gl:genProgramPipelines/1, but that has not yet been bound through a call to gl:bindProgramPipeline/1, then the name is not a program pipeline object and gl:isProgramPipeline/1 returns ?GL_FALSE.

isQuery(Id)

gl:isQuery/1 returns ?GL_TRUE if Id is currently the name of a query object. If Id is zero, or is a non-zero value that is not currently the name of a query object, or if an error occurs, gl:isQuery/1 returns ?GL_FALSE.

isRenderbuffer(Renderbuffer)

gl:isRenderbuffer/1 returns ?GL_TRUE if Renderbuffer is currently the name of a renderbuffer object. If Renderbuffer is zero, or if Renderbuffer is not the name of a renderbuffer object, or if an error occurs, gl:isRenderbuffer/1 returns ?GL_FALSE. If Renderbuffer is a name returned by gl:genRenderbuffers/1, by that has not yet been bound through a call to gl:bindRenderbuffer/2 or gl:framebufferRenderbuffer/4, then the name is not a renderbuffer object and gl:isRenderbuffer/1 returns ?GL_FALSE.

isSampler(Sampler)

gl:isSampler/1 returns ?GL_TRUE if Id is currently the name of a sampler object. If Id is zero, or is a non-zero value that is not currently the name of a sampler object, or if an error occurs, gl:isSampler/1 returns ?GL_FALSE.

isShader(Shader)

gl:isShader/1 returns ?GL_TRUE if Shader is the name of a shader object previously created with gl:createShader/1 and not yet deleted with gl:deleteShader/1. If Shader is zero or a non-zero value that is not the name of a shader object, or if an error occurs, glIsShaderreturns ?GL_FALSE.

isSync(Sync)

gl:isSync/1 returns ?GL_TRUE if Sync is currently the name of a sync object. If Sync is not the name of a sync object, or if an error occurs, gl:isSync/1 returns ?GL_FALSE. Note that zero is not the name of a sync object.

isTexture(Texture)

gl:isTexture/1 returns ?GL_TRUE if Texture is currently the name of a texture. If Texture is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, gl:isTexture/1 returns ?GL_FALSE.

isTransformFeedback(Id)

gl:isTransformFeedback/1 returns ?GL_TRUE if Id is currently the name of a transform feedback object. If Id is zero, or if ?id is not the name of a transform feedback object, or if an error occurs, gl:isTransformFeedback/1 returns ?GL_FALSE. If Id is a name returned by gl:genTransformFeedbacks/1, but that has not yet been bound through a call to gl:bindTransformFeedback/2, then the name is not a transform feedback object and gl:isTransformFeedback/1 returns ?GL_FALSE.

isVertexArray(Array)

gl:isVertexArray/1 returns ?GL_TRUE if Array is currently the name of a vertex array object. If Array is zero, or if Array is not the name of a vertex array object, or if an error occurs, gl:isVertexArray/1 returns ?GL_FALSE. If Array is a name returned by gl:genVertexArrays/1, by that has not yet been bound through a call to gl:bindVertexArray/1, then the name is not a vertex array object and gl:isVertexArray/1 returns ?GL_FALSE.

lightf(Light, Pname, Param)

Equivalent to lightiv/3.

lightfv(Light, Pname, Params)

Equivalent to lightiv/3.

lighti(Light, Pname, Param)

Equivalent to lightiv/3.

lightiv(Light, Pname, Params)

gl:light() sets the values of individual light source parameters. Light names the light and is a symbolic name of the form ?GL_LIGHT i, where i ranges from 0 to the value of ?GL_MAX_LIGHTS - 1. Pname specifies one of ten light source parameters, again by symbolic name. Params is either a single value or a pointer to an array that contains the new values.

lightModelf(Pname, Param)

Equivalent to lightModeliv/2.

lightModelfv(Pname, Params)

Equivalent to lightModeliv/2.

lightModeli(Pname, Param)

Equivalent to lightModeliv/2.

lightModeliv(Pname, Params)

gl:lightModel() sets the lighting model parameter. Pname names a parameter and Params gives the new value. There are three lighting model parameters

lineStipple(Factor, Pattern)

Line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is achieved by using three parameters: the 16-bit line stipple pattern Pattern, the repeat count Factor, and an integer stipple counter s.

lineWidth(Width)

gl:lineWidth/1 specifies the rasterized width of both aliased and antialiased lines. Using a line width other than 1 has different effects, depending on whether line antialiasing is enabled. To enable and disable line antialiasing, call gl:enable/1 and gl:disable/1 with argument ?GL_LINE_SMOOTH. Line antialiasing is initially disabled.

linkProgram(Program)

gl:linkProgram/1 links the program object specified by Program. If any shader objects of type ?GL_VERTEX_SHADER are attached to Program, they will be used to create an executable that will run on the programmable vertex processor. If any shader objects of type ?GL_GEOMETRY_SHADER are attached to Program, they will be used to create an executable that will run on the programmable geometry processor. If any shader objects of type ?GL_FRAGMENT_SHADER are attached to Program, they will be used to create an executable that will run on the programmable fragment processor.

listBase(Base)

gl:callLists/1 specifies an array of offsets. Display-list names are generated by adding Base to each offset. Names that reference valid display lists are executed; the others are ignored.

loadIdentity()

gl:loadIdentity/0 replaces the current matrix with the identity matrix. It is semantically equivalent to calling gl:loadMatrix() with the identity matrix

loadMatrixd(M)

Equivalent to loadMatrixf/1.

loadMatrixf(M)

gl:loadMatrix() replaces the current matrix with the one whose elements are specified by M. The current matrix is the projection matrix, modelview matrix, or texture matrix, depending on the current matrix mode (see gl:matrixMode/1).

loadName(Name)

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers and is initially empty.

loadTransposeMatrixd(M)

Equivalent to loadTransposeMatrixf/1.

loadTransposeMatrixf(M)

gl:loadTransposeMatrix() replaces the current matrix with the one whose elements are specified by M. The current matrix is the projection matrix, modelview matrix, or texture matrix, depending on the current matrix mode (see gl:matrixMode/1).

logicOp(Opcode)

gl:logicOp/1 specifies a logical operation that, when enabled, is applied between the incoming RGBA color and the RGBA color at the corresponding location in the frame buffer. To enable or disable the logical operation, call gl:enable/1 and gl:disable/1 using the symbolic constant ?GL_COLOR_LOGIC_OP. The initial value is disabled.

map1d(Target, U1, U2, Stride, Order, Points)

Equivalent to map1f/6.

map1f(Target, U1, U2, Stride, Order, Points)

Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent to further stages of GL processing just as if they had been presented using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands, except that the generated values do not update the current normal, texture coordinates, or color.

map2d(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points)

Equivalent to map2f/10.

map2f(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points)

Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent on to further stages of GL processing just as if they had been presented using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands, except that the generated values do not update the current normal, texture coordinates, or color.

mapGrid1d(Un, U1, U2)

Equivalent to mapGrid2f/6.

mapGrid1f(Un, U1, U2)

Equivalent to mapGrid2f/6.

mapGrid2d(Un, U1, U2, Vn, V1, V2)

Equivalent to mapGrid2f/6.

mapGrid2f(Un, U1, U2, Vn, V1, V2)

gl:mapGrid() and gl:evalMesh() are used together to efficiently generate and evaluate a series of evenly-spaced map domain values. gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2.

materialf(Face, Pname, Param)

Equivalent to materialiv/3.

materialfv(Face, Pname, Params)

Equivalent to materialiv/3.

materiali(Face, Pname, Param)

Equivalent to materialiv/3.

materialiv(Face, Pname, Params)

gl:material() assigns values to material parameters. There are two matched sets of material parameters. One, the front-facing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled). The other set, back-facing, is used to shade back-facing polygons only when two-sided lighting is enabled. Refer to the gl:lightModel() reference page for details concerning one- and two-sided lighting calculations.

matrixMode(Mode)

gl:matrixMode/1 sets the current matrix mode. Mode can assume one of four values

memoryBarrier(Barriers)

Equivalent to memoryBarrierByRegion/1.

memoryBarrierByRegion(Barriers)

gl:memoryBarrier/1 defines a barrier ordering the memory transactions issued prior to the command relative to those issued after the barrier. For the purposes of this ordering, memory transactions performed by shaders are considered to be issued by the rendering command that triggered the execution of the shader. Barriers is a bitfield indicating the set of operations that are synchronized with shader stores; the bits used in Barriers are as follows

minmax(Target, Internalformat, Sink)

When ?GL_MINMAX is enabled, the RGBA components of incoming pixels are compared to the minimum and maximum values for each component, which are stored in the two-element minmax table. (The first element stores the minima, and the second element stores the maxima.) If a pixel component is greater than the corresponding component in the maximum element, then the maximum element is updated with the pixel component value. If a pixel component is less than the corresponding component in the minimum element, then the minimum element is updated with the pixel component value. (In both cases, if the internal format of the minmax table includes luminance, then the R color component of incoming pixels is used for comparison.) The contents of the minmax table may be retrieved at a later time by calling gl:getMinmax/5. The minmax operation is enabled or disabled by calling gl:enable/1 or gl:disable/1, respectively, with an argument of ?GL_MINMAX.

minSampleShading(Value)

gl:minSampleShading/1 specifies the rate at which samples are shaded within a covered pixel. Sample-rate shading is enabled by calling gl:enable/1 with the parameter ?GL_SAMPLE_SHADING. If ?GL_MULTISAMPLE or ?GL_SAMPLE_SHADING is disabled, sample shading has no effect. Otherwise, an implementation must provide at least as many unique color values for each covered fragment as specified by Value times Samples where Samples is the value of ?GL_SAMPLES for the current framebuffer. At least 1 sample for each covered fragment is generated.

multiDrawArrays(Mode, First, Count)

gl:multiDrawArrays/3 specifies multiple sets of geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to gl:multiDrawArrays/3.

multiDrawArraysIndirect(Mode, Indirect, Drawcount, Stride)

gl:multiDrawArraysIndirect/4 specifies multiple geometric primitives with very few subroutine calls. gl:multiDrawArraysIndirect/4 behaves similarly to a multitude of calls to gl:drawArraysInstancedBaseInstance/5, execept that the parameters to each call to gl:drawArraysInstancedBaseInstance/5 are stored in an array in memory at the address given by Indirect, separated by the stride, in basic machine units, specified by Stride. If Stride is zero, then the array is assumed to be tightly packed in memory.

multiDrawArraysIndirectCount(Mode, Indirect, Drawcount, Maxdrawcount, Stride)

No documentation available.

multiTexCoord1d(Target, S)

Equivalent to multiTexCoord4sv/2.

multiTexCoord1dv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord1f(Target, S)

Equivalent to multiTexCoord4sv/2.

multiTexCoord1fv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord1i(Target, S)

Equivalent to multiTexCoord4sv/2.

multiTexCoord1iv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord1s(Target, S)

Equivalent to multiTexCoord4sv/2.

multiTexCoord1sv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord2d(Target, S, T)

Equivalent to multiTexCoord4sv/2.

multiTexCoord2dv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord2f(Target, S, T)

Equivalent to multiTexCoord4sv/2.

multiTexCoord2fv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord2i(Target, S, T)

Equivalent to multiTexCoord4sv/2.

multiTexCoord2iv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord2s(Target, S, T)

Equivalent to multiTexCoord4sv/2.

multiTexCoord2sv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord3d(Target, S, T, R)

Equivalent to multiTexCoord4sv/2.

multiTexCoord3dv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord3f(Target, S, T, R)

Equivalent to multiTexCoord4sv/2.

multiTexCoord3fv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord3i(Target, S, T, R)

Equivalent to multiTexCoord4sv/2.

multiTexCoord3iv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord3s(Target, S, T, R)

Equivalent to multiTexCoord4sv/2.

multiTexCoord3sv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord4d(Target, S, T, R, Q)

Equivalent to multiTexCoord4sv/2.

multiTexCoord4dv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord4f(Target, S, T, R, Q)

Equivalent to multiTexCoord4sv/2.

multiTexCoord4fv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord4i(Target, S, T, R, Q)

Equivalent to multiTexCoord4sv/2.

multiTexCoord4iv/2

Equivalent to multiTexCoord4sv/2.

multiTexCoord4s(Target, S, T, R, Q)

Equivalent to multiTexCoord4sv/2.

multiTexCoord4sv/2

gl:multiTexCoord() specifies texture coordinates in one, two, three, or four dimensions. gl:multiTexCoord1() sets the current texture coordinates to (s 0 0 1); a call to gl:multiTexCoord2() sets them to (s t 0 1). Similarly, gl:multiTexCoord3() specifies the texture coordinates as (s t r 1), and gl:multiTexCoord4() defines all four components explicitly as (s t r q).

multMatrixd(M)

Equivalent to multMatrixf/1.

multMatrixf(M)

gl:multMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product.

multTransposeMatrixd(M)

Equivalent to multTransposeMatrixf/1.

multTransposeMatrixf(M)

gl:multTransposeMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product.

newList(List, Mode)

Display lists are groups of GL commands that have been stored for subsequent execution. Display lists are created with gl:newList/2. All subsequent commands are placed in the display list, in the order issued, until gl:endList/0 is called.

normal3b(Nx, Ny, Nz)

Equivalent to normal3sv/1.

normal3bv/1

Equivalent to normal3sv/1.

normal3d(Nx, Ny, Nz)

Equivalent to normal3sv/1.

normal3dv/1

Equivalent to normal3sv/1.

normal3f(Nx, Ny, Nz)

Equivalent to normal3sv/1.

normal3fv/1

Equivalent to normal3sv/1.

normal3i(Nx, Ny, Nz)

Equivalent to normal3sv/1.

normal3iv/1

Equivalent to normal3sv/1.

normal3s(Nx, Ny, Nz)

Equivalent to normal3sv/1.

normal3sv/1

The current normal is set to the given coordinates whenever gl:normal() is issued. Byte, short, or integer arguments are converted to floating-point format with a linear mapping that maps the most positive representable integer value to 1.0 and the most negative representable integer value to -1.0.

normalPointer(Type, Stride, Ptr)

gl:normalPointer/3 specifies the location and data format of an array of normals to use when rendering. Type specifies the data type of each normal coordinate, and Stride specifies the byte stride from one normal to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

objectPtrLabel(Ptr, Length, Label)

gl:objectPtrLabel/3 labels the sync object identified by Ptr.

ortho(Left, Right, Bottom, Top, Near_val, Far_val)

gl:ortho/6 describes a transformation that produces a parallel projection. The current matrix (see gl:matrixMode/1) is multiplied by this matrix and the result replaces the current matrix, as if gl:multMatrix() were called with the following matrix as its argument

passThrough(Token)

External documentation.

patchParameterfv(Pname, Values)

Equivalent to patchParameteri/2.

patchParameteri(Pname, Value)

gl:patchParameter() specifies the parameters that will be used for patch primitives. Pname specifies the parameter to modify and must be either ?GL_PATCH_VERTICES, ?GL_PATCH_DEFAULT_OUTER_LEVEL or ?GL_PATCH_DEFAULT_INNER_LEVEL. For gl:patchParameteri/2, Value specifies the new value for the parameter specified by Pname. For gl:patchParameterfv/2, Values specifies the address of an array containing the new values for the parameter specified by Pname.

pauseTransformFeedback()

gl:pauseTransformFeedback/0 pauses transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.

pixelMapfv(Map, Mapsize, Values)

Equivalent to pixelMapusv/3.

pixelMapuiv(Map, Mapsize, Values)

Equivalent to pixelMapusv/3.

pixelMapusv(Map, Mapsize, Values)

gl:pixelMap() sets up translation tables, or maps, used by gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8. Use of these maps is described completely in the gl:pixelTransfer() reference page, and partly in the reference pages for the pixel and texture image commands. Only the specification of the maps is described in this reference page.

pixelStoref(Pname, Param)

Equivalent to pixelStorei/2.

pixelStorei(Pname, Param)

gl:pixelStore() sets pixel storage modes that affect the operation of subsequent gl:readPixels/7 as well as the unpacking of texture patterns (see gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11), gl:compressedTexImage1D/7, gl:compressedTexImage2D/8, gl:compressedTexImage3D/9, gl:compressedTexSubImage1D/7, gl:compressedTexSubImage2D/9 or gl:compressedTexSubImage1D/7.

pixelTransferf(Pname, Param)

Equivalent to pixelTransferi/2.

pixelTransferi(Pname, Param)

gl:pixelTransfer() sets pixel transfer modes that affect the operation of subsequent gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11 commands. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8 are also affected. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (gl:copyPixels/5gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, and gl:readPixels/7), or unpacked from client memory (gl:drawPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11). Pixel transfer operations happen in the same order, and in the same manner, regardless of the command that resulted in the pixel operation. Pixel storage modes (see gl:pixelStore()) control the unpacking of pixels being read from client memory and the packing of pixels being written back into client memory.

pixelZoom(Xfactor, Yfactor)

gl:pixelZoom/2 specifies values for the x and y zoom factors. During the execution of gl:drawPixels/5 or gl:copyPixels/5, if ( xr, yr) is the current raster position, and a given element is in the mth row and nth column of the pixel rectangle, then pixels whose centers are in the rectangle with corners at

pointParameterf(Pname, Param)

Equivalent to pointParameteriv/2.

pointParameterfv(Pname, Params)

Equivalent to pointParameteriv/2.

pointParameteri(Pname, Param)

Equivalent to pointParameteriv/2.

pointParameteriv(Pname, Params)

The following values are accepted for Pname

pointSize(Size)

gl:pointSize/1 specifies the rasterized diameter of points. If point size mode is disabled (see gl:enable/1 with parameter ?GL_PROGRAM_POINT_SIZE), this value will be used to rasterize points. Otherwise, the value written to the shading language built-in variable gl_PointSize will be used.

polygonMode(Face, Mode)

gl:polygonMode/2 controls the interpretation of polygons for rasterization. Face describes which polygons Mode applies to: both front and back-facing polygons (?GL_FRONT_AND_BACK). The polygon mode affects only the final rasterization of polygons. In particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied.

polygonOffset(Factor, Units)

When ?GL_POLYGON_OFFSET_FILL, ?GL_POLYGON_OFFSET_LINE, or ?GL_POLYGON_OFFSET_POINT is enabled, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The value of the offset is factor×DZ+r×units, where DZ is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value that is guaranteed to produce a resolvable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer.

polygonOffsetClamp(Factor, Units, Clamp)

No documentation available.

polygonStipple(Mask)

Polygon stippling, like line stippling (see gl:lineStipple/2), masks out certain fragments produced by rasterization, creating a pattern. Stippling is independent of polygon antialiasing.

popAttrib()

Equivalent to pushAttrib/1.

popClientAttrib()

Equivalent to pushClientAttrib/1.

popDebugGroup()

Equivalent to pushDebugGroup/4.

popMatrix()

Equivalent to pushMatrix/0.

popName()

Equivalent to pushName/1.

primitiveRestartIndex(Index)

gl:primitiveRestartIndex/1 specifies a vertex array element that is treated specially when primitive restarting is enabled. This is known as the primitive restart index.

prioritizeTextures(Textures, Priorities)

gl:prioritizeTextures/2 assigns the N texture priorities given in Priorities to the N textures named in Textures.

programBinary(Program, BinaryFormat, Binary)

gl:programBinary/3 loads a program object with a program binary previously returned from gl:getProgramBinary/2. BinaryFormat and Binary must be those returned by a previous call to gl:getProgramBinary/2, and Length must be the length returned by gl:getProgramBinary/2, or by gl:getProgram() when called with Pname set to ?GL_PROGRAM_BINARY_LENGTH. If these conditions are not met, loading the program binary will fail and Program's ?GL_LINK_STATUS will be set to ?GL_FALSE.

programParameteri(Program, Pname, Value)

gl:programParameter() specifies a new value for the parameter nameed by Pname for the program object Program.

programUniform1d(Program, Location, V0)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1dv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1f(Program, Location, V0)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1fv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1i(Program, Location, V0)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1iv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1ui(Program, Location, V0)

Equivalent to programUniformMatrix4x3fv/4.

programUniform1uiv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2d(Program, Location, V0, V1)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2dv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2f(Program, Location, V0, V1)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2fv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2i(Program, Location, V0, V1)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2iv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2ui(Program, Location, V0, V1)

Equivalent to programUniformMatrix4x3fv/4.

programUniform2uiv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3d(Program, Location, V0, V1, V2)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3dv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3f(Program, Location, V0, V1, V2)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3fv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3i(Program, Location, V0, V1, V2)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3iv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3ui(Program, Location, V0, V1, V2)

Equivalent to programUniformMatrix4x3fv/4.

programUniform3uiv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4d(Program, Location, V0, V1, V2, V3)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4dv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4f(Program, Location, V0, V1, V2, V3)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4fv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4i(Program, Location, V0, V1, V2, V3)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4iv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4ui(Program, Location, V0, V1, V2, V3)

Equivalent to programUniformMatrix4x3fv/4.

programUniform4uiv(Program, Location, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x3dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x3fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x4dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x4fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x2dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x2fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x4dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x4fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x2dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x2fv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x3dv(Program, Location, Transpose, Value)

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x3fv(Program, Location, Transpose, Value)

gl:programUniform() modifies the value of a uniform variable or a uniform variable array. The location of the uniform variable to be modified is specified by Location, which should be a value returned by gl:getUniformLocation/2. gl:programUniform() operates on the program object specified by Program.

provokingVertex(Mode)

Flatshading a vertex shader varying output means to assign all vetices of the primitive the same value for that output. The vertex from which these values is derived is known as the provoking vertex and gl:provokingVertex/1 specifies which vertex is to be used as the source of data for flat shaded varyings.

pushAttrib(Mask)

gl:pushAttrib/1 takes one argument, a mask that indicates which groups of state variables to save on the attribute stack. Symbolic constants are used to set bits in the mask. Mask is typically constructed by specifying the bitwise-or of several of these constants together. The special mask ?GL_ALL_ATTRIB_BITS can be used to save all stackable states.

pushClientAttrib(Mask)

gl:pushClientAttrib/1 takes one argument, a mask that indicates which groups of client-state variables to save on the client attribute stack. Symbolic constants are used to set bits in the mask. Mask is typically constructed by specifying the bitwise-or of several of these constants together. The special mask ?GL_CLIENT_ALL_ATTRIB_BITS can be used to save all stackable client state.

pushDebugGroup(Source, Id, Length, Message)

gl:pushDebugGroup/4 pushes a debug group described by the string Message into the command stream. The value of Id specifies the ID of messages generated. The parameter Length contains the number of characters in Message. If Length is negative, it is implied that Message contains a null terminated string. The message has the specified Source and Id, the Type``?GL_DEBUG_TYPE_PUSH_GROUP, and Severity``?GL_DEBUG_SEVERITY_NOTIFICATION. The GL will put a new debug group on top of the debug group stack which inherits the control of the volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group.

pushMatrix()

There is a stack of matrices for each of the matrix modes. In ?GL_MODELVIEW mode, the stack depth is at least 32. In the other modes, ?GL_COLOR, ?GL_PROJECTION, and ?GL_TEXTURE, the depth is at least 2. The current matrix in any mode is the matrix on the top of the stack for that mode.

pushName(Name)

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers and is initially empty.

queryCounter(Id, Target)

gl:queryCounter/2 causes the GL to record the current time into the query object named Id. Target must be ?GL_TIMESTAMP. The time is recorded after all previous commands on the GL client and server state and the framebuffer have been fully realized. When the time is recorded, the query result for that object is marked available. gl:queryCounter/2 timer queries can be used within a gl:beginQuery/2 / gl:endQuery/1 block where the target is ?GL_TIME_ELAPSED and it does not affect the result of that query object.

rasterPos2d(X, Y)

Equivalent to rasterPos4sv/1.

rasterPos2dv/1

Equivalent to rasterPos4sv/1.

rasterPos2f(X, Y)

Equivalent to rasterPos4sv/1.

rasterPos2fv/1

Equivalent to rasterPos4sv/1.

rasterPos2i(X, Y)

Equivalent to rasterPos4sv/1.

rasterPos2iv/1

Equivalent to rasterPos4sv/1.

rasterPos2s(X, Y)

Equivalent to rasterPos4sv/1.

rasterPos2sv/1

Equivalent to rasterPos4sv/1.

rasterPos3d(X, Y, Z)

Equivalent to rasterPos4sv/1.

rasterPos3dv/1

Equivalent to rasterPos4sv/1.

rasterPos3f(X, Y, Z)

Equivalent to rasterPos4sv/1.

rasterPos3fv/1

Equivalent to rasterPos4sv/1.

rasterPos3i(X, Y, Z)

Equivalent to rasterPos4sv/1.

rasterPos3iv/1

Equivalent to rasterPos4sv/1.

rasterPos3s(X, Y, Z)

Equivalent to rasterPos4sv/1.

rasterPos3sv/1

Equivalent to rasterPos4sv/1.

rasterPos4d(X, Y, Z, W)

Equivalent to rasterPos4sv/1.

rasterPos4dv/1

Equivalent to rasterPos4sv/1.

rasterPos4f(X, Y, Z, W)

Equivalent to rasterPos4sv/1.

rasterPos4fv/1

Equivalent to rasterPos4sv/1.

rasterPos4i(X, Y, Z, W)

Equivalent to rasterPos4sv/1.

rasterPos4iv/1

Equivalent to rasterPos4sv/1.

rasterPos4s(X, Y, Z, W)

Equivalent to rasterPos4sv/1.

rasterPos4sv/1

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See gl:bitmap/7, gl:drawPixels/5, and gl:copyPixels/5.

readBuffer(Mode)

gl:readBuffer/1 specifies a color buffer as the source for subsequent gl:readPixels/7, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9 commands. Mode accepts one of twelve or more predefined values. In a fully configured system, ?GL_FRONT, ?GL_LEFT, and ?GL_FRONT_LEFT all name the front left buffer, ?GL_FRONT_RIGHT and ?GL_RIGHT name the front right buffer, and ?GL_BACK_LEFT and ?GL_BACK name the back left buffer. Further more, the constants ?GL_COLOR_ATTACHMENT``i may be used to indicate the ith color attachment where i ranges from zero to the value of ?GL_MAX_COLOR_ATTACHMENTS minus one.

readPixels(X, Y, Width, Height, Format, Type, Pixels)

gl:readPixels/7 and glReadnPixels return pixel data from the frame buffer, starting with the pixel whose lower left corner is at location (X, Y), into client memory starting at location Data. Several parameters control the processing of the pixel data before it is placed into client memory. These parameters are set with gl:pixelStore(). This reference page describes the effects on gl:readPixels/7 and glReadnPixels of most, but not all of the parameters specified by these three commands.

rectd(X1, Y1, X2, Y2)

Equivalent to rectsv/2.

rectdv(V1, V2)

Equivalent to rectsv/2.

rectf(X1, Y1, X2, Y2)

Equivalent to rectsv/2.

rectfv(V1, V2)

Equivalent to rectsv/2.

recti(X1, Y1, X2, Y2)

Equivalent to rectsv/2.

rectiv(V1, V2)

Equivalent to rectsv/2.

rects(X1, Y1, X2, Y2)

Equivalent to rectsv/2.

rectsv(V1, V2)

gl:rect() supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of (x y) coordinates or as two pointers to arrays, each containing an (x y) pair. The resulting rectangle is defined in the z=0 plane.

releaseShaderCompiler()

gl:releaseShaderCompiler/0 provides a hint to the implementation that it may free internal resources associated with its shader compiler. gl:compileShader/1 may subsequently be called and the implementation may at that time reallocate resources previously freed by the call to gl:releaseShaderCompiler/0.

renderbufferStorage(Target, Internalformat, Width, Height)

gl:renderbufferStorage/4 is equivalent to calling gl:renderbufferStorageMultisample/5 with the Samples set to zero, and glNamedRenderbufferStorage is equivalent to calling glNamedRenderbufferStorageMultisample with the samples set to zero.

renderbufferStorageMultisample(Target, Samples, Internalformat, Width, Height)

gl:renderbufferStorageMultisample/5 and glNamedRenderbufferStorageMultisample establish the data storage, format, dimensions and number of samples of a renderbuffer object's image.

renderMode(Mode)

gl:renderMode/1 sets the rasterization mode. It takes one argument, Mode, which can assume one of three predefined values

resetHistogram(Target)

gl:resetHistogram/1 resets all the elements of the current histogram table to zero.

resetMinmax(Target)

gl:resetMinmax/1 resets the elements of the current minmax table to their initial values: the ``maximum'' element receives the minimum possible component values, and the ``minimum'' element receives the maximum possible component values.

resumeTransformFeedback()

gl:resumeTransformFeedback/0 resumes transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.

rotated(Angle, X, Y, Z)

Equivalent to rotatef/4.

rotatef(Angle, X, Y, Z)

gl:rotate() produces a rotation of Angle degrees around the vector (x y z). The current matrix (see gl:matrixMode/1) is multiplied by a rotation matrix with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix as its argument

sampleCoverage(Value, Invert)

Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. Multisampling transparently antialiases points, lines, polygons, and images if it is enabled.

sampleMaski(MaskNumber, Mask)

gl:sampleMaski/2 sets one 32-bit sub-word of the multi-word sample mask, ?GL_SAMPLE_MASK_VALUE.

samplerParameterf(Sampler, Pname, Param)

Equivalent to samplerParameteriv/3.

samplerParameterfv(Sampler, Pname, Param)

Equivalent to samplerParameteriv/3.

samplerParameterIiv(Sampler, Pname, Param)

Equivalent to samplerParameteriv/3.

samplerParameterIuiv(Sampler, Pname, Param)

Equivalent to samplerParameteriv/3.

samplerParameteri(Sampler, Pname, Param)

Equivalent to samplerParameteriv/3.

samplerParameteriv(Sampler, Pname, Param)

gl:samplerParameter() assigns the value or values in Params to the sampler parameter specified as Pname. Sampler specifies the sampler object to be modified, and must be the name of a sampler object previously returned from a call to gl:genSamplers/1. The following symbols are accepted in Pname

scaled(X, Y, Z)

Equivalent to scalef/3.

scalef(X, Y, Z)

gl:scale() produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes.

scissor(X, Y, Width, Height)

gl:scissor/4 defines a rectangle, called the scissor box, in window coordinates. The first two arguments, X and Y, specify the lower left corner of the box. Width and Height specify the width and height of the box.

scissorArrayv(First, V)

gl:scissorArrayv/2 defines rectangles, called scissor boxes, in window coordinates for each viewport. First specifies the index of the first scissor box to modify and Count specifies the number of scissor boxes to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. V specifies the address of an array containing integers specifying the lower left corner of the scissor boxes, and the width and height of the scissor boxes, in that order.

scissorIndexed(Index, Left, Bottom, Width, Height)

Equivalent to scissorIndexedv/2.

scissorIndexedv(Index, V)

gl:scissorIndexed/5 defines the scissor box for a specified viewport. Index specifies the index of scissor box to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:scissorIndexed/5, Left, Bottom, Width and Height specify the left, bottom, width and height of the scissor box, in pixels, respectively. For gl:scissorIndexedv/2, V specifies the address of an array containing integers specifying the lower left corner of the scissor box, and the width and height of the scissor box, in that order.

secondaryColor3b(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3bv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3d(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3dv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3f(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3fv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3i(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3iv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3s(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3sv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3ub(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3ubv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3ui(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3uiv/1

Equivalent to secondaryColor3usv/1.

secondaryColor3us(Red, Green, Blue)

Equivalent to secondaryColor3usv/1.

secondaryColor3usv/1

The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA color (where alpha is always set to 0.0) that is associated with every vertex.

secondaryColorPointer(Size, Type, Stride, Pointer)

gl:secondaryColorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

selectBuffer(Size, Buffer)

gl:selectBuffer/2 has two arguments: Buffer is a pointer to an array of unsigned integers, and Size indicates the size of the array. Buffer returns values from the name stack (see gl:initNames/0, gl:loadName/1, gl:pushName/1) when the rendering mode is ?GL_SELECT (see gl:renderMode/1). gl:selectBuffer/2 must be issued before selection mode is enabled, and it must not be issued while the rendering mode is ?GL_SELECT.

separableFilter2D(Target, Internalformat, Width, Height, Format, Type, Row, Column)

gl:separableFilter2D/8 builds a two-dimensional separable convolution filter kernel from two arrays of pixels.

shadeModel(Mode)

GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting if lighting is enabled, or it is the current color at the time the vertex was specified if lighting is disabled.

shaderBinary(Shaders, Binaryformat, Binary)

gl:shaderBinary/3 loads pre-compiled shader binary code into the Count shader objects whose handles are given in Shaders. Binary points to Length bytes of binary shader code stored in client memory. BinaryFormat specifies the format of the pre-compiled code.

shaderSource(Shader, String)

gl:shaderSource/2 sets the source code in Shader to the source code in the array of strings specified by String. Any source code previously stored in the shader object is completely replaced. The number of strings in the array is specified by Count. If Length is ?NULL, each string is assumed to be null terminated. If Length is a value other than ?NULL, it points to an array containing a string length for each of the corresponding elements of String. Each element in the Length array may contain the length of the corresponding string (the null character is not counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or parsed at this time; they are simply copied into the specified shader object.

shaderStorageBlockBinding(Program, StorageBlockIndex, StorageBlockBinding)

gl:shaderStorageBlockBinding/3, changes the active shader storage block with an assigned index of StorageBlockIndex in program object Program. StorageBlockIndex must be an active shader storage block index in Program. StorageBlockBinding must be less than the value of ?GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS. If successful, gl:shaderStorageBlockBinding/3 specifies that Program will use the data store of the buffer object bound to the binding point StorageBlockBinding to read and write the values of the buffer variables in the shader storage block identified by StorageBlockIndex.

stencilFunc(Func, Ref, Mask)

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. Stencil planes are first drawn into using GL drawing primitives, then geometry and images are rendered using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

stencilFuncSeparate(Face, Func, Ref, Mask)

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

stencilMask(Mask)

gl:stencilMask/1 controls the writing of individual bits in the stencil planes. The least significant n bits of Mask, where n is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing.

stencilMaskSeparate(Face, Mask)

gl:stencilMaskSeparate/2 controls the writing of individual bits in the stencil planes. The least significant n bits of Mask, where n is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing.

stencilOp(Fail, Zfail, Zpass)

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

stencilOpSeparate(Face, Sfail, Dpfail, Dppass)

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

texBuffer(Target, Internalformat, Buffer)

Equivalent to textureBuffer/3.

texBufferRange(Target, Internalformat, Buffer, Offset, Size)

Equivalent to textureBufferRange/5.

texCoord1d(S)

Equivalent to texCoord4sv/1.

texCoord1dv/1

Equivalent to texCoord4sv/1.

texCoord1f(S)

Equivalent to texCoord4sv/1.

texCoord1fv/1

Equivalent to texCoord4sv/1.

texCoord1i(S)

Equivalent to texCoord4sv/1.

texCoord1iv/1

Equivalent to texCoord4sv/1.

texCoord1s(S)

Equivalent to texCoord4sv/1.

texCoord1sv/1

Equivalent to texCoord4sv/1.

texCoord2d(S, T)

Equivalent to texCoord4sv/1.

texCoord2dv/1

Equivalent to texCoord4sv/1.

texCoord2f(S, T)

Equivalent to texCoord4sv/1.

texCoord2fv/1

Equivalent to texCoord4sv/1.

texCoord2i(S, T)

Equivalent to texCoord4sv/1.

texCoord2iv/1

Equivalent to texCoord4sv/1.

texCoord2s(S, T)

Equivalent to texCoord4sv/1.

texCoord2sv/1

Equivalent to texCoord4sv/1.

texCoord3d(S, T, R)

Equivalent to texCoord4sv/1.

texCoord3dv/1

Equivalent to texCoord4sv/1.

texCoord3f(S, T, R)

Equivalent to texCoord4sv/1.

texCoord3fv/1

Equivalent to texCoord4sv/1.

texCoord3i(S, T, R)

Equivalent to texCoord4sv/1.

texCoord3iv/1

Equivalent to texCoord4sv/1.

texCoord3s(S, T, R)

Equivalent to texCoord4sv/1.

texCoord3sv/1

Equivalent to texCoord4sv/1.

texCoord4d(S, T, R, Q)

Equivalent to texCoord4sv/1.

texCoord4dv/1

Equivalent to texCoord4sv/1.

texCoord4f(S, T, R, Q)

Equivalent to texCoord4sv/1.

texCoord4fv/1

Equivalent to texCoord4sv/1.

texCoord4i(S, T, R, Q)

Equivalent to texCoord4sv/1.

texCoord4iv/1

Equivalent to texCoord4sv/1.

texCoord4s(S, T, R, Q)

Equivalent to texCoord4sv/1.

texCoord4sv/1

gl:texCoord() specifies texture coordinates in one, two, three, or four dimensions. gl:texCoord1() sets the current texture coordinates to (s 0 0 1); a call to gl:texCoord2() sets them to (s t 0 1). Similarly, gl:texCoord3() specifies the texture coordinates as (s t r 1), and gl:texCoord4() defines all four components explicitly as (s t r q).

texCoordPointer(Size, Type, Stride, Ptr)

gl:texCoordPointer/4 specifies the location and data format of an array of texture coordinates to use when rendering. Size specifies the number of coordinates per texture coordinate set, and must be 1, 2, 3, or 4. Type specifies the data type of each texture coordinate, and Stride specifies the byte stride from one texture coordinate set to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

texEnvf(Target, Pname, Param)

Equivalent to texEnviv/3.

texEnvfv(Target, Pname, Params)

Equivalent to texEnviv/3.

texEnvi(Target, Pname, Param)

Equivalent to texEnviv/3.

texEnviv(Target, Pname, Params)

A texture environment specifies how texture values are interpreted when a fragment is textured. When Target is ?GL_TEXTURE_FILTER_CONTROL, Pname must be ?GL_TEXTURE_LOD_BIAS. When Target is ?GL_TEXTURE_ENV, Pname can be ?GL_TEXTURE_ENV_MODE, ?GL_TEXTURE_ENV_COLOR, ?GL_COMBINE_RGB, ?GL_COMBINE_ALPHA, ?GL_RGB_SCALE, ?GL_ALPHA_SCALE, ?GL_SRC0_RGB, ?GL_SRC1_RGB, ?GL_SRC2_RGB, ?GL_SRC0_ALPHA, ?GL_SRC1_ALPHA, or ?GL_SRC2_ALPHA.

texGend(Coord, Pname, Param)

Equivalent to texGeniv/3.

texGendv(Coord, Pname, Params)

Equivalent to texGeniv/3.

texGenf(Coord, Pname, Param)

Equivalent to texGeniv/3.

texGenfv(Coord, Pname, Params)

Equivalent to texGeniv/3.

texGeni(Coord, Pname, Param)

Equivalent to texGeniv/3.

texGeniv(Coord, Pname, Params)

gl:texGen() selects a texture-coordinate generation function or supplies coefficients for one of the functions. Coord names one of the (s, t, r, q) texture coordinates; it must be one of the symbols ?GL_S, ?GL_T, ?GL_R, or ?GL_Q. Pname must be one of three symbolic constants: ?GL_TEXTURE_GEN_MODE, ?GL_OBJECT_PLANE, or ?GL_EYE_PLANE. If Pname is ?GL_TEXTURE_GEN_MODE, then Params chooses a mode, one of ?GL_OBJECT_LINEAR, ?GL_EYE_LINEAR, ?GL_SPHERE_MAP, ?GL_NORMAL_MAP, or ?GL_REFLECTION_MAP. If Pname is either ?GL_OBJECT_PLANE or ?GL_EYE_PLANE, Params contains coefficients for the corresponding texture generation function.

texImage1D(Target, Level, InternalFormat, Width, Border, Format, Type, Pixels)

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D.

texImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, Pixels)

Texturing allows elements of an image array to be read by shaders.

texImage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations)

gl:texImage2DMultisample/6 establishes the data storage, format, dimensions and number of samples of a multisample texture's image.

texImage3D(Target, Level, InternalFormat, Width, Height, Depth, Border, Format, Type, Pixels)

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable three-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_3D.

texImage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations)

gl:texImage3DMultisample/7 establishes the data storage, format, dimensions and number of samples of a multisample texture's image.

texParameterf(Target, Pname, Param)

Equivalent to texParameteriv/3.

texParameterfv(Target, Pname, Params)

Equivalent to texParameteriv/3.

texParameterIiv(Target, Pname, Params)

Equivalent to texParameteriv/3.

texParameterIuiv(Target, Pname, Params)

Equivalent to texParameteriv/3.

texParameteri(Target, Pname, Param)

Equivalent to texParameteriv/3.

texParameteriv(Target, Pname, Params)

gl:texParameter() and gl:textureParameter() assign the value or values in Params to the texture parameter specified as Pname. For gl:texParameter(), Target defines the target texture, either ?GL_TEXTURE_1D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_2D_MULTISAMPLE, ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, or ?GL_TEXTURE_RECTANGLE. The following symbols are accepted in Pname

texStorage1D(Target, Levels, Internalformat, Width)

gl:texStorage1D/4 and gl:textureStorage1D() specify the storage requirements for all levels of a one-dimensional texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

texStorage2D(Target, Levels, Internalformat, Width, Height)

gl:texStorage2D/5 and gl:textureStorage2D() specify the storage requirements for all levels of a two-dimensional texture or one-dimensional texture array simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

texStorage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations)

gl:texStorage2DMultisample/6 and gl:textureStorage2DMultisample() specify the storage requirements for a two-dimensional multisample texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

texStorage3D(Target, Levels, Internalformat, Width, Height, Depth)

gl:texStorage3D/6 and gl:textureStorage3D() specify the storage requirements for all levels of a three-dimensional, two-dimensional array or cube-map array texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

texStorage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations)

gl:texStorage3DMultisample/7 and gl:textureStorage3DMultisample() specify the storage requirements for a two-dimensional multisample array texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

texSubImage1D(Target, Level, Xoffset, Width, Format, Type, Pixels)

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable or disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D.

texSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, Type, Pixels)

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled.

texSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Pixels)

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled.

textureBarrier()

The values of rendered fragments are undefined when a shader stage fetches texels and the same texels are written via fragment shader outputs, even if the reads and writes are not in the same drawing command. To safely read the result of a written texel via a texel fetch in a subsequent drawing command, call gl:textureBarrier/0 between the two drawing commands to guarantee that writes have completed and caches have been invalidated before subsequent drawing commands are executed.

textureBuffer(Texture, Internalformat, Buffer)

gl:texBuffer/3 and gl:textureBuffer/3 attaches the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture.

textureBufferRange(Texture, Internalformat, Buffer, Offset, Size)

gl:texBufferRange/5 and gl:textureBufferRange/5 attach a range of the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture.

textureView(Texture, Target, Origtexture, Internalformat, Minlevel, Numlevels, Minlayer, Numlayers)

gl:textureView/8 initializes a texture object as an alias, or view of another texture object, sharing some or all of the parent texture's data store with the initialized texture. Texture specifies a name previously reserved by a successful call to gl:genTextures/1 but that has not yet been bound or given a target. Target specifies the target for the newly initialized texture and must be compatible with the target of the parent texture, given in Origtexture as specified in the following table

transformFeedbackBufferBase(Xfb, Index, Buffer)

gl:transformFeedbackBufferBase/3 binds the buffer object Buffer to the binding point at index Index of the transform feedback object Xfb.

transformFeedbackBufferRange(Xfb, Index, Buffer, Offset, Size)

gl:transformFeedbackBufferRange/5 binds a range of the buffer object Buffer represented by Offset and Size to the binding point at index Index of the transform feedback object Xfb.

transformFeedbackVaryings(Program, Varyings, BufferMode)

The names of the vertex or geometry shader outputs to be recorded in transform feedback mode are specified using gl:transformFeedbackVaryings/3. When a geometry shader is active, transform feedback records the values of selected geometry shader output variables from the emitted vertices. Otherwise, the values of the selected vertex shader outputs are recorded.

translated(X, Y, Z)

Equivalent to translatef/3.

translatef(X, Y, Z)

gl:translate() produces a translation by (x y z). The current matrix (see gl:matrixMode/1) is multiplied by this translation matrix, with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix for its argument

uniform1d(Location, X)

Equivalent to uniformMatrix4x3fv/3.

uniform1dv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform1f(Location, V0)

Equivalent to uniformMatrix4x3fv/3.

uniform1fv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform1i(Location, V0)

Equivalent to uniformMatrix4x3fv/3.

uniform1iv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform1ui(Location, V0)

Equivalent to uniformMatrix4x3fv/3.

uniform1uiv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform2d(Location, X, Y)

Equivalent to uniformMatrix4x3fv/3.

uniform2dv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform2f(Location, V0, V1)

Equivalent to uniformMatrix4x3fv/3.

uniform2fv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform2i(Location, V0, V1)

Equivalent to uniformMatrix4x3fv/3.

uniform2iv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform2ui(Location, V0, V1)

Equivalent to uniformMatrix4x3fv/3.

uniform2uiv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform3d(Location, X, Y, Z)

Equivalent to uniformMatrix4x3fv/3.

uniform3dv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform3f(Location, V0, V1, V2)

Equivalent to uniformMatrix4x3fv/3.

uniform3fv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform3i(Location, V0, V1, V2)

Equivalent to uniformMatrix4x3fv/3.

uniform3iv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform3ui(Location, V0, V1, V2)

Equivalent to uniformMatrix4x3fv/3.

uniform3uiv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform4d(Location, X, Y, Z, W)

Equivalent to uniformMatrix4x3fv/3.

uniform4dv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform4f(Location, V0, V1, V2, V3)

Equivalent to uniformMatrix4x3fv/3.

uniform4fv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform4i(Location, V0, V1, V2, V3)

Equivalent to uniformMatrix4x3fv/3.

uniform4iv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniform4ui(Location, V0, V1, V2, V3)

Equivalent to uniformMatrix4x3fv/3.

uniform4uiv(Location, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformBlockBinding(Program, UniformBlockIndex, UniformBlockBinding)

Binding points for active uniform blocks are assigned using gl:uniformBlockBinding/3. Each of a program's active uniform blocks has a corresponding uniform buffer binding point. Program is the name of a program object for which the command gl:linkProgram/1 has been issued in the past.

uniformMatrix2dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x3dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x3fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x4dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x4fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x2dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x2fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x4dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x4fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x2dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x2fv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x3dv(Location, Transpose, Value)

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x3fv(Location, Transpose, Value)

gl:uniform() modifies the value of a uniform variable or a uniform variable array. The location of the uniform variable to be modified is specified by Location, which should be a value returned by gl:getUniformLocation/2. gl:uniform() operates on the program object that was made part of current state by calling gl:useProgram/1.

uniformSubroutinesuiv(Shadertype, Indices)

gl:uniformSubroutines() loads all active subroutine uniforms for shader stage Shadertype of the current program with subroutine indices from Indices, storing Indices[i] into the uniform at location I. Count must be equal to the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the program currently in use at shader stage Shadertype. Furthermore, all values in Indices must be less than the value of ?GL_ACTIVE_SUBROUTINES for the shader stage.

useProgram(Program)

gl:useProgram/1 installs the program object specified by Program as part of current rendering state. One or more executables are created in a program object by successfully attaching shader objects to it with gl:attachShader/2, successfully compiling the shader objects with gl:compileShader/1, and successfully linking the program object with gl:linkProgram/1.

useProgramStages(Pipeline, Stages, Program)

gl:useProgramStages/3 binds executables from a program object associated with a specified set of shader stages to the program pipeline object given by Pipeline. Pipeline specifies the program pipeline object to which to bind the executables. Stages contains a logical combination of bits indicating the shader stages to use within Program with the program pipeline object Pipeline. Stages must be a logical combination of ?GL_VERTEX_SHADER_BIT, ?GL_TESS_CONTROL_SHADER_BIT, ?GL_TESS_EVALUATION_SHADER_BIT, ?GL_GEOMETRY_SHADER_BIT, ?GL_FRAGMENT_SHADER_BIT and ?GL_COMPUTE_SHADER_BIT. Additionally, the special value ?GL_ALL_SHADER_BITS may be specified to indicate that all executables contained in Program should be installed in Pipeline.

validateProgram(Program)

gl:validateProgram/1 checks to see whether the executables contained in Program can execute given the current OpenGL state. The information generated by the validation process will be stored in Program's information log. The validation information may consist of an empty string, or it may be a string containing information about how the current program object interacts with the rest of current OpenGL state. This provides a way for OpenGL implementers to convey more information about why the current program is inefficient, suboptimal, failing to execute, and so on.

validateProgramPipeline(Pipeline)

gl:validateProgramPipeline/1 instructs the implementation to validate the shader executables contained in Pipeline against the current GL state. The implementation may use this as an opportunity to perform any internal shader modifications that may be required to ensure correct operation of the installed shaders given the current GL state.

vertex2d(X, Y)

Equivalent to vertex4sv/1.

vertex2dv/1

Equivalent to vertex4sv/1.

vertex2f(X, Y)

Equivalent to vertex4sv/1.

vertex2fv/1

Equivalent to vertex4sv/1.

vertex2i(X, Y)

Equivalent to vertex4sv/1.

vertex2iv/1

Equivalent to vertex4sv/1.

vertex2s(X, Y)

Equivalent to vertex4sv/1.

vertex2sv/1

Equivalent to vertex4sv/1.

vertex3d(X, Y, Z)

Equivalent to vertex4sv/1.

vertex3dv/1

Equivalent to vertex4sv/1.

vertex3f(X, Y, Z)

Equivalent to vertex4sv/1.

vertex3fv/1

Equivalent to vertex4sv/1.

vertex3i(X, Y, Z)

Equivalent to vertex4sv/1.

vertex3iv/1

Equivalent to vertex4sv/1.

vertex3s(X, Y, Z)

Equivalent to vertex4sv/1.

vertex3sv/1

Equivalent to vertex4sv/1.

vertex4d(X, Y, Z, W)

Equivalent to vertex4sv/1.

vertex4dv/1

Equivalent to vertex4sv/1.

vertex4f(X, Y, Z, W)

Equivalent to vertex4sv/1.

vertex4fv/1

Equivalent to vertex4sv/1.

vertex4i(X, Y, Z, W)

Equivalent to vertex4sv/1.

vertex4iv/1

Equivalent to vertex4sv/1.

vertex4s(X, Y, Z, W)

Equivalent to vertex4sv/1.

vertex4sv/1

gl:vertex() commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify point, line, and polygon vertices. The current color, normal, texture coordinates, and fog coordinate are associated with the vertex when gl:vertex() is called.

vertexArrayAttribBinding(Vaobj, Attribindex, Bindingindex)

Equivalent to vertexAttribBinding/2.

vertexArrayAttribFormat(Vaobj, Attribindex, Size, Type, Normalized, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexArrayAttribIFormat(Vaobj, Attribindex, Size, Type, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexArrayAttribLFormat(Vaobj, Attribindex, Size, Type, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexArrayBindingDivisor(Vaobj, Bindingindex, Divisor)

Equivalent to vertexBindingDivisor/2.

vertexArrayElementBuffer(Vaobj, Buffer)

gl:vertexArrayElementBuffer/2 binds a buffer object with id Buffer to the element array buffer bind point of a vertex array object with id Vaobj. If Buffer is zero, any existing element array buffer binding to Vaobj is removed.

vertexArrayVertexBuffer(Vaobj, Bindingindex, Buffer, Offset, Stride)

gl:bindVertexBuffer/4 and gl:vertexArrayVertexBuffer/5 bind the buffer named Buffer to the vertex buffer binding point whose index is given by Bindingindex. gl:bindVertexBuffer/4 modifies the binding of the currently bound vertex array object, whereas gl:vertexArrayVertexBuffer/5 allows the caller to specify ID of the vertex array object with an argument named Vaobj, for which the binding should be modified. Offset and Stride specify the offset of the first element within the buffer and the distance between elements within the buffer, respectively, and are both measured in basic machine units. Bindingindex must be less than the value of ?GL_MAX_VERTEX_ATTRIB_BINDINGS. Offset and Stride must be greater than or equal to zero. If Buffer is zero, then any buffer currently bound to the specified binding point is unbound.

vertexArrayVertexBuffers(Vaobj, First, Buffers, Offsets, Strides)

gl:bindVertexBuffers/4 and gl:vertexArrayVertexBuffers/5 bind storage from an array of existing buffer objects to a specified number of consecutive vertex buffer binding points units in a vertex array object. For gl:bindVertexBuffers/4, the vertex array object is the currently bound vertex array object. For gl:vertexArrayVertexBuffers/5, Vaobj is the name of the vertex array object.

vertexAttrib1d(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttrib1dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib1f(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttrib1fv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib1s(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttrib1sv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib2d(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttrib2dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib2f(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttrib2fv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib2s(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttrib2sv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib3d(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttrib3dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib3f(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttrib3fv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib3s(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttrib3sv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib4bv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4d(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib4f(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4fv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib4iv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nbv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Niv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nsv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nub(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nubv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nuiv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nusv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4s(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4sv/2

Equivalent to vertexAttribL4dv/2.

vertexAttrib4ubv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4uiv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttrib4usv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttribBinding(Attribindex, Bindingindex)

gl:vertexAttribBinding/2 and gl:vertexArrayAttribBinding/3 establishes an association between the generic vertex attribute of a vertex array object whose index is given by Attribindex, and a vertex buffer binding whose index is given by Bindingindex. For gl:vertexAttribBinding/2, the vertex array object affected is that currently bound. For gl:vertexArrayAttribBinding/3, Vaobj is the name of the vertex array object.

vertexAttribDivisor(Index, Divisor)

gl:vertexAttribDivisor/2 modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw call. If Divisor is zero, the attribute at slot Index advances once per vertex. If Divisor is non-zero, the attribute advances once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if its ?GL_VERTEX_ATTRIB_ARRAY_DIVISOR value is non-zero.

vertexAttribFormat(Attribindex, Size, Type, Normalized, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexAttribI1i(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttribI1iv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI1ui(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttribI1uiv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI2i(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttribI2iv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI2ui(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttribI2uiv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI3i(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttribI3iv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI3ui(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttribI3uiv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI4bv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttribI4i(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttribI4iv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI4sv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttribI4ubv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttribI4ui(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttribI4uiv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribI4usv(Index, V)

Equivalent to vertexAttribL4dv/2.

vertexAttribIFormat(Attribindex, Size, Type, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexAttribIPointer(Index, Size, Type, Stride, Pointer)

Equivalent to vertexAttribLPointer/5.

vertexAttribL1d(Index, X)

Equivalent to vertexAttribL4dv/2.

vertexAttribL1dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribL2d(Index, X, Y)

Equivalent to vertexAttribL4dv/2.

vertexAttribL2dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribL3d(Index, X, Y, Z)

Equivalent to vertexAttribL4dv/2.

vertexAttribL3dv/2

Equivalent to vertexAttribL4dv/2.

vertexAttribL4d(Index, X, Y, Z, W)

Equivalent to vertexAttribL4dv/2.

vertexAttribL4dv/2

The gl:vertexAttrib() family of entry points allows an application to pass generic vertex attributes in numbered locations.

vertexAttribLFormat(Attribindex, Size, Type, Relativeoffset)

Equivalent to vertexAttribLPointer/5.

vertexAttribLPointer(Index, Size, Type, Stride, Pointer)

gl:vertexAttribFormat/5, gl:vertexAttribIFormat/4 and gl:vertexAttribLFormat/4, as well as gl:vertexArrayAttribFormat/6, gl:vertexArrayAttribIFormat/5 and gl:vertexArrayAttribLFormat/5 specify the organization of data in vertex arrays. The first three calls operate on the bound vertex array object, whereas the last three ones modify the state of a vertex array object with ID Vaobj. Attribindex specifies the index of the generic vertex attribute array whose data layout is being described, and must be less than the value of ?GL_MAX_VERTEX_ATTRIBS.

vertexAttribPointer(Index, Size, Type, Normalized, Stride, Pointer)

gl:vertexAttribPointer/6, gl:vertexAttribIPointer/5 and gl:vertexAttribLPointer/5 specify the location and data format of the array of generic vertex attributes at index Index to use when rendering. Size specifies the number of components per attribute and must be 1, 2, 3, 4, or ?GL_BGRA. Type specifies the data type of each component, and Stride specifies the byte stride from one attribute to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

vertexBindingDivisor(Bindingindex, Divisor)

gl:vertexBindingDivisor/2 and gl:vertexArrayBindingDivisor/3 modify the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw command. If Divisor is zero, the attributes using the buffer bound to Bindingindex advance once per vertex. If Divisor is non-zero, the attributes advance once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if the corresponding Divisor value is non-zero.

vertexPointer(Size, Type, Stride, Ptr)

gl:vertexPointer/4 specifies the location and data format of an array of vertex coordinates to use when rendering. Size specifies the number of coordinates per vertex, and must be 2, 3, or 4. Type specifies the data type of each coordinate, and Stride specifies the byte stride from one vertex to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

viewport(X, Y, Width, Height)

gl:viewport/4 specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows

viewportArrayv(First, V)

gl:viewportArrayv/2 specifies the parameters for multiple viewports simulataneously. First specifies the index of the first viewport to modify and Count specifies the number of viewports to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. Viewports whose indices lie outside the range [First, First + Count) are not modified. V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows

viewportIndexedf(Index, X, Y, W, H)

Equivalent to viewportIndexedfv/2.

viewportIndexedfv(Index, V)

gl:viewportIndexedf/5 and gl:viewportIndexedfv/2 specify the parameters for a single viewport. Index specifies the index of the viewport to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:viewportIndexedf/5, X, Y, W, and H specify the left, bottom, width and height of the viewport in pixels, respectively. For gl:viewportIndexedfv/2, V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows

waitSync(Sync, Flags, Timeout)

gl:waitSync/3 causes the GL server to block and wait until Sync becomes signaled. Sync is the name of an existing sync object upon which to wait. Flags and Timeout are currently not used and must be set to zero and the special value ?GL_TIMEOUT_IGNORED, respectively

windowPos2d(X, Y)

Equivalent to windowPos3sv/1.

windowPos2dv/1

Equivalent to windowPos3sv/1.

windowPos2f(X, Y)

Equivalent to windowPos3sv/1.

windowPos2fv/1

Equivalent to windowPos3sv/1.

windowPos2i(X, Y)

Equivalent to windowPos3sv/1.

windowPos2iv/1

Equivalent to windowPos3sv/1.

windowPos2s(X, Y)

Equivalent to windowPos3sv/1.

windowPos2sv/1

Equivalent to windowPos3sv/1.

windowPos3d(X, Y, Z)

Equivalent to windowPos3sv/1.

windowPos3dv/1

Equivalent to windowPos3sv/1.

windowPos3f(X, Y, Z)

Equivalent to windowPos3sv/1.

windowPos3fv/1

Equivalent to windowPos3sv/1.

windowPos3i(X, Y, Z)

Equivalent to windowPos3sv/1.

windowPos3iv/1

Equivalent to windowPos3sv/1.

windowPos3s(X, Y, Z)

Equivalent to windowPos3sv/1.

windowPos3sv/1

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See gl:bitmap/7, gl:drawPixels/5, and gl:copyPixels/5.

Types

clamp()

(not exported)

-type clamp() :: float().

enum()

(not exported)

-type enum() :: non_neg_integer().

f()

(not exported)

-type f() :: float().

i()

(not exported)

-type i() :: integer().

m12()

(not exported)

-type m12() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.

m16()

(not exported)

-type m16() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.

matrix()

(not exported)

-type matrix() :: m12() | m16().

mem()

(not exported)

-type mem() :: binary() | tuple().

offset()

(not exported)

-type offset() :: non_neg_integer().

Functions

accum(Op, Value)

-spec accum(Op :: enum(), Value :: f()) -> ok.

The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices.

External documentation.

activeShaderProgram(Pipeline, Program)

-spec activeShaderProgram(Pipeline :: i(), Program :: i()) -> ok.

gl:activeShaderProgram/2 sets the linked program named by Program to be the active program for the program pipeline object Pipeline. The active program in the active program pipeline object is the target of calls to gl:uniform() when no program has been made current through a call to gl:useProgram/1.

External documentation.

activeTexture(Texture)

-spec activeTexture(Texture :: enum()) -> ok.

gl:activeTexture/1 selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation dependent, but must be at least 80.

External documentation.

alphaFunc(Func, Ref)

-spec alphaFunc(Func :: enum(), Ref :: clamp()) -> ok.

The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. gl:alphaFunc/2 specifies the reference value and the comparison function. The comparison is performed only if alpha testing is enabled. By default, it is not enabled. (See gl:enable/1 and gl:disable/1 of ?GL_ALPHA_TEST.)

External documentation.

areTexturesResident(Textures)

-spec areTexturesResident(Textures :: [i()]) -> {0 | 1, Residences :: [0 | 1]}.

GL establishes a ``working set'' of textures that are resident in texture memory. These textures can be bound to a texture target much more efficiently than textures that are not resident.

External documentation.

arrayElement(I)

-spec arrayElement(I :: i()) -> ok.

gl:arrayElement/1 commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify vertex and attribute data for point, line, and polygon primitives. If ?GL_VERTEX_ARRAY is enabled when gl:arrayElement/1 is called, a single vertex is drawn, using vertex and attribute data taken from location I of the enabled arrays. If ?GL_VERTEX_ARRAY is not enabled, no drawing occurs but the attributes corresponding to the enabled arrays are modified.

External documentation.

attachShader(Program, Shader)

-spec attachShader(Program :: i(), Shader :: i()) -> ok.

In order to create a complete shader program, there must be a way to specify the list of things that will be linked together. Program objects provide this mechanism. Shaders that are to be linked together in a program object must first be attached to that program object. gl:attachShader/2 attaches the shader object specified by Shader to the program object specified by Program. This indicates that Shader will be included in link operations that will be performed on Program.

External documentation.

'begin'(Mode)

-spec 'begin'(Mode :: enum()) -> ok.

Equivalent to '\'end\''/0.

beginConditionalRender(Id, Mode)

-spec beginConditionalRender(Id :: i(), Mode :: enum()) -> ok.

Equivalent to endConditionalRender/0.

beginQuery(Target, Id)

-spec beginQuery(Target :: enum(), Id :: i()) -> ok.

Equivalent to endQuery/1.

beginQueryIndexed(Target, Index, Id)

-spec beginQueryIndexed(Target :: enum(), Index :: i(), Id :: i()) -> ok.

Equivalent to endQueryIndexed/2.

beginTransformFeedback(PrimitiveMode)

-spec beginTransformFeedback(PrimitiveMode :: enum()) -> ok.

Equivalent to endTransformFeedback/0.

bindAttribLocation(Program, Index, Name)

-spec bindAttribLocation(Program :: i(), Index :: i(), Name :: string()) -> ok.

gl:bindAttribLocation/3 is used to associate a user-defined attribute variable in the program object specified by Program with a generic vertex attribute index. The name of the user-defined attribute variable is passed as a null terminated string in Name. The generic vertex attribute index to be bound to this variable is specified by Index. When Program is made part of current state, values provided via the generic vertex attribute Index will modify the value of the user-defined attribute variable specified by Name.

External documentation.

bindBuffer(Target, Buffer)

-spec bindBuffer(Target :: enum(), Buffer :: i()) -> ok.

gl:bindBuffer/2 binds a buffer object to the specified buffer binding point. Calling gl:bindBuffer/2 with Target set to one of the accepted symbolic constants and Buffer set to the name of a buffer object binds that buffer object name to the target. If no buffer object with name Buffer exists, one is created with that name. When a buffer object is bound to a target, the previous binding for that target is automatically broken.

External documentation.

bindBufferBase(Target, Index, Buffer)

-spec bindBufferBase(Target :: enum(), Index :: i(), Buffer :: i()) -> ok.

gl:bindBufferBase/3 binds the buffer object Buffer to the binding point at index Index of the array of targets specified by Target. Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or glMapBuffer. In addition to binding Buffer to the indexed buffer binding target, gl:bindBufferBase/3 also binds Buffer to the generic buffer binding point specified by Target.

External documentation.

bindBufferRange(Target, Index, Buffer, Offset, Size)

-spec bindBufferRange(Target :: enum(), Index :: i(), Buffer :: i(), Offset :: i(), Size :: i()) -> ok.

gl:bindBufferRange/5 binds a range the buffer object Buffer represented by Offset and Size to the binding point at index Index of the array of targets specified by Target. Each Target represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as gl:bindBuffer/2 or glMapBuffer. In addition to binding a range of Buffer to the indexed buffer binding target, gl:bindBufferRange/5 also binds the range to the generic buffer binding point specified by Target.

External documentation.

bindBuffersBase(Target, First, Buffers)

-spec bindBuffersBase(Target :: enum(), First :: i(), Buffers :: [i()]) -> ok.

gl:bindBuffersBase/3 binds a set of Count buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. If Buffers is ?NULL then gl:bindBuffersBase/3 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferBase/3, with the exception that the non-indexed Target is not changed by gl:bindBuffersBase/3:

External documentation.

bindBuffersRange(Target, First, Buffers, Offsets, Sizes)

-spec bindBuffersRange(Target :: enum(),
                       First :: i(),
                       Buffers :: [i()],
                       Offsets :: [i()],
                       Sizes :: [i()]) ->
                          ok.

gl:bindBuffersRange/5 binds a set of Count ranges from buffer objects whose names are given in the array Buffers to the Count consecutive binding points starting from index First of the array of targets specified by Target. Offsets specifies the address of an array containing Count starting offsets within the buffers, and Sizes specifies the address of an array of Count sizes of the ranges. If Buffers is ?NULL then Offsets and Sizes are ignored and gl:bindBuffersRange/5 unbinds any buffers that are currently bound to the referenced binding points. Assuming no errors are generated, it is equivalent to the following pseudo-code, which calls gl:bindBufferRange/5, with the exception that the non-indexed Target is not changed by gl:bindBuffersRange/5:

External documentation.

bindFragDataLocation(Program, Color, Name)

-spec bindFragDataLocation(Program :: i(), Color :: i(), Name :: string()) -> ok.

gl:bindFragDataLocation/3 explicitly specifies the binding of the user-defined varying out variable Name to fragment shader color number ColorNumber for program Program. If Name was bound previously, its assigned binding is replaced with ColorNumber. Name must be a null-terminated string. ColorNumber must be less than ?GL_MAX_DRAW_BUFFERS.

External documentation.

bindFragDataLocationIndexed(Program, ColorNumber, Index, Name)

-spec bindFragDataLocationIndexed(Program :: i(), ColorNumber :: i(), Index :: i(), Name :: string()) ->
                                     ok.

gl:bindFragDataLocationIndexed/4 specifies that the varying out variable Name in Program should be bound to fragment color ColorNumber when the program is next linked. Index may be zero or one to specify that the color be used as either the first or second color input to the blend equation, respectively.

External documentation.

bindFramebuffer(Target, Framebuffer)

-spec bindFramebuffer(Target :: enum(), Framebuffer :: i()) -> ok.

gl:bindFramebuffer/2 binds the framebuffer object with name Framebuffer to the framebuffer target specified by Target. Target must be either ?GL_DRAW_FRAMEBUFFER, ?GL_READ_FRAMEBUFFER or ?GL_FRAMEBUFFER. If a framebuffer object is bound to ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling gl:bindFramebuffer/2 with Target set to ?GL_FRAMEBUFFER binds Framebuffer to both the read and draw framebuffer targets. Framebuffer is the name of a framebuffer object previously returned from a call to gl:genFramebuffers/1, or zero to break the existing binding of a framebuffer object to Target.

External documentation.

bindImageTexture(Unit, Texture, Level, Layered, Layer, Access, Format)

-spec bindImageTexture(Unit, Texture, Level, Layered, Layer, Access, Format) -> ok
                          when
                              Unit :: i(),
                              Texture :: i(),
                              Level :: i(),
                              Layered :: 0 | 1,
                              Layer :: i(),
                              Access :: enum(),
                              Format :: enum().

gl:bindImageTexture/7 binds a single level of a texture to an image unit for the purpose of reading and writing it from shaders. Unit specifies the zero-based index of the image unit to which to bind the texture level. Texture specifies the name of an existing texture object to bind to the image unit. If Texture is zero, then any existing binding to the image unit is broken. Level specifies the level of the texture to bind to the image unit.

External documentation.

bindImageTextures(First, Textures)

-spec bindImageTextures(First :: i(), Textures :: [i()]) -> ok.

gl:bindImageTextures/2 binds images from an array of existing texture objects to a specified number of consecutive image units. Count specifies the number of texture objects whose names are stored in the array Textures. That number of texture names are read from the array and bound to the Count consecutive texture units starting from First. If the name zero appears in the Textures array, any existing binding to the image unit is reset. Any non-zero entry in Textures must be the name of an existing texture object. When a non-zero entry in Textures is present, the image at level zero is bound, the binding is considered layered, with the first layer set to zero, and the image is bound for read-write access. The image unit format parameter is taken from the internal format of the image at level zero of the texture object. For cube map textures, the internal format of the positive X image of level zero is used. If Textures is ?NULL then it is as if an appropriately sized array containing only zeros had been specified.

External documentation.

bindProgramPipeline(Pipeline)

-spec bindProgramPipeline(Pipeline :: i()) -> ok.

gl:bindProgramPipeline/1 binds a program pipeline object to the current context. Pipeline must be a name previously returned from a call to gl:genProgramPipelines/1. If no program pipeline exists with name Pipeline then a new pipeline object is created with that name and initialized to the default state vector.

External documentation.

bindRenderbuffer(Target, Renderbuffer)

-spec bindRenderbuffer(Target :: enum(), Renderbuffer :: i()) -> ok.

gl:bindRenderbuffer/2 binds the renderbuffer object with name Renderbuffer to the renderbuffer target specified by Target. Target must be ?GL_RENDERBUFFER. Renderbuffer is the name of a renderbuffer object previously returned from a call to gl:genRenderbuffers/1, or zero to break the existing binding of a renderbuffer object to Target.

External documentation.

bindSampler(Unit, Sampler)

-spec bindSampler(Unit :: i(), Sampler :: i()) -> ok.

gl:bindSampler/2 binds Sampler to the texture unit at index Unit. Sampler must be zero or the name of a sampler object previously returned from a call to gl:genSamplers/1. Unit must be less than the value of ?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS.

External documentation.

bindSamplers(First, Samplers)

-spec bindSamplers(First :: i(), Samplers :: [i()]) -> ok.

gl:bindSamplers/2 binds samplers from an array of existing sampler objects to a specified number of consecutive sampler units. Count specifies the number of sampler objects whose names are stored in the array Samplers. That number of sampler names is read from the array and bound to the Count consecutive sampler units starting from First.

External documentation.

bindTexture(Target, Texture)

-spec bindTexture(Target :: enum(), Texture :: i()) -> ok.

gl:bindTexture/2 lets you create or use a named texture. Calling gl:bindTexture/2 with Target set to ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, ?GL_TEXTURE_BUFFER, ?GL_TEXTURE_2D_MULTISAMPLE or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY and Texture set to the name of the new texture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken.

External documentation.

bindTextures(First, Textures)

-spec bindTextures(First :: i(), Textures :: [i()]) -> ok.

gl:bindTextures/2 binds an array of existing texture objects to a specified number of consecutive texture units. Count specifies the number of texture objects whose names are stored in the array Textures. That number of texture names are read from the array and bound to the Count consecutive texture units starting from First. The target, or type of texture is deduced from the texture object and each texture is bound to the corresponding target of the texture unit. If the name zero appears in the Textures array, any existing binding to any target of the texture unit is reset and the default texture for that target is bound in its place. Any non-zero entry in Textures must be the name of an existing texture object. If Textures is ?NULL then it is as if an appropriately sized array containing only zeros had been specified.

External documentation.

bindTextureUnit(Unit, Texture)

-spec bindTextureUnit(Unit :: i(), Texture :: i()) -> ok.

gl:bindTextureUnit/2 binds an existing texture object to the texture unit numbered Unit.

External documentation.

bindTransformFeedback(Target, Id)

-spec bindTransformFeedback(Target :: enum(), Id :: i()) -> ok.

gl:bindTransformFeedback/2 binds the transform feedback object with name Id to the current GL state. Id must be a name previously returned from a call to gl:genTransformFeedbacks/1. If Id has not previously been bound, a new transform feedback object with name Id and initialized with the default transform state vector is created.

External documentation.

bindVertexArray(Array)

-spec bindVertexArray(Array :: i()) -> ok.

gl:bindVertexArray/1 binds the vertex array object with name Array. Array is the name of a vertex array object previously returned from a call to gl:genVertexArrays/1, or zero to break the existing vertex array object binding.

External documentation.

bindVertexBuffer(Bindingindex, Buffer, Offset, Stride)

-spec bindVertexBuffer(Bindingindex :: i(), Buffer :: i(), Offset :: i(), Stride :: i()) -> ok.

Equivalent to vertexArrayVertexBuffer/5.

bindVertexBuffers(First, Buffers, Offsets, Strides)

-spec bindVertexBuffers(First :: i(), Buffers :: [i()], Offsets :: [i()], Strides :: [i()]) -> ok.

Equivalent to vertexArrayVertexBuffers/5.

bitmap(Width, Height, Xorig, Yorig, Xmove, Ymove, Bitmap)

-spec bitmap(Width, Height, Xorig, Yorig, Xmove, Ymove, Bitmap) -> ok
                when
                    Width :: i(),
                    Height :: i(),
                    Xorig :: f(),
                    Yorig :: f(),
                    Xmove :: f(),
                    Ymove :: f(),
                    Bitmap :: offset() | mem().

A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap are not modified.

External documentation.

blendColor(Red, Green, Blue, Alpha)

-spec blendColor(Red :: clamp(), Green :: clamp(), Blue :: clamp(), Alpha :: clamp()) -> ok.

The ?GL_BLEND_COLOR may be used to calculate the source and destination blending factors. The color components are clamped to the range [0 1] before being stored. See gl:blendFunc/2 for a complete description of the blending operations. Initially the ?GL_BLEND_COLOR is set to (0, 0, 0, 0).

External documentation.

blendEquation(Mode)

-spec blendEquation(Mode :: enum()) -> ok.

Equivalent to blendEquationi/2.

blendEquationi(Buf, Mode)

-spec blendEquationi(Buf :: i(), Mode :: enum()) -> ok.

The blend equations determine how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). This function sets both the RGB blend equation and the alpha blend equation to a single equation. gl:blendEquationi/2 specifies the blend equation for a single draw buffer whereas gl:blendEquation/1 sets the blend equation for all draw buffers.

External documentation.

blendEquationSeparate(ModeRGB, ModeAlpha)

-spec blendEquationSeparate(ModeRGB :: enum(), ModeAlpha :: enum()) -> ok.

Equivalent to blendEquationSeparatei/3.

blendEquationSeparatei(Buf, ModeRGB, ModeAlpha)

-spec blendEquationSeparatei(Buf :: i(), ModeRGB :: enum(), ModeAlpha :: enum()) -> ok.

The blend equations determines how a new pixel (the ''source'' color) is combined with a pixel already in the framebuffer (the ''destination'' color). These functions specify one blend equation for the RGB-color components and one blend equation for the alpha component. gl:blendEquationSeparatei/3 specifies the blend equations for a single draw buffer whereas gl:blendEquationSeparate/2 sets the blend equations for all draw buffers.

External documentation.

blendFunc(Sfactor, Dfactor)

-spec blendFunc(Sfactor :: enum(), Dfactor :: enum()) -> ok.

Equivalent to blendFunci/3.

blendFunci(Buf, Src, Dst)

-spec blendFunci(Buf :: i(), Src :: enum(), Dst :: enum()) -> ok.

Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use gl:enable/1 and gl:disable/1 with argument ?GL_BLEND to enable and disable blending.

External documentation.

blendFuncSeparate(SfactorRGB, DfactorRGB, SfactorAlpha, DfactorAlpha)

-spec blendFuncSeparate(SfactorRGB, DfactorRGB, SfactorAlpha, DfactorAlpha) -> ok
                           when
                               SfactorRGB :: enum(),
                               DfactorRGB :: enum(),
                               SfactorAlpha :: enum(),
                               DfactorAlpha :: enum().

Equivalent to blendFuncSeparatei/5.

blendFuncSeparatei(Buf, SrcRGB, DstRGB, SrcAlpha, DstAlpha)

-spec blendFuncSeparatei(Buf :: i(),
                         SrcRGB :: enum(),
                         DstRGB :: enum(),
                         SrcAlpha :: enum(),
                         DstAlpha :: enum()) ->
                            ok.

Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use gl:enable/1 and gl:disable/1 with argument ?GL_BLEND to enable and disable blending.

External documentation.

blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter)

-spec blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter) -> ok
                         when
                             SrcX0 :: i(),
                             SrcY0 :: i(),
                             SrcX1 :: i(),
                             SrcY1 :: i(),
                             DstX0 :: i(),
                             DstY0 :: i(),
                             DstX1 :: i(),
                             DstY1 :: i(),
                             Mask :: i(),
                             Filter :: enum().

gl:blitFramebuffer/10 and glBlitNamedFramebuffer transfer a rectangle of pixel values from one region of a read framebuffer to another region of a draw framebuffer.

External documentation.

bufferData(Target, Size, Data, Usage)

-spec bufferData(Target :: enum(), Size :: i(), Data :: offset() | mem(), Usage :: enum()) -> ok.

gl:bufferData/4 and glNamedBufferData create a new data store for a buffer object. In case of gl:bufferData/4, the buffer object currently bound to Target is used. For glNamedBufferData, a buffer object associated with ID specified by the caller in Buffer will be used instead.

External documentation.

bufferStorage(Target, Size, Data, Flags)

-spec bufferStorage(Target :: enum(), Size :: i(), Data :: offset() | mem(), Flags :: i()) -> ok.

gl:bufferStorage/4 and glNamedBufferStorage create a new immutable data store. For gl:bufferStorage/4, the buffer object currently bound to Target will be initialized. For glNamedBufferStorage, Buffer is the name of the buffer object that will be configured. The size of the data store is specified by Size. If an initial data is available, its address may be supplied in Data. Otherwise, to create an uninitialized data store, Data should be ?NULL.

External documentation.

bufferSubData(Target, Offset, Size, Data)

-spec bufferSubData(Target :: enum(), Offset :: i(), Size :: i(), Data :: offset() | mem()) -> ok.

gl:bufferSubData/4 and glNamedBufferSubData redefine some or all of the data store for the specified buffer object. Data starting at byte offset Offset and extending for Size bytes is copied to the data store from the memory pointed to by Data. Offset and Size must define a range lying entirely within the buffer object's data store.

External documentation.

callList(List)

-spec callList(List :: i()) -> ok.

gl:callList/1 causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list. If List has not been defined as a display list, gl:callList/1 is ignored.

External documentation.

callLists(Lists)

-spec callLists(Lists :: [i()]) -> ok.

gl:callLists/1 causes each display list in the list of names passed as Lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored.

External documentation.

checkFramebufferStatus(Target)

-spec checkFramebufferStatus(Target :: enum()) -> enum().

gl:checkFramebufferStatus/1 and glCheckNamedFramebufferStatus return the completeness status of a framebuffer object when treated as a read or draw framebuffer, depending on the value of Target.

External documentation.

clampColor(Target, Clamp)

-spec clampColor(Target :: enum(), Clamp :: enum()) -> ok.

gl:clampColor/2 controls color clamping that is performed during gl:readPixels/7. Target must be ?GL_CLAMP_READ_COLOR. If Clamp is ?GL_TRUE, read color clamping is enabled; if Clamp is ?GL_FALSE, read color clamping is disabled. If Clamp is ?GL_FIXED_ONLY, read color clamping is enabled only if the selected read buffer has fixed point components and disabled otherwise.

External documentation.

clear(Mask)

-spec clear(Mask :: i()) -> ok.

gl:clear/1 sets the bitplane area of the window to values previously selected by gl:clearColor/4, gl:clearDepth/1, and gl:clearStencil/1. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using gl:drawBuffer/1.

External documentation.

clearAccum(Red, Green, Blue, Alpha)

-spec clearAccum(Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()) -> ok.

gl:clearAccum/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the accumulation buffer.

External documentation.

clearBufferData(Target, Internalformat, Format, Type, Data)

-spec clearBufferData(Target, Internalformat, Format, Type, Data) -> ok
                         when
                             Target :: enum(),
                             Internalformat :: enum(),
                             Format :: enum(),
                             Type :: enum(),
                             Data :: offset() | mem().

Equivalent to clearBufferuiv/3.

clearBufferfi(Buffer, Drawbuffer, Depth, Stencil)

-spec clearBufferfi(Buffer :: enum(), Drawbuffer :: i(), Depth :: f(), Stencil :: i()) -> ok.

Equivalent to clearBufferuiv/3.

clearBufferfv(Buffer, Drawbuffer, Value)

-spec clearBufferfv(Buffer :: enum(), Drawbuffer :: i(), Value :: tuple()) -> ok.

Equivalent to clearBufferuiv/3.

clearBufferiv(Buffer, Drawbuffer, Value)

-spec clearBufferiv(Buffer :: enum(), Drawbuffer :: i(), Value :: tuple()) -> ok.

Equivalent to clearBufferuiv/3.

clearBufferSubData(Target, Internalformat, Offset, Size, Format, Type, Data)

-spec clearBufferSubData(Target, Internalformat, Offset, Size, Format, Type, Data) -> ok
                            when
                                Target :: enum(),
                                Internalformat :: enum(),
                                Offset :: i(),
                                Size :: i(),
                                Format :: enum(),
                                Type :: enum(),
                                Data :: offset() | mem().

Equivalent to clearBufferuiv/3.

clearBufferuiv(Buffer, Drawbuffer, Value)

-spec clearBufferuiv(Buffer :: enum(), Drawbuffer :: i(), Value :: tuple()) -> ok.

These commands clear a specified buffer of a framebuffer to specified value(s). For gl:clearBuffer*(), the framebuffer is the currently bound draw framebuffer object. For glClearNamedFramebuffer*, Framebuffer is zero, indicating the default draw framebuffer, or the name of a framebuffer object.

External documentation.

clearColor(Red, Green, Blue, Alpha)

-spec clearColor(Red :: clamp(), Green :: clamp(), Blue :: clamp(), Alpha :: clamp()) -> ok.

gl:clearColor/4 specifies the red, green, blue, and alpha values used by gl:clear/1 to clear the color buffers. Values specified by gl:clearColor/4 are clamped to the range [0 1].

External documentation.

clearDepth(Depth)

-spec clearDepth(Depth :: clamp()) -> ok.

Equivalent to clearDepthf/1.

clearDepthf(D)

-spec clearDepthf(D :: f()) -> ok.

gl:clearDepth/1 specifies the depth value used by gl:clear/1 to clear the depth buffer. Values specified by gl:clearDepth/1 are clamped to the range [0 1].

External documentation.

clearIndex(C)

-spec clearIndex(C :: f()) -> ok.

gl:clearIndex/1 specifies the index used by gl:clear/1 to clear the color index buffers. C is not clamped. Rather, C is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2 m-1, where m is the number of bits in a color index stored in the frame buffer.

External documentation.

clearStencil(S)

-spec clearStencil(S :: i()) -> ok.

gl:clearStencil/1 specifies the index used by gl:clear/1 to clear the stencil buffer. S is masked with 2 m-1, where m is the number of bits in the stencil buffer.

External documentation.

clearTexImage(Texture, Level, Format, Type, Data)

-spec clearTexImage(Texture :: i(),
                    Level :: i(),
                    Format :: enum(),
                    Type :: enum(),
                    Data :: offset() | mem()) ->
                       ok.

gl:clearTexImage/5 fills all an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. Further, Texture may not be the name of a buffer texture, nor may its internal format be compressed.

External documentation.

clearTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Data)

-spec clearTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type,
                       Data) ->
                          ok
                          when
                              Texture :: i(),
                              Level :: i(),
                              Xoffset :: i(),
                              Yoffset :: i(),
                              Zoffset :: i(),
                              Width :: i(),
                              Height :: i(),
                              Depth :: i(),
                              Format :: enum(),
                              Type :: enum(),
                              Data :: offset() | mem().

gl:clearTexSubImage/11 fills all or part of an image contained in a texture with an application supplied value. Texture must be the name of an existing texture. Further, Texture may not be the name of a buffer texture, nor may its internal format be compressed.

External documentation.

clientActiveTexture(Texture)

-spec clientActiveTexture(Texture :: enum()) -> ok.

gl:clientActiveTexture/1 selects the vertex array client state parameters to be modified by gl:texCoordPointer/4, and enabled or disabled with gl:enableClientState/1 or gl:disableClientState/1, respectively, when called with a parameter of ?GL_TEXTURE_COORD_ARRAY.

External documentation.

clientWaitSync(Sync, Flags, Timeout)

-spec clientWaitSync(Sync :: i(), Flags :: i(), Timeout :: i()) -> enum().

gl:clientWaitSync/3 causes the client to block and wait for the sync object specified by Sync to become signaled. If Sync is signaled when gl:clientWaitSync/3 is called, gl:clientWaitSync/3 returns immediately, otherwise it will block and wait for up to Timeout nanoseconds for Sync to become signaled.

External documentation.

clipControl(Origin, Depth)

-spec clipControl(Origin :: enum(), Depth :: enum()) -> ok.

gl:clipControl/2 controls the clipping volume behavior and the clip coordinate to window coordinate transformation behavior.

External documentation.

clipPlane(Plane, Equation)

-spec clipPlane(Plane :: enum(), Equation :: {f(), f(), f(), f()}) -> ok.

Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. gl:clipPlane/2 allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axis, against which all geometry is clipped. To determine the maximum number of additional clipping planes, call gl:getIntegerv/1 with argument ?GL_MAX_CLIP_PLANES. All implementations support at least six such clipping planes. Because the resulting clipping region is the intersection of the defined half-spaces, it is always convex.

External documentation.

color3b(Red, Green, Blue)

-spec color3b(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3bv/1

-spec color3bv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color3d(Red, Green, Blue)

-spec color3d(Red :: f(), Green :: f(), Blue :: f()) -> ok.

Equivalent to color4usv/1.

color3dv/1

-spec color3dv({Red :: f(), Green :: f(), Blue :: f()}) -> ok.

Equivalent to color4usv/1.

color3f(Red, Green, Blue)

-spec color3f(Red :: f(), Green :: f(), Blue :: f()) -> ok.

Equivalent to color4usv/1.

color3fv/1

-spec color3fv({Red :: f(), Green :: f(), Blue :: f()}) -> ok.

Equivalent to color4usv/1.

color3i(Red, Green, Blue)

-spec color3i(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3iv/1

-spec color3iv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color3s(Red, Green, Blue)

-spec color3s(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3sv/1

-spec color3sv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color3ub(Red, Green, Blue)

-spec color3ub(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3ubv/1

-spec color3ubv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color3ui(Red, Green, Blue)

-spec color3ui(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3uiv/1

-spec color3uiv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color3us(Red, Green, Blue)

-spec color3us(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to color4usv/1.

color3usv/1

-spec color3usv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to color4usv/1.

color4b(Red, Green, Blue, Alpha)

-spec color4b(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4bv/1

-spec color4bv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

Equivalent to color4usv/1.

color4d(Red, Green, Blue, Alpha)

-spec color4d(Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()) -> ok.

Equivalent to color4usv/1.

color4dv/1

-spec color4dv({Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()}) -> ok.

Equivalent to color4usv/1.

color4f(Red, Green, Blue, Alpha)

-spec color4f(Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()) -> ok.

Equivalent to color4usv/1.

color4fv/1

-spec color4fv({Red :: f(), Green :: f(), Blue :: f(), Alpha :: f()}) -> ok.

Equivalent to color4usv/1.

color4i(Red, Green, Blue, Alpha)

-spec color4i(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4iv/1

-spec color4iv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

Equivalent to color4usv/1.

color4s(Red, Green, Blue, Alpha)

-spec color4s(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4sv/1

-spec color4sv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

Equivalent to color4usv/1.

color4ub(Red, Green, Blue, Alpha)

-spec color4ub(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4ubv/1

-spec color4ubv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

Equivalent to color4usv/1.

color4ui(Red, Green, Blue, Alpha)

-spec color4ui(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4uiv/1

-spec color4uiv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

Equivalent to color4usv/1.

color4us(Red, Green, Blue, Alpha)

-spec color4us(Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()) -> ok.

Equivalent to color4usv/1.

color4usv/1

-spec color4usv({Red :: i(), Green :: i(), Blue :: i(), Alpha :: i()}) -> ok.

The GL stores both a current single-valued color index and a current four-valued RGBA color. gl:color() sets a new four-valued RGBA color. gl:color() has two major variants: gl:color3() and gl:color4(). gl:color3() variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly. gl:color4() variants specify all four color components explicitly.

External documentation.

colorMask(Red, Green, Blue, Alpha)

-spec colorMask(Red :: 0 | 1, Green :: 0 | 1, Blue :: 0 | 1, Alpha :: 0 | 1) -> ok.

Equivalent to colorMaski/5.

colorMaski(Index, R, G, B, A)

-spec colorMaski(Index :: i(), R :: 0 | 1, G :: 0 | 1, B :: 0 | 1, A :: 0 | 1) -> ok.

gl:colorMask/4 and gl:colorMaski/5 specify whether the individual color components in the frame buffer can or cannot be written. gl:colorMaski/5 sets the mask for a specific draw buffer, whereas gl:colorMask/4 sets the mask for all draw buffers. If Red is ?GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted.

External documentation.

colorMaterial(Face, Mode)

-spec colorMaterial(Face :: enum(), Mode :: enum()) -> ok.

gl:colorMaterial/2 specifies which material parameters track the current color. When ?GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by Mode, of the material or materials specified by Face, track the current color at all times.

External documentation.

colorPointer(Size, Type, Stride, Ptr)

-spec colorPointer(Size :: i(), Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:colorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3 or 4. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

External documentation.

colorSubTable(Target, Start, Count, Format, Type, Data)

-spec colorSubTable(Target, Start, Count, Format, Type, Data) -> ok
                       when
                           Target :: enum(),
                           Start :: i(),
                           Count :: i(),
                           Format :: enum(),
                           Type :: enum(),
                           Data :: offset() | mem().

gl:colorSubTable/6 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels referenced by Data replace the portion of the existing table from indices Start to start+count-1, inclusive. This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

External documentation.

colorTable(Target, Internalformat, Width, Format, Type, Table)

-spec colorTable(Target, Internalformat, Width, Format, Type, Table) -> ok
                    when
                        Target :: enum(),
                        Internalformat :: enum(),
                        Width :: i(),
                        Format :: enum(),
                        Type :: enum(),
                        Table :: offset() | mem().

gl:colorTable/6 may be used in two ways: to test the actual size and color resolution of a lookup table given a particular set of parameters, or to load the contents of a color lookup table. Use the targets ?GL_PROXY_* for the first case and the other targets for the second case.

External documentation.

colorTableParameterfv(Target, Pname, Params)

-spec colorTableParameterfv(Target :: enum(), Pname :: enum(), Params :: {f(), f(), f(), f()}) -> ok.

Equivalent to colorTableParameteriv/3.

colorTableParameteriv(Target, Pname, Params)

-spec colorTableParameteriv(Target :: enum(), Pname :: enum(), Params :: {i(), i(), i(), i()}) -> ok.

gl:colorTableParameter() is used to specify the scale factors and bias terms applied to color components when they are loaded into a color table. Target indicates which color table the scale and bias terms apply to; it must be set to ?GL_COLOR_TABLE, ?GL_POST_CONVOLUTION_COLOR_TABLE, or ?GL_POST_COLOR_MATRIX_COLOR_TABLE.

External documentation.

compileShader(Shader)

-spec compileShader(Shader :: i()) -> ok.

gl:compileShader/1 compiles the source code strings that have been stored in the shader object specified by Shader.

External documentation.

compressedTexImage1D(Target, Level, Internalformat, Width, Border, ImageSize, Data)

-spec compressedTexImage1D(Target, Level, Internalformat, Width, Border, ImageSize, Data) -> ok
                              when
                                  Target :: enum(),
                                  Level :: i(),
                                  Internalformat :: enum(),
                                  Width :: i(),
                                  Border :: i(),
                                  ImageSize :: i(),
                                  Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

compressedTexImage2D(Target, Level, Internalformat, Width, Height, Border, ImageSize, Data)

-spec compressedTexImage2D(Target, Level, Internalformat, Width, Height, Border, ImageSize, Data) -> ok
                              when
                                  Target :: enum(),
                                  Level :: i(),
                                  Internalformat :: enum(),
                                  Width :: i(),
                                  Height :: i(),
                                  Border :: i(),
                                  ImageSize :: i(),
                                  Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

compressedTexImage3D(Target, Level, Internalformat, Width, Height, Depth, Border, ImageSize, Data)

-spec compressedTexImage3D(Target, Level, Internalformat, Width, Height, Depth, Border, ImageSize, Data) ->
                              ok
                              when
                                  Target :: enum(),
                                  Level :: i(),
                                  Internalformat :: enum(),
                                  Width :: i(),
                                  Height :: i(),
                                  Depth :: i(),
                                  Border :: i(),
                                  ImageSize :: i(),
                                  Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

compressedTexSubImage1D(Target, Level, Xoffset, Width, Format, ImageSize, Data)

-spec compressedTexSubImage1D(Target, Level, Xoffset, Width, Format, ImageSize, Data) -> ok
                                 when
                                     Target :: enum(),
                                     Level :: i(),
                                     Xoffset :: i(),
                                     Width :: i(),
                                     Format :: enum(),
                                     ImageSize :: i(),
                                     Data :: offset() | mem().

Equivalent to compressedTextureSubImage1D/7.

compressedTexSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data)

-spec compressedTexSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data) ->
                                 ok
                                 when
                                     Target :: enum(),
                                     Level :: i(),
                                     Xoffset :: i(),
                                     Yoffset :: i(),
                                     Width :: i(),
                                     Height :: i(),
                                     Format :: enum(),
                                     ImageSize :: i(),
                                     Data :: offset() | mem().

Equivalent to compressedTextureSubImage2D/9.

compressedTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, ImageSize, Data)

-spec compressedTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format,
                              ImageSize, Data) ->
                                 ok
                                 when
                                     Target :: enum(),
                                     Level :: i(),
                                     Xoffset :: i(),
                                     Yoffset :: i(),
                                     Zoffset :: i(),
                                     Width :: i(),
                                     Height :: i(),
                                     Depth :: i(),
                                     Format :: enum(),
                                     ImageSize :: i(),
                                     Data :: offset() | mem().

Equivalent to compressedTextureSubImage3D/11.

compressedTextureSubImage1D(Texture, Level, Xoffset, Width, Format, ImageSize, Data)

-spec compressedTextureSubImage1D(Texture, Level, Xoffset, Width, Format, ImageSize, Data) -> ok
                                     when
                                         Texture :: i(),
                                         Level :: i(),
                                         Xoffset :: i(),
                                         Width :: i(),
                                         Format :: enum(),
                                         ImageSize :: i(),
                                         Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

compressedTextureSubImage2D(Texture, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data)

-spec compressedTextureSubImage2D(Texture, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize,
                                  Data) ->
                                     ok
                                     when
                                         Texture :: i(),
                                         Level :: i(),
                                         Xoffset :: i(),
                                         Yoffset :: i(),
                                         Width :: i(),
                                         Height :: i(),
                                         Format :: enum(),
                                         ImageSize :: i(),
                                         Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

compressedTextureSubImage3D(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, ImageSize, Data)

-spec compressedTextureSubImage3D(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth,
                                  Format, ImageSize, Data) ->
                                     ok
                                     when
                                         Texture :: i(),
                                         Level :: i(),
                                         Xoffset :: i(),
                                         Yoffset :: i(),
                                         Zoffset :: i(),
                                         Width :: i(),
                                         Height :: i(),
                                         Depth :: i(),
                                         Format :: enum(),
                                         ImageSize :: i(),
                                         Data :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

convolutionFilter1D(Target, Internalformat, Width, Format, Type, Image)

-spec convolutionFilter1D(Target, Internalformat, Width, Format, Type, Image) -> ok
                             when
                                 Target :: enum(),
                                 Internalformat :: enum(),
                                 Width :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Image :: offset() | mem().

gl:convolutionFilter1D/6 builds a one-dimensional convolution filter kernel from an array of pixels.

External documentation.

convolutionFilter2D(Target, Internalformat, Width, Height, Format, Type, Image)

-spec convolutionFilter2D(Target, Internalformat, Width, Height, Format, Type, Image) -> ok
                             when
                                 Target :: enum(),
                                 Internalformat :: enum(),
                                 Width :: i(),
                                 Height :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Image :: offset() | mem().

gl:convolutionFilter2D/7 builds a two-dimensional convolution filter kernel from an array of pixels.

External documentation.

convolutionParameterf(Target, Pname, Params)

-spec convolutionParameterf(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to convolutionParameteriv/3.

convolutionParameterfv(Target, Pname, Params)

-spec convolutionParameterfv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to convolutionParameteriv/3.

convolutionParameteri(Target, Pname, Params)

-spec convolutionParameteri(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to convolutionParameteriv/3.

convolutionParameteriv(Target, Pname, Params)

-spec convolutionParameteriv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

gl:convolutionParameter() sets the value of a convolution parameter.

External documentation.

copyBufferSubData(ReadTarget, WriteTarget, ReadOffset, WriteOffset, Size)

-spec copyBufferSubData(ReadTarget, WriteTarget, ReadOffset, WriteOffset, Size) -> ok
                           when
                               ReadTarget :: enum(),
                               WriteTarget :: enum(),
                               ReadOffset :: i(),
                               WriteOffset :: i(),
                               Size :: i().

gl:copyBufferSubData/5 and glCopyNamedBufferSubData copy part of the data store attached to a source buffer object to the data store attached to a destination buffer object. The number of basic machine units indicated by Size is copied from the source at offset ReadOffset to the destination at WriteOffset. ReadOffset, WriteOffset and Size are in terms of basic machine units.

External documentation.

copyColorSubTable(Target, Start, X, Y, Width)

-spec copyColorSubTable(Target :: enum(), Start :: i(), X :: i(), Y :: i(), Width :: i()) -> ok.

gl:copyColorSubTable/5 is used to respecify a contiguous portion of a color table previously defined using gl:colorTable/6. The pixels copied from the framebuffer replace the portion of the existing table from indices Start to start+x-1, inclusive. This region may not include any entries outside the range of the color table, as was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

External documentation.

copyColorTable(Target, Internalformat, X, Y, Width)

-spec copyColorTable(Target :: enum(), Internalformat :: enum(), X :: i(), Y :: i(), Width :: i()) -> ok.

gl:copyColorTable/5 loads a color table with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:colorTable/6).

External documentation.

copyConvolutionFilter1D(Target, Internalformat, X, Y, Width)

-spec copyConvolutionFilter1D(Target :: enum(),
                              Internalformat :: enum(),
                              X :: i(),
                              Y :: i(),
                              Width :: i()) ->
                                 ok.

gl:copyConvolutionFilter1D/5 defines a one-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter1D/6).

External documentation.

copyConvolutionFilter2D(Target, Internalformat, X, Y, Width, Height)

-spec copyConvolutionFilter2D(Target :: enum(),
                              Internalformat :: enum(),
                              X :: i(),
                              Y :: i(),
                              Width :: i(),
                              Height :: i()) ->
                                 ok.

gl:copyConvolutionFilter2D/6 defines a two-dimensional convolution filter kernel with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:convolutionFilter2D/7).

External documentation.

copyImageSubData(SrcName, SrcTarget, SrcLevel, SrcX, SrcY, SrcZ, DstName, DstTarget, DstLevel, DstX, DstY, DstZ, SrcWidth, SrcHeight, SrcDepth)

-spec copyImageSubData(SrcName, SrcTarget, SrcLevel, SrcX, SrcY, SrcZ, DstName, DstTarget, DstLevel,
                       DstX, DstY, DstZ, SrcWidth, SrcHeight, SrcDepth) ->
                          ok
                          when
                              SrcName :: i(),
                              SrcTarget :: enum(),
                              SrcLevel :: i(),
                              SrcX :: i(),
                              SrcY :: i(),
                              SrcZ :: i(),
                              DstName :: i(),
                              DstTarget :: enum(),
                              DstLevel :: i(),
                              DstX :: i(),
                              DstY :: i(),
                              DstZ :: i(),
                              SrcWidth :: i(),
                              SrcHeight :: i(),
                              SrcDepth :: i().

gl:copyImageSubData/15 may be used to copy data from one image (i.e. texture or renderbuffer) to another. gl:copyImageSubData/15 does not perform general-purpose conversions such as scaling, resizing, blending, color-space, or format conversions. It should be considered to operate in a manner similar to a CPU memcpy. CopyImageSubData can copy between images with different internal formats, provided the formats are compatible.

External documentation.

copyPixels(X, Y, Width, Height, Type)

-spec copyPixels(X :: i(), Y :: i(), Width :: i(), Height :: i(), Type :: enum()) -> ok.

gl:copyPixels/5 copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined.

External documentation.

copyTexImage1D(Target, Level, Internalformat, X, Y, Width, Border)

-spec copyTexImage1D(Target, Level, Internalformat, X, Y, Width, Border) -> ok
                        when
                            Target :: enum(),
                            Level :: i(),
                            Internalformat :: enum(),
                            X :: i(),
                            Y :: i(),
                            Width :: i(),
                            Border :: i().

gl:copyTexImage1D/7 defines a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER.

External documentation.

copyTexImage2D(Target, Level, Internalformat, X, Y, Width, Height, Border)

-spec copyTexImage2D(Target, Level, Internalformat, X, Y, Width, Height, Border) -> ok
                        when
                            Target :: enum(),
                            Level :: i(),
                            Internalformat :: enum(),
                            X :: i(),
                            Y :: i(),
                            Width :: i(),
                            Height :: i(),
                            Border :: i().

gl:copyTexImage2D/8 defines a two-dimensional texture image, or cube-map texture image with pixels from the current ?GL_READ_BUFFER.

External documentation.

copyTexSubImage1D(Target, Level, Xoffset, X, Y, Width)

-spec copyTexSubImage1D(Target :: enum(),
                        Level :: i(),
                        Xoffset :: i(),
                        X :: i(),
                        Y :: i(),
                        Width :: i()) ->
                           ok.

gl:copyTexSubImage1D/6 and glCopyTextureSubImage1D replace a portion of a one-dimensional texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage1D/7). For gl:copyTexSubImage1D/6, the texture object that is bound to Target will be used for the process. For glCopyTextureSubImage1D, Texture tells which texture object should be used for the purpose of the call.

External documentation.

copyTexSubImage2D(Target, Level, Xoffset, Yoffset, X, Y, Width, Height)

-spec copyTexSubImage2D(Target, Level, Xoffset, Yoffset, X, Y, Width, Height) -> ok
                           when
                               Target :: enum(),
                               Level :: i(),
                               Xoffset :: i(),
                               Yoffset :: i(),
                               X :: i(),
                               Y :: i(),
                               Width :: i(),
                               Height :: i().

gl:copyTexSubImage2D/8 and glCopyTextureSubImage2D replace a rectangular portion of a two-dimensional texture image, cube-map texture image, rectangular image, or a linear portion of a number of slices of a one-dimensional array texture with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage2D/9).

External documentation.

copyTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, X, Y, Width, Height)

-spec copyTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, X, Y, Width, Height) -> ok
                           when
                               Target :: enum(),
                               Level :: i(),
                               Xoffset :: i(),
                               Yoffset :: i(),
                               Zoffset :: i(),
                               X :: i(),
                               Y :: i(),
                               Width :: i(),
                               Height :: i().

gl:copyTexSubImage3D/9 and glCopyTextureSubImage3D functions replace a rectangular portion of a three-dimensional or two-dimensional array texture image with pixels from the current ?GL_READ_BUFFER (rather than from main memory, as is the case for gl:texSubImage3D/11).

External documentation.

createBuffers(N)

-spec createBuffers(N :: i()) -> [i()].

gl:createBuffers/1 returns N previously unused buffer names in Buffers, each representing a new buffer object initialized as if it had been bound to an unspecified target.

External documentation.

createFramebuffers(N)

-spec createFramebuffers(N :: i()) -> [i()].

gl:createFramebuffers/1 returns N previously unused framebuffer names in Framebuffers, each representing a new framebuffer object initialized to the default state.

External documentation.

createProgram()

-spec createProgram() -> i().

gl:createProgram/0 creates an empty program object and returns a non-zero value by which it can be referenced. A program object is an object to which shader objects can be attached. This provides a mechanism to specify the shader objects that will be linked to create a program. It also provides a means for checking the compatibility of the shaders that will be used to create a program (for instance, checking the compatibility between a vertex shader and a fragment shader). When no longer needed as part of a program object, shader objects can be detached.

External documentation.

createProgramPipelines(N)

-spec createProgramPipelines(N :: i()) -> [i()].

gl:createProgramPipelines/1 returns N previously unused program pipeline names in Pipelines, each representing a new program pipeline object initialized to the default state.

External documentation.

createQueries(Target, N)

-spec createQueries(Target :: enum(), N :: i()) -> [i()].

gl:createQueries/2 returns N previously unused query object names in Ids, each representing a new query object with the specified Target.

External documentation.

createRenderbuffers(N)

-spec createRenderbuffers(N :: i()) -> [i()].

gl:createRenderbuffers/1 returns N previously unused renderbuffer object names in Renderbuffers, each representing a new renderbuffer object initialized to the default state.

External documentation.

createSamplers(N)

-spec createSamplers(N :: i()) -> [i()].

gl:createSamplers/1 returns N previously unused sampler names in Samplers, each representing a new sampler object initialized to the default state.

External documentation.

createShader(Type)

-spec createShader(Type :: enum()) -> i().

gl:createShader/1 creates an empty shader object and returns a non-zero value by which it can be referenced. A shader object is used to maintain the source code strings that define a shader. ShaderType indicates the type of shader to be created. Five types of shader are supported. A shader of type ?GL_COMPUTE_SHADER is a shader that is intended to run on the programmable compute processor. A shader of type ?GL_VERTEX_SHADER is a shader that is intended to run on the programmable vertex processor. A shader of type ?GL_TESS_CONTROL_SHADER is a shader that is intended to run on the programmable tessellation processor in the control stage. A shader of type ?GL_TESS_EVALUATION_SHADER is a shader that is intended to run on the programmable tessellation processor in the evaluation stage. A shader of type ?GL_GEOMETRY_SHADER is a shader that is intended to run on the programmable geometry processor. A shader of type ?GL_FRAGMENT_SHADER is a shader that is intended to run on the programmable fragment processor.

External documentation.

createShaderProgramv(Type, Strings)

-spec createShaderProgramv(Type :: enum(), Strings :: [unicode:chardata()]) -> i().

gl:createShaderProgram() creates a program object containing compiled and linked shaders for a single stage specified by Type. Strings refers to an array of Count strings from which to create the shader executables.

External documentation.

createTextures(Target, N)

-spec createTextures(Target :: enum(), N :: i()) -> [i()].

gl:createTextures/2 returns N previously unused texture names in Textures, each representing a new texture object of the dimensionality and type specified by Target and initialized to the default values for that texture type.

External documentation.

createTransformFeedbacks(N)

-spec createTransformFeedbacks(N :: i()) -> [i()].

gl:createTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids, each representing a new transform feedback object initialized to the default state.

External documentation.

createVertexArrays(N)

-spec createVertexArrays(N :: i()) -> [i()].

gl:createVertexArrays/1 returns N previously unused vertex array object names in Arrays, each representing a new vertex array object initialized to the default state.

External documentation.

cullFace(Mode)

-spec cullFace(Mode :: enum()) -> ok.

gl:cullFace/1 specifies whether front- or back-facing facets are culled (as specified by mode) when facet culling is enabled. Facet culling is initially disabled. To enable and disable facet culling, call the gl:enable/1 and gl:disable/1 commands with the argument ?GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles.

External documentation.

debugMessageControl(Source, Type, Severity, Ids, Enabled)

-spec debugMessageControl(Source :: enum(),
                          Type :: enum(),
                          Severity :: enum(),
                          Ids :: [i()],
                          Enabled :: 0 | 1) ->
                             ok.

gl:debugMessageControl/5 controls the reporting of debug messages generated by a debug context. The parameters Source, Type and Severity form a filter to select messages from the pool of potential messages generated by the GL.

External documentation.

debugMessageInsert(Source, Type, Id, Severity, Buf)

-spec debugMessageInsert(Source :: enum(),
                         Type :: enum(),
                         Id :: i(),
                         Severity :: enum(),
                         Buf :: string()) ->
                            ok.

gl:debugMessageInsert/5 inserts a user-supplied message into the debug output queue. Source specifies the source that will be used to classify the message and must be ?GL_DEBUG_SOURCE_APPLICATION or ?GL_DEBUG_SOURCE_THIRD_PARTY. All other sources are reserved for use by the GL implementation. Type indicates the type of the message to be inserted and may be one of ?GL_DEBUG_TYPE_ERROR, ?GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, ?GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, ?GL_DEBUG_TYPE_PORTABILITY, ?GL_DEBUG_TYPE_PERFORMANCE, ?GL_DEBUG_TYPE_MARKER, ?GL_DEBUG_TYPE_PUSH_GROUP, ?GL_DEBUG_TYPE_POP_GROUP, or ?GL_DEBUG_TYPE_OTHER. Severity indicates the severity of the message and may be ?GL_DEBUG_SEVERITY_LOW, ?GL_DEBUG_SEVERITY_MEDIUM, ?GL_DEBUG_SEVERITY_HIGH or ?GL_DEBUG_SEVERITY_NOTIFICATION. Id is available for application defined use and may be any value. This value will be recorded and used to identify the message.

External documentation.

deleteBuffers(Buffers)

-spec deleteBuffers(Buffers :: [i()]) -> ok.

gl:deleteBuffers/1 deletes N buffer objects named by the elements of the array Buffers. After a buffer object is deleted, it has no contents, and its name is free for reuse (for example by gl:genBuffers/1). If a buffer object that is currently bound is deleted, the binding reverts to 0 (the absence of any buffer object).

External documentation.

deleteFramebuffers(Framebuffers)

-spec deleteFramebuffers(Framebuffers :: [i()]) -> ok.

gl:deleteFramebuffers/1 deletes the N framebuffer objects whose names are stored in the array addressed by Framebuffers. The name zero is reserved by the GL and is silently ignored, should it occur in Framebuffers, as are other unused names. Once a framebuffer object is deleted, its name is again unused and it has no attachments. If a framebuffer that is currently bound to one or more of the targets ?GL_DRAW_FRAMEBUFFER or ?GL_READ_FRAMEBUFFER is deleted, it is as though gl:bindFramebuffer/2 had been executed with the corresponding Target and Framebuffer zero.

External documentation.

deleteLists(List, Range)

-spec deleteLists(List :: i(), Range :: i()) -> ok.

gl:deleteLists/2 causes a contiguous group of display lists to be deleted. List is the name of the first display list to be deleted, and Range is the number of display lists to delete. All display lists d with list&lt;= d&lt;= list+range-1 are deleted.

External documentation.

deleteProgram(Program)

-spec deleteProgram(Program :: i()) -> ok.

gl:deleteProgram/1 frees the memory and invalidates the name associated with the program object specified by Program. This command effectively undoes the effects of a call to gl:createProgram/0.

External documentation.

deleteProgramPipelines(Pipelines)

-spec deleteProgramPipelines(Pipelines :: [i()]) -> ok.

gl:deleteProgramPipelines/1 deletes the N program pipeline objects whose names are stored in the array Pipelines. Unused names in Pipelines are ignored, as is the name zero. After a program pipeline object is deleted, its name is again unused and it has no contents. If program pipeline object that is currently bound is deleted, the binding for that object reverts to zero and no program pipeline object becomes current.

External documentation.

deleteQueries(Ids)

-spec deleteQueries(Ids :: [i()]) -> ok.

gl:deleteQueries/1 deletes N query objects named by the elements of the array Ids. After a query object is deleted, it has no contents, and its name is free for reuse (for example by gl:genQueries/1).

External documentation.

deleteRenderbuffers(Renderbuffers)

-spec deleteRenderbuffers(Renderbuffers :: [i()]) -> ok.

gl:deleteRenderbuffers/1 deletes the N renderbuffer objects whose names are stored in the array addressed by Renderbuffers. The name zero is reserved by the GL and is silently ignored, should it occur in Renderbuffers, as are other unused names. Once a renderbuffer object is deleted, its name is again unused and it has no contents. If a renderbuffer that is currently bound to the target ?GL_RENDERBUFFER is deleted, it is as though gl:bindRenderbuffer/2 had been executed with a Target of ?GL_RENDERBUFFER and a Name of zero.

External documentation.

deleteSamplers(Samplers)

-spec deleteSamplers(Samplers :: [i()]) -> ok.

gl:deleteSamplers/1 deletes N sampler objects named by the elements of the array Samplers. After a sampler object is deleted, its name is again unused. If a sampler object that is currently bound to a sampler unit is deleted, it is as though gl:bindSampler/2 is called with unit set to the unit the sampler is bound to and sampler zero. Unused names in samplers are silently ignored, as is the reserved name zero.

External documentation.

deleteShader(Shader)

-spec deleteShader(Shader :: i()) -> ok.

gl:deleteShader/1 frees the memory and invalidates the name associated with the shader object specified by Shader. This command effectively undoes the effects of a call to gl:createShader/1.

External documentation.

deleteSync(Sync)

-spec deleteSync(Sync :: i()) -> ok.

gl:deleteSync/1 deletes the sync object specified by Sync. If the fence command corresponding to the specified sync object has completed, or if no gl:waitSync/3 or gl:clientWaitSync/3 commands are blocking on Sync, the object is deleted immediately. Otherwise, Sync is flagged for deletion and will be deleted when it is no longer associated with any fence command and is no longer blocking any gl:waitSync/3 or gl:clientWaitSync/3 command. In either case, after gl:deleteSync/1 returns, the name Sync is invalid and can no longer be used to refer to the sync object.

External documentation.

deleteTextures(Textures)

-spec deleteTextures(Textures :: [i()]) -> ok.

gl:deleteTextures/1 deletes N textures named by the elements of the array Textures. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (for example by gl:genTextures/1). If a texture that is currently bound is deleted, the binding reverts to 0 (the default texture).

External documentation.

deleteTransformFeedbacks(Ids)

-spec deleteTransformFeedbacks(Ids :: [i()]) -> ok.

gl:deleteTransformFeedbacks/1 deletes the N transform feedback objects whose names are stored in the array Ids. Unused names in Ids are ignored, as is the name zero. After a transform feedback object is deleted, its name is again unused and it has no contents. If an active transform feedback object is deleted, its name immediately becomes unused, but the underlying object is not deleted until it is no longer active.

External documentation.

deleteVertexArrays(Arrays)

-spec deleteVertexArrays(Arrays :: [i()]) -> ok.

gl:deleteVertexArrays/1 deletes N vertex array objects whose names are stored in the array addressed by Arrays. Once a vertex array object is deleted it has no contents and its name is again unused. If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero and the default vertex array becomes current. Unused names in Arrays are silently ignored, as is the value zero.

External documentation.

depthFunc(Func)

-spec depthFunc(Func :: enum()) -> ok.

gl:depthFunc/1 specifies the function used to compare each incoming pixel depth value with the depth value present in the depth buffer. The comparison is performed only if depth testing is enabled. (See gl:enable/1 and gl:disable/1 of ?GL_DEPTH_TEST.)

External documentation.

depthMask(Flag)

-spec depthMask(Flag :: 0 | 1) -> ok.

gl:depthMask/1 specifies whether the depth buffer is enabled for writing. If Flag is ?GL_FALSE, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

External documentation.

depthRange(Near_val, Far_val)

-spec depthRange(Near_val :: clamp(), Far_val :: clamp()) -> ok.

Equivalent to depthRangef/2.

depthRangeArrayv(First, V)

-spec depthRangeArrayv(First :: i(), V :: [{f(), f()}]) -> ok.

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. Each viewport has an independent depth range specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). gl:depthRangeArray() specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates for each viewport in the range [First, First + Count). Thus, the values accepted by gl:depthRangeArray() are both clamped to this range before they are accepted.

External documentation.

depthRangef(N, F)

-spec depthRangef(N :: f(), F :: f()) -> ok.

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. gl:depthRange/2 specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). Thus, the values accepted by gl:depthRange/2 are both clamped to this range before they are accepted.

External documentation.

depthRangeIndexed(Index, N, F)

-spec depthRangeIndexed(Index :: i(), N :: f(), F :: f()) -> ok.

After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. Each viewport has an independent depth range specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). gl:depthRangeIndexed/3 specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates for a specified viewport. Thus, the values accepted by gl:depthRangeIndexed/3 are both clamped to this range before they are accepted.

External documentation.

detachShader(Program, Shader)

-spec detachShader(Program :: i(), Shader :: i()) -> ok.

gl:detachShader/2 detaches the shader object specified by Shader from the program object specified by Program. This command can be used to undo the effect of the command gl:attachShader/2.

External documentation.

disable(Cap)

-spec disable(Cap :: enum()) -> ok.

Equivalent to enablei/2.

disableClientState(Cap)

-spec disableClientState(Cap :: enum()) -> ok.

Equivalent to enableClientState/1.

disablei(Target, Index)

-spec disablei(Target :: enum(), Index :: i()) -> ok.

Equivalent to enablei/2.

disableVertexArrayAttrib(Vaobj, Index)

-spec disableVertexArrayAttrib(Vaobj :: i(), Index :: i()) -> ok.

Equivalent to enableVertexAttribArray/1.

disableVertexAttribArray(Index)

-spec disableVertexAttribArray(Index :: i()) -> ok.

Equivalent to enableVertexAttribArray/1.

dispatchCompute(Num_groups_x, Num_groups_y, Num_groups_z)

-spec dispatchCompute(Num_groups_x :: i(), Num_groups_y :: i(), Num_groups_z :: i()) -> ok.

gl:dispatchCompute/3 launches one or more compute work groups. Each work group is processed by the active program object for the compute shader stage. While the individual shader invocations within a work group are executed as a unit, work groups are executed completely independently and in unspecified order. Num_groups_x, Num_groups_y and Num_groups_z specify the number of local work groups that will be dispatched in the X, Y and Z dimensions, respectively.

External documentation.

dispatchComputeIndirect(Indirect)

-spec dispatchComputeIndirect(Indirect :: i()) -> ok.

gl:dispatchComputeIndirect/1 launches one or more compute work groups using parameters stored in the buffer object currently bound to the ?GL_DISPATCH_INDIRECT_BUFFER target. Each work group is processed by the active program object for the compute shader stage. While the individual shader invocations within a work group are executed as a unit, work groups are executed completely independently and in unspecified order. Indirect contains the offset into the data store of the buffer object bound to the ?GL_DISPATCH_INDIRECT_BUFFER target at which the parameters are stored.

External documentation.

drawArrays(Mode, First, Count)

-spec drawArrays(Mode :: enum(), First :: i(), Count :: i()) -> ok.

gl:drawArrays/3 specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to gl:drawArrays/3.

External documentation.

drawArraysIndirect(Mode, Indirect)

-spec drawArraysIndirect(Mode :: enum(), Indirect :: offset() | mem()) -> ok.

gl:drawArraysIndirect/2 specifies multiple geometric primitives with very few subroutine calls. gl:drawArraysIndirect/2 behaves similarly to gl:drawArraysInstancedBaseInstance/5, execept that the parameters to gl:drawArraysInstancedBaseInstance/5 are stored in memory at the address given by Indirect.

External documentation.

drawArraysInstanced(Mode, First, Count, Instancecount)

-spec drawArraysInstanced(Mode :: enum(), First :: i(), Count :: i(), Instancecount :: i()) -> ok.

gl:drawArraysInstanced/4 behaves identically to gl:drawArrays/3 except that Instancecount instances of the range of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

External documentation.

drawArraysInstancedBaseInstance(Mode, First, Count, Instancecount, Baseinstance)

-spec drawArraysInstancedBaseInstance(Mode :: enum(),
                                      First :: i(),
                                      Count :: i(),
                                      Instancecount :: i(),
                                      Baseinstance :: i()) ->
                                         ok.

gl:drawArraysInstancedBaseInstance/5 behaves identically to gl:drawArrays/3 except that Instancecount instances of the range of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

External documentation.

drawBuffer(Mode)

-spec drawBuffer(Mode :: enum()) -> ok.

When colors are written to the frame buffer, they are written into the color buffers specified by gl:drawBuffer/1. One of the following values can be used for default framebuffer:

External documentation.

drawBuffers(Bufs)

-spec drawBuffers(Bufs :: [enum()]) -> ok.

gl:drawBuffers/1 and glNamedFramebufferDrawBuffers define an array of buffers into which outputs from the fragment shader data will be written. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within Bufs corresponding to the location assigned to that user defined output. The draw buffer used for user defined outputs assigned to locations greater than or equal to N is implicitly set to ?GL_NONE and any data written to such an output is discarded.

External documentation.

drawElements(Mode, Count, Type, Indices)

-spec drawElements(Mode :: enum(), Count :: i(), Type :: enum(), Indices :: offset() | mem()) -> ok.

gl:drawElements/4 specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and so on, and use them to construct a sequence of primitives with a single call to gl:drawElements/4.

External documentation.

drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex)

-spec drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex) -> ok
                                when
                                    Mode :: enum(),
                                    Count :: i(),
                                    Type :: enum(),
                                    Indices :: offset() | mem(),
                                    Basevertex :: i().

gl:drawElementsBaseVertex/5 behaves identically to gl:drawElements/4 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

External documentation.

drawElementsIndirect(Mode, Type, Indirect)

-spec drawElementsIndirect(Mode :: enum(), Type :: enum(), Indirect :: offset() | mem()) -> ok.

gl:drawElementsIndirect/3 specifies multiple indexed geometric primitives with very few subroutine calls. gl:drawElementsIndirect/3 behaves similarly to gl:drawElementsInstancedBaseVertexBaseInstance/7, execpt that the parameters to gl:drawElementsInstancedBaseVertexBaseInstance/7 are stored in memory at the address given by Indirect.

External documentation.

drawElementsInstanced(Mode, Count, Type, Indices, Instancecount)

-spec drawElementsInstanced(Mode, Count, Type, Indices, Instancecount) -> ok
                               when
                                   Mode :: enum(),
                                   Count :: i(),
                                   Type :: enum(),
                                   Indices :: offset() | mem(),
                                   Instancecount :: i().

gl:drawElementsInstanced/5 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

External documentation.

drawElementsInstancedBaseInstance(Mode, Count, Type, Indices, Instancecount, Baseinstance)

-spec drawElementsInstancedBaseInstance(Mode, Count, Type, Indices, Instancecount, Baseinstance) -> ok
                                           when
                                               Mode :: enum(),
                                               Count :: i(),
                                               Type :: enum(),
                                               Indices :: offset() | mem(),
                                               Instancecount :: i(),
                                               Baseinstance :: i().

gl:drawElementsInstancedBaseInstance/6 behaves identically to gl:drawElements/4 except that Instancecount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID.

External documentation.

drawElementsInstancedBaseVertex(Mode, Count, Type, Indices, Instancecount, Basevertex)

-spec drawElementsInstancedBaseVertex(Mode, Count, Type, Indices, Instancecount, Basevertex) -> ok
                                         when
                                             Mode :: enum(),
                                             Count :: i(),
                                             Type :: enum(),
                                             Indices :: offset() | mem(),
                                             Instancecount :: i(),
                                             Basevertex :: i().

gl:drawElementsInstancedBaseVertex/6 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

External documentation.

drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type, Indices, Instancecount, Basevertex, Baseinstance)

-spec drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type, Indices, Instancecount, Basevertex,
                                                  Baseinstance) ->
                                                     ok
                                                     when
                                                         Mode :: enum(),
                                                         Count :: i(),
                                                         Type :: enum(),
                                                         Indices :: offset() | mem(),
                                                         Instancecount :: i(),
                                                         Basevertex :: i(),
                                                         Baseinstance :: i().

gl:drawElementsInstancedBaseVertexBaseInstance/7 behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

External documentation.

drawPixels(Width, Height, Format, Type, Pixels)

-spec drawPixels(Width :: i(),
                 Height :: i(),
                 Format :: enum(),
                 Type :: enum(),
                 Pixels :: offset() | mem()) ->
                    ok.

gl:drawPixels/5 reads pixel data from memory and writes it into the frame buffer relative to the current raster position, provided that the raster position is valid. Use gl:rasterPos() or gl:windowPos() to set the current raster position; use gl:get() with argument ?GL_CURRENT_RASTER_POSITION_VALID to determine if the specified raster position is valid, and gl:get() with argument ?GL_CURRENT_RASTER_POSITION to query the raster position.

External documentation.

drawRangeElements(Mode, Start, End, Count, Type, Indices)

-spec drawRangeElements(Mode, Start, End, Count, Type, Indices) -> ok
                           when
                               Mode :: enum(),
                               Start :: i(),
                               End :: i(),
                               Count :: i(),
                               Type :: enum(),
                               Indices :: offset() | mem().

gl:drawRangeElements/6 is a restricted form of gl:drawElements/4. Mode, and Count match the corresponding arguments to gl:drawElements/4, with the additional constraint that all values in the arrays Count must lie between Start and End, inclusive.

External documentation.

drawRangeElementsBaseVertex(Mode, Start, End, Count, Type, Indices, Basevertex)

-spec drawRangeElementsBaseVertex(Mode, Start, End, Count, Type, Indices, Basevertex) -> ok
                                     when
                                         Mode :: enum(),
                                         Start :: i(),
                                         End :: i(),
                                         Count :: i(),
                                         Type :: enum(),
                                         Indices :: offset() | mem(),
                                         Basevertex :: i().

gl:drawRangeElementsBaseVertex/7 is a restricted form of gl:drawElementsBaseVertex/5. Mode, Count and Basevertex match the corresponding arguments to gl:drawElementsBaseVertex/5, with the additional constraint that all values in the array Indices must lie between Start and End, inclusive, prior to adding Basevertex. Index values lying outside the range [Start, End] are treated in the same way as gl:drawElementsBaseVertex/5. The ith element transferred by the corresponding draw call will be taken from element Indices[i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.

External documentation.

drawTransformFeedback(Mode, Id)

-spec drawTransformFeedback(Mode :: enum(), Id :: i()) -> ok.

gl:drawTransformFeedback/2 draws primitives of a type specified by Mode using a count retrieved from the transform feedback specified by Id. Calling gl:drawTransformFeedback/2 is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id.

External documentation.

drawTransformFeedbackInstanced(Mode, Id, Instancecount)

-spec drawTransformFeedbackInstanced(Mode :: enum(), Id :: i(), Instancecount :: i()) -> ok.

gl:drawTransformFeedbackInstanced/3 draws multiple copies of a range of primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackInstanced/3 is equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id.

External documentation.

drawTransformFeedbackStream(Mode, Id, Stream)

-spec drawTransformFeedbackStream(Mode :: enum(), Id :: i(), Stream :: i()) -> ok.

gl:drawTransformFeedbackStream/3 draws primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackStream/3 is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id.

External documentation.

drawTransformFeedbackStreamInstanced(Mode, Id, Stream, Instancecount)

-spec drawTransformFeedbackStreamInstanced(Mode :: enum(),
                                           Id :: i(),
                                           Stream :: i(),
                                           Instancecount :: i()) ->
                                              ok.

gl:drawTransformFeedbackStreamInstanced/4 draws multiple copies of a range of primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id. Calling gl:drawTransformFeedbackStreamInstanced/4 is equivalent to calling gl:drawArraysInstanced/4 with Mode and Instancecount as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id.

External documentation.

edgeFlag(Flag)

-spec edgeFlag(Flag :: 0 | 1) -> ok.

Equivalent to edgeFlagv/1.

edgeFlagPointer(Stride, Ptr)

-spec edgeFlagPointer(Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:edgeFlagPointer/2 specifies the location and data format of an array of boolean edge flags to use when rendering. Stride specifies the byte stride from one edge flag to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

External documentation.

edgeFlagv/1

-spec edgeFlagv({Flag :: 0 | 1}) -> ok.

Each vertex of a polygon, separate triangle, or separate quadrilateral specified between a gl:'begin'/1/gl:'end'/0 pair is marked as the start of either a boundary or nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. gl:edgeFlag/1 sets the edge flag bit to ?GL_TRUE if Flag is ?GL_TRUE and to ?GL_FALSE otherwise.

External documentation.

enable(Cap)

-spec enable(Cap :: enum()) -> ok.

Equivalent to enablei/2.

enableClientState(Cap)

-spec enableClientState(Cap :: enum()) -> ok.

gl:enableClientState/1 and gl:disableClientState/1 enable or disable individual client-side capabilities. By default, all client-side capabilities are disabled. Both gl:enableClientState/1 and gl:disableClientState/1 take a single argument, Cap, which can assume one of the following values:

External documentation.

enablei(Target, Index)

-spec enablei(Target :: enum(), Index :: i()) -> ok.

gl:enable/1 and gl:disable/1 enable and disable various capabilities. Use gl:isEnabled/1 or gl:get() to determine the current setting of any capability. The initial value for each capability with the exception of ?GL_DITHER and ?GL_MULTISAMPLE is ?GL_FALSE. The initial value for ?GL_DITHER and ?GL_MULTISAMPLE is ?GL_TRUE.

External documentation.

enableVertexArrayAttrib(Vaobj, Index)

-spec enableVertexArrayAttrib(Vaobj :: i(), Index :: i()) -> ok.

Equivalent to enableVertexAttribArray/1.

enableVertexAttribArray(Index)

-spec enableVertexAttribArray(Index :: i()) -> ok.

gl:enableVertexAttribArray/1 and gl:enableVertexArrayAttrib/2 enable the generic vertex attribute array specified by Index. gl:enableVertexAttribArray/1 uses currently bound vertex array object for the operation, whereas gl:enableVertexArrayAttrib/2 updates state of the vertex array object with ID Vaobj.

External documentation.

'end'()

-spec 'end'() -> ok.

gl:'begin'/1 and gl:'end'/0 delimit the vertices that define a primitive or a group of like primitives. gl:'begin'/1 accepts a single argument that specifies in which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows:

External documentation.

endConditionalRender()

-spec endConditionalRender() -> ok.

Conditional rendering is started using gl:beginConditionalRender/2 and ended using gl:endConditionalRender/0. During conditional rendering, all vertex array commands, as well as gl:clear/1 and gl:clearBuffer() have no effect if the (?GL_SAMPLES_PASSED) result of the query object Id is zero, or if the (?GL_ANY_SAMPLES_PASSED) result is ?GL_FALSE. The results of commands setting the current vertex state, such as gl:vertexAttrib() are undefined. If the (?GL_SAMPLES_PASSED) result is non-zero or if the (?GL_ANY_SAMPLES_PASSED) result is ?GL_TRUE, such commands are not discarded. The Id parameter to gl:beginConditionalRender/2 must be the name of a query object previously returned from a call to gl:genQueries/1. Mode specifies how the results of the query object are to be interpreted. If Mode is ?GL_QUERY_WAIT, the GL waits for the results of the query to be available and then uses the results to determine if subsequent rendering commands are discarded. If Mode is ?GL_QUERY_NO_WAIT, the GL may choose to unconditionally execute the subsequent rendering commands without waiting for the query to complete.

External documentation.

endList()

-spec endList() -> ok.

Equivalent to newList/2.

endQuery(Target)

-spec endQuery(Target :: enum()) -> ok.

gl:beginQuery/2 and gl:endQuery/1 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1. If a query object with name Id does not yet exist it is created with the type determined by Target. Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED, ?GL_PRIMITIVES_GENERATED, ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED. The behavior of the query object depends on its type and is as follows.

External documentation.

endQueryIndexed(Target, Index)

-spec endQueryIndexed(Target :: enum(), Index :: i()) -> ok.

gl:beginQueryIndexed/3 and gl:endQueryIndexed/2 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1. If a query object with name Id does not yet exist it is created with the type determined by Target. Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED, ?GL_PRIMITIVES_GENERATED, ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED. The behavior of the query object depends on its type and is as follows.

External documentation.

endTransformFeedback()

-spec endTransformFeedback() -> ok.

Transform feedback mode captures the values of varying variables written by the vertex shader (or, if active, the geometry shader). Transform feedback is said to be active after a call to gl:beginTransformFeedback/1 until a subsequent call to gl:endTransformFeedback/0. Transform feedback commands must be paired.

External documentation.

evalCoord1d(U)

-spec evalCoord1d(U :: f()) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord1dv/1

-spec evalCoord1dv({U :: f()}) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord1f(U)

-spec evalCoord1f(U :: f()) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord1fv/1

-spec evalCoord1fv({U :: f()}) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord2d(U, V)

-spec evalCoord2d(U :: f(), V :: f()) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord2dv/1

-spec evalCoord2dv({U :: f(), V :: f()}) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord2f(U, V)

-spec evalCoord2f(U :: f(), V :: f()) -> ok.

Equivalent to evalCoord2fv/1.

evalCoord2fv/1

-spec evalCoord2fv({U :: f(), V :: f()}) -> ok.

gl:evalCoord1() evaluates enabled one-dimensional maps at argument U. gl:evalCoord2() does the same for two-dimensional maps using two domain values, U and V. To define a map, call glMap1 and glMap2; to enable and disable it, call gl:enable/1 and gl:disable/1.

External documentation.

evalMesh1(Mode, I1, I2)

-spec evalMesh1(Mode :: enum(), I1 :: i(), I2 :: i()) -> ok.

Equivalent to evalMesh2/5.

evalMesh2(Mode, I1, I2, J1, J2)

-spec evalMesh2(Mode :: enum(), I1 :: i(), I2 :: i(), J1 :: i(), J2 :: i()) -> ok.

gl:mapGrid() and gl:evalMesh() are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. Mode determines whether the resulting vertices are connected as points, lines, or filled polygons.

External documentation.

evalPoint1(I)

-spec evalPoint1(I :: i()) -> ok.

Equivalent to evalPoint2/2.

evalPoint2(I, J)

-spec evalPoint2(I :: i(), J :: i()) -> ok.

gl:mapGrid() and gl:evalMesh() are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. gl:evalPoint() can be used to evaluate a single grid point in the same gridspace that is traversed by gl:evalMesh(). Calling gl:evalPoint1/1 is equivalent to calling glEvalCoord1( i.ð u+u 1 ); where ð u=(u 2-u 1)/n

External documentation.

feedbackBuffer(Size, Type, Buffer)

-spec feedbackBuffer(Size :: i(), Type :: enum(), Buffer :: mem()) -> ok.

The gl:feedbackBuffer/3 function controls feedback. Feedback, like selection, is a GL mode. The mode is selected by calling gl:renderMode/1 with ?GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL.

External documentation.

fenceSync(Condition, Flags)

-spec fenceSync(Condition :: enum(), Flags :: i()) -> i().

gl:fenceSync/2 creates a new fence sync object, inserts a fence command into the GL command stream and associates it with that sync object, and returns a non-zero name corresponding to the sync object.

External documentation.

finish()

-spec finish() -> ok.

gl:finish/0 does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents.

External documentation.

flush()

-spec flush() -> ok.

Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. gl:flush/0 empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.

External documentation.

flushMappedBufferRange(Target, Offset, Length)

-spec flushMappedBufferRange(Target :: enum(), Offset :: i(), Length :: i()) -> ok.

Equivalent to flushMappedNamedBufferRange/3.

flushMappedNamedBufferRange(Buffer, Offset, Length)

-spec flushMappedNamedBufferRange(Buffer :: i(), Offset :: i(), Length :: i()) -> ok.

gl:flushMappedBufferRange/3 indicates that modifications have been made to a range of a mapped buffer object. The buffer object must previously have been mapped with the ?GL_MAP_FLUSH_EXPLICIT_BIT flag.

External documentation.

fogCoordd(Coord)

-spec fogCoordd(Coord :: f()) -> ok.

Equivalent to fogCoordfv/1.

fogCoorddv/1

-spec fogCoorddv({Coord :: f()}) -> ok.

Equivalent to fogCoordfv/1.

fogCoordf(Coord)

-spec fogCoordf(Coord :: f()) -> ok.

Equivalent to fogCoordfv/1.

fogCoordfv/1

-spec fogCoordfv({Coord :: f()}) -> ok.

gl:fogCoord() specifies the fog coordinate that is associated with each vertex and the current raster position. The value specified is interpolated and used in computing the fog color (see gl:fog()).

External documentation.

fogCoordPointer(Type, Stride, Pointer)

-spec fogCoordPointer(Type :: enum(), Stride :: i(), Pointer :: offset() | mem()) -> ok.

gl:fogCoordPointer/3 specifies the location and data format of an array of fog coordinates to use when rendering. Type specifies the data type of each fog coordinate, and Stride specifies the byte stride from one fog coordinate to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

External documentation.

fogf(Pname, Param)

-spec fogf(Pname :: enum(), Param :: f()) -> ok.

Equivalent to fogiv/2.

fogfv(Pname, Params)

-spec fogfv(Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to fogiv/2.

fogi(Pname, Param)

-spec fogi(Pname :: enum(), Param :: i()) -> ok.

Equivalent to fogiv/2.

fogiv(Pname, Params)

-spec fogiv(Pname :: enum(), Params :: tuple()) -> ok.

Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. To enable and disable fog, call gl:enable/1 and gl:disable/1 with argument ?GL_FOG.

External documentation.

framebufferParameteri(Target, Pname, Param)

-spec framebufferParameteri(Target :: enum(), Pname :: enum(), Param :: i()) -> ok.

gl:framebufferParameteri/3 and glNamedFramebufferParameteri modify the value of the parameter named Pname in the specified framebuffer object. There are no modifiable parameters of the default draw and read framebuffer, so they are not valid targets of these commands.

External documentation.

framebufferRenderbuffer(Target, Attachment, Renderbuffertarget, Renderbuffer)

-spec framebufferRenderbuffer(Target, Attachment, Renderbuffertarget, Renderbuffer) -> ok
                                 when
                                     Target :: enum(),
                                     Attachment :: enum(),
                                     Renderbuffertarget :: enum(),
                                     Renderbuffer :: i().

gl:framebufferRenderbuffer/4 and glNamedFramebufferRenderbuffer attaches a renderbuffer as one of the logical buffers of the specified framebuffer object. Renderbuffers cannot be attached to the default draw and read framebuffer, so they are not valid targets of these commands.

External documentation.

framebufferTexture1D(Target, Attachment, Textarget, Texture, Level)

-spec framebufferTexture1D(Target :: enum(),
                           Attachment :: enum(),
                           Textarget :: enum(),
                           Texture :: i(),
                           Level :: i()) ->
                              ok.

Equivalent to framebufferTextureLayer/5.

framebufferTexture2D(Target, Attachment, Textarget, Texture, Level)

-spec framebufferTexture2D(Target :: enum(),
                           Attachment :: enum(),
                           Textarget :: enum(),
                           Texture :: i(),
                           Level :: i()) ->
                              ok.

Equivalent to framebufferTextureLayer/5.

framebufferTexture3D(Target, Attachment, Textarget, Texture, Level, Zoffset)

-spec framebufferTexture3D(Target, Attachment, Textarget, Texture, Level, Zoffset) -> ok
                              when
                                  Target :: enum(),
                                  Attachment :: enum(),
                                  Textarget :: enum(),
                                  Texture :: i(),
                                  Level :: i(),
                                  Zoffset :: i().

Equivalent to framebufferTextureLayer/5.

framebufferTexture(Target, Attachment, Texture, Level)

-spec framebufferTexture(Target :: enum(), Attachment :: enum(), Texture :: i(), Level :: i()) -> ok.

Equivalent to framebufferTextureLayer/5.

framebufferTextureFaceARB(Target, Attachment, Texture, Level, Face)

-spec framebufferTextureFaceARB(Target :: enum(),
                                Attachment :: enum(),
                                Texture :: i(),
                                Level :: i(),
                                Face :: enum()) ->
                                   ok.

Equivalent to framebufferTextureLayer/5.

framebufferTextureLayer(Target, Attachment, Texture, Level, Layer)

-spec framebufferTextureLayer(Target :: enum(),
                              Attachment :: enum(),
                              Texture :: i(),
                              Level :: i(),
                              Layer :: i()) ->
                                 ok.

These commands attach a selected mipmap level or image of a texture object as one of the logical buffers of the specified framebuffer object. Textures cannot be attached to the default draw and read framebuffer, so they are not valid targets of these commands.

External documentation.

frontFace(Mode)

-spec frontFace(Mode :: enum()) -> ok.

In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call gl:enable/1 and gl:disable/1 with argument ?GL_CULL_FACE.

External documentation.

frustum(Left, Right, Bottom, Top, Near_val, Far_val)

-spec frustum(Left :: f(), Right :: f(), Bottom :: f(), Top :: f(), Near_val :: f(), Far_val :: f()) ->
                 ok.

gl:frustum/6 describes a perspective matrix that produces a perspective projection. The current matrix (see gl:matrixMode/1) is multiplied by this matrix and the result replaces the current matrix, as if gl:multMatrix() were called with the following matrix as its argument:

External documentation.

genBuffers(N)

-spec genBuffers(N :: i()) -> [i()].

gl:genBuffers/1 returns N buffer object names in Buffers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genBuffers/1.

External documentation.

generateMipmap(Target)

-spec generateMipmap(Target :: enum()) -> ok.

Equivalent to generateTextureMipmap/1.

generateTextureMipmap(Texture)

-spec generateTextureMipmap(Texture :: i()) -> ok.

gl:generateMipmap/1 and gl:generateTextureMipmap/1 generates mipmaps for the specified texture object. For gl:generateMipmap/1, the texture object that is bound to Target. For gl:generateTextureMipmap/1, Texture is the name of the texture object.

External documentation.

genFramebuffers(N)

-spec genFramebuffers(N :: i()) -> [i()].

gl:genFramebuffers/1 returns N framebuffer object names in Ids. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genFramebuffers/1.

External documentation.

genLists(Range)

-spec genLists(Range :: i()) -> i().

gl:genLists/1 has one argument, Range. It returns an integer n such that Range contiguous empty display lists, named n, n+1, ..., n+range-1, are created. If Range is 0, if there is no group of Range contiguous names available, or if any error is generated, no display lists are generated, and 0 is returned.

External documentation.

genProgramPipelines(N)

-spec genProgramPipelines(N :: i()) -> [i()].

gl:genProgramPipelines/1 returns N previously unused program pipeline object names in Pipelines. These names are marked as used, for the purposes of gl:genProgramPipelines/1 only, but they acquire program pipeline state only when they are first bound.

External documentation.

genQueries(N)

-spec genQueries(N :: i()) -> [i()].

gl:genQueries/1 returns N query object names in Ids. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genQueries/1.

External documentation.

genRenderbuffers(N)

-spec genRenderbuffers(N :: i()) -> [i()].

gl:genRenderbuffers/1 returns N renderbuffer object names in Renderbuffers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genRenderbuffers/1.

External documentation.

genSamplers(Count)

-spec genSamplers(Count :: i()) -> [i()].

gl:genSamplers/1 returns N sampler object names in Samplers. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genSamplers/1.

External documentation.

genTextures(N)

-spec genTextures(N :: i()) -> [i()].

gl:genTextures/1 returns N texture names in Textures. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genTextures/1.

External documentation.

genTransformFeedbacks(N)

-spec genTransformFeedbacks(N :: i()) -> [i()].

gl:genTransformFeedbacks/1 returns N previously unused transform feedback object names in Ids. These names are marked as used, for the purposes of gl:genTransformFeedbacks/1 only, but they acquire transform feedback state only when they are first bound.

External documentation.

genVertexArrays(N)

-spec genVertexArrays(N :: i()) -> [i()].

gl:genVertexArrays/1 returns N vertex array object names in Arrays. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genVertexArrays/1.

External documentation.

getActiveAttrib(Program, Index, BufSize)

-spec getActiveAttrib(Program :: i(), Index :: i(), BufSize :: i()) ->
                         {Size :: i(), Type :: enum(), Name :: string()}.

gl:getActiveAttrib/3 returns information about an active attribute variable in the program object specified by Program. The number of active attributes can be obtained by calling gl:getProgram() with the value ?GL_ACTIVE_ATTRIBUTES. A value of 0 for Index selects the first active attribute variable. Permissible values for Index range from zero to the number of active attribute variables minus one.

External documentation.

getActiveSubroutineName(Program, Shadertype, Index, Bufsize)

-spec getActiveSubroutineName(Program :: i(), Shadertype :: enum(), Index :: i(), Bufsize :: i()) ->
                                 string().

gl:getActiveSubroutineName/4 queries the name of an active shader subroutine uniform from the program object given in Program. Index specifies the index of the shader subroutine uniform within the shader stage given by Stage, and must between zero and the value of ?GL_ACTIVE_SUBROUTINES minus one for the shader stage.

External documentation.

getActiveSubroutineUniformName(Program, Shadertype, Index, Bufsize)

-spec getActiveSubroutineUniformName(Program :: i(), Shadertype :: enum(), Index :: i(), Bufsize :: i()) ->
                                        string().

gl:getActiveSubroutineUniformName/4 retrieves the name of an active shader subroutine uniform. Program contains the name of the program containing the uniform. Shadertype specifies the stage for which the uniform location, given by Index, is valid. Index must be between zero and the value of ?GL_ACTIVE_SUBROUTINE_UNIFORMS minus one for the shader stage.

External documentation.

getActiveUniform(Program, Index, BufSize)

-spec getActiveUniform(Program :: i(), Index :: i(), BufSize :: i()) ->
                          {Size :: i(), Type :: enum(), Name :: string()}.

gl:getActiveUniform/3 returns information about an active uniform variable in the program object specified by Program. The number of active uniform variables can be obtained by calling gl:getProgram() with the value ?GL_ACTIVE_UNIFORMS. A value of 0 for Index selects the first active uniform variable. Permissible values for Index range from zero to the number of active uniform variables minus one.

External documentation.

getActiveUniformBlockiv(Program, UniformBlockIndex, Pname, Params)

-spec getActiveUniformBlockiv(Program :: i(),
                              UniformBlockIndex :: i(),
                              Pname :: enum(),
                              Params :: mem()) ->
                                 ok.

gl:getActiveUniformBlockiv/4 retrieves information about an active uniform block within Program.

External documentation.

getActiveUniformBlockName(Program, UniformBlockIndex, BufSize)

-spec getActiveUniformBlockName(Program :: i(), UniformBlockIndex :: i(), BufSize :: i()) -> string().

gl:getActiveUniformBlockName/3 retrieves the name of the active uniform block at UniformBlockIndex within Program.

External documentation.

getActiveUniformName(Program, UniformIndex, BufSize)

-spec getActiveUniformName(Program :: i(), UniformIndex :: i(), BufSize :: i()) -> string().

gl:getActiveUniformName/3 returns the name of the active uniform at UniformIndex within Program. If UniformName is not NULL, up to BufSize characters (including a nul-terminator) will be written into the array whose address is specified by UniformName. If Length is not NULL, the number of characters that were (or would have been) written into UniformName (not including the nul-terminator) will be placed in the variable whose address is specified in Length. If Length is NULL, no length is returned. The length of the longest uniform name in Program is given by the value of ?GL_ACTIVE_UNIFORM_MAX_LENGTH, which can be queried with gl:getProgram().

External documentation.

getActiveUniformsiv(Program, UniformIndices, Pname)

-spec getActiveUniformsiv(Program :: i(), UniformIndices :: [i()], Pname :: enum()) -> [i()].

gl:getActiveUniformsiv/3 queries the value of the parameter named Pname for each of the uniforms within Program whose indices are specified in the array of UniformCount unsigned integers UniformIndices. Upon success, the value of the parameter for each uniform is written into the corresponding entry in the array whose address is given in Params. If an error is generated, nothing is written into Params.

External documentation.

getAttachedShaders(Program, MaxCount)

-spec getAttachedShaders(Program :: i(), MaxCount :: i()) -> [i()].

gl:getAttachedShaders/2 returns the names of the shader objects attached to Program. The names of shader objects that are attached to Program will be returned in Shaders. The actual number of shader names written into Shaders is returned in Count. If no shader objects are attached to Program, Count is set to 0. The maximum number of shader names that may be returned in Shaders is specified by MaxCount.

External documentation.

getAttribLocation(Program, Name)

-spec getAttribLocation(Program :: i(), Name :: string()) -> i().

gl:getAttribLocation/2 queries the previously linked program object specified by Program for the attribute variable specified by Name and returns the index of the generic vertex attribute that is bound to that attribute variable. If Name is a matrix attribute variable, the index of the first column of the matrix is returned. If the named attribute variable is not an active attribute in the specified program object or if Name starts with the reserved prefix "gl_", a value of -1 is returned.

External documentation.

getBooleani_v(Target, Index)

-spec getBooleani_v(Target :: enum(), Index :: i()) -> [0 | 1].

Equivalent to getIntegerv/1.

getBooleanv(Pname)

-spec getBooleanv(Pname :: enum()) -> [0 | 1].

Equivalent to getIntegerv/1.

getBufferParameteri64v(Target, Pname)

-spec getBufferParameteri64v(Target :: enum(), Pname :: enum()) -> [i()].

Equivalent to getBufferParameterivARB/2.

getBufferParameteriv(Target, Pname)

-spec getBufferParameteriv(Target :: enum(), Pname :: enum()) -> i().

gl:getBufferParameteriv/2 returns in Data a selected parameter of the buffer object specified by Target.

External documentation.

getBufferParameterivARB(Target, Pname)

-spec getBufferParameterivARB(Target :: enum(), Pname :: enum()) -> [i()].

These functions return in Data a selected parameter of the specified buffer object.

External documentation.

getBufferSubData(Target, Offset, Size, Data)

-spec getBufferSubData(Target :: enum(), Offset :: i(), Size :: i(), Data :: mem()) -> ok.

gl:getBufferSubData/4 and glGetNamedBufferSubData return some or all of the data contents of the data store of the specified buffer object. Data starting at byte offset Offset and extending for Size bytes is copied from the buffer object's data store to the memory pointed to by Data. An error is thrown if the buffer object is currently mapped, or if Offset and Size together define a range beyond the bounds of the buffer object's data store.

External documentation.

getClipPlane(Plane)

-spec getClipPlane(Plane :: enum()) -> {f(), f(), f(), f()}.

gl:getClipPlane/1 returns in Equation the four coefficients of the plane equation for Plane.

External documentation.

getColorTable(Target, Format, Type, Table)

-spec getColorTable(Target :: enum(), Format :: enum(), Type :: enum(), Table :: mem()) -> ok.

gl:getColorTable/4 returns in Table the contents of the color table specified by Target. No pixel transfer operations are performed, but pixel storage modes that are applicable to gl:readPixels/7 are performed.

External documentation.

getColorTableParameterfv(Target, Pname)

-spec getColorTableParameterfv(Target :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getColorTableParameteriv/2.

getColorTableParameteriv(Target, Pname)

-spec getColorTableParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

Returns parameters specific to color table Target.

External documentation.

getCompressedTexImage(Target, Lod, Img)

-spec getCompressedTexImage(Target :: enum(), Lod :: i(), Img :: mem()) -> ok.

gl:getCompressedTexImage/3 and glGetnCompressedTexImage return the compressed texture image associated with Target and Lod into Pixels. glGetCompressedTextureImage serves the same purpose, but instead of taking a texture target, it takes the ID of the texture object. Pixels should be an array of BufSize bytes for glGetnCompresedTexImage and glGetCompressedTextureImage functions, and of ?GL_TEXTURE_COMPRESSED_IMAGE_SIZE bytes in case of gl:getCompressedTexImage/3. If the actual data takes less space than BufSize, the remaining bytes will not be touched. Target specifies the texture target, to which the texture the data the function should extract the data from is bound to. Lod specifies the level-of-detail number of the desired image.

External documentation.

getConvolutionFilter(Target, Format, Type, Image)

-spec getConvolutionFilter(Target :: enum(), Format :: enum(), Type :: enum(), Image :: mem()) -> ok.

gl:getConvolutionFilter/4 returns the current 1D or 2D convolution filter kernel as an image. The one- or two-dimensional image is placed in Image according to the specifications in Format and Type. No pixel transfer operations are performed on this image, but the relevant pixel storage modes are applied.

External documentation.

getConvolutionParameterfv(Target, Pname)

-spec getConvolutionParameterfv(Target :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getConvolutionParameteriv/2.

getConvolutionParameteriv(Target, Pname)

-spec getConvolutionParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getConvolutionParameter() retrieves convolution parameters. Target determines which convolution filter is queried. Pname determines which parameter is returned:

External documentation.

getDebugMessageLog(Count, BufSize)

-spec getDebugMessageLog(Count :: i(), BufSize :: i()) ->
                            {i(),
                             Sources :: [enum()],
                             Types :: [enum()],
                             Ids :: [i()],
                             Severities :: [enum()],
                             MessageLog :: [string()]}.

gl:getDebugMessageLog/2 retrieves messages from the debug message log. A maximum of Count messages are retrieved from the log. If Sources is not NULL then the source of each message is written into up to Count elements of the array. If Types is not NULL then the type of each message is written into up to Count elements of the array. If Id is not NULL then the identifier of each message is written into up to Count elements of the array. If Severities is not NULL then the severity of each message is written into up to Count elements of the array. If Lengths is not NULL then the length of each message is written into up to Count elements of the array.

External documentation.

getDoublei_v(Target, Index)

-spec getDoublei_v(Target :: enum(), Index :: i()) -> [f()].

Equivalent to getIntegerv/1.

getDoublev(Pname)

-spec getDoublev(Pname :: enum()) -> [f()].

Equivalent to getIntegerv/1.

getError()

-spec getError() -> enum().

gl:getError/0 returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until gl:getError/0 is called, the error code is returned, and the flag is reset to ?GL_NO_ERROR. If a call to gl:getError/0 returns ?GL_NO_ERROR, there has been no detectable error since the last call to gl:getError/0, or since the GL was initialized.

External documentation.

getFloati_v(Target, Index)

-spec getFloati_v(Target :: enum(), Index :: i()) -> [f()].

Equivalent to getIntegerv/1.

getFloatv(Pname)

-spec getFloatv(Pname :: enum()) -> [f()].

Equivalent to getIntegerv/1.

getFragDataIndex(Program, Name)

-spec getFragDataIndex(Program :: i(), Name :: string()) -> i().

gl:getFragDataIndex/2 returns the index of the fragment color to which the variable Name was bound when the program object Program was last linked. If Name is not a varying out variable of Program, or if an error occurs, -1 will be returned.

External documentation.

getFragDataLocation(Program, Name)

-spec getFragDataLocation(Program :: i(), Name :: string()) -> i().

gl:getFragDataLocation/2 retrieves the assigned color number binding for the user-defined varying out variable Name for program Program. Program must have previously been linked. Name must be a null-terminated string. If Name is not the name of an active user-defined varying out fragment shader variable within Program, -1 will be returned.

External documentation.

getFramebufferAttachmentParameteriv(Target, Attachment, Pname)

-spec getFramebufferAttachmentParameteriv(Target :: enum(), Attachment :: enum(), Pname :: enum()) ->
                                             i().

gl:getFramebufferAttachmentParameteriv/3 and glGetNamedFramebufferAttachmentParameteriv return parameters of attachments of a specified framebuffer object.

External documentation.

getFramebufferParameteriv(Target, Pname)

-spec getFramebufferParameteriv(Target :: enum(), Pname :: enum()) -> i().

gl:getFramebufferParameteriv/2 and glGetNamedFramebufferParameteriv query parameters of a specified framebuffer object.

External documentation.

getGraphicsResetStatus()

-spec getGraphicsResetStatus() -> enum().

Certain events can result in a reset of the GL context. Such a reset causes all context state to be lost and requires the application to recreate all objects in the affected context.

External documentation.

getHistogram(Target, Reset, Format, Type, Values)

-spec getHistogram(Target :: enum(), Reset :: 0 | 1, Format :: enum(), Type :: enum(), Values :: mem()) ->
                      ok.

gl:getHistogram/5 returns the current histogram table as a one-dimensional image with the same width as the histogram. No pixel transfer operations are performed on this image, but pixel storage modes that are applicable to 1D images are honored.

External documentation.

getHistogramParameterfv(Target, Pname)

-spec getHistogramParameterfv(Target :: enum(), Pname :: enum()) -> {f()}.

Equivalent to getHistogramParameteriv/2.

getHistogramParameteriv(Target, Pname)

-spec getHistogramParameteriv(Target :: enum(), Pname :: enum()) -> {i()}.

gl:getHistogramParameter() is used to query parameter values for the current histogram or for a proxy. The histogram state information may be queried by calling gl:getHistogramParameter() with a Target of ?GL_HISTOGRAM (to obtain information for the current histogram table) or ?GL_PROXY_HISTOGRAM (to obtain information from the most recent proxy request) and one of the following values for the Pname argument:

External documentation.

getInteger64i_v(Target, Index)

-spec getInteger64i_v(Target :: enum(), Index :: i()) -> [i()].

Equivalent to getIntegerv/1.

getInteger64v(Pname)

-spec getInteger64v(Pname :: enum()) -> [i()].

Equivalent to getIntegerv/1.

getIntegeri_v(Target, Index)

-spec getIntegeri_v(Target :: enum(), Index :: i()) -> [i()].

Equivalent to getIntegerv/1.

getIntegerv(Pname)

-spec getIntegerv(Pname :: enum()) -> [i()].

These commands return values for simple state variables in GL. Pname is a symbolic constant indicating the state variable to be returned, and Data is a pointer to an array of the indicated type in which to place the returned data.

External documentation.

getInternalformati64v(Target, Internalformat, Pname, BufSize)

-spec getInternalformati64v(Target :: enum(), Internalformat :: enum(), Pname :: enum(), BufSize :: i()) ->
                               [i()].

Equivalent to getInternalformativ/4.

getInternalformativ(Target, Internalformat, Pname, BufSize)

-spec getInternalformativ(Target :: enum(), Internalformat :: enum(), Pname :: enum(), BufSize :: i()) ->
                             [i()].

No documentation available.

getLightfv(Light, Pname)

-spec getLightfv(Light :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getLightiv/2.

getLightiv(Light, Pname)

-spec getLightiv(Light :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getLight() returns in Params the value or values of a light source parameter. Light names the light and is a symbolic name of the form ?GL_LIGHT i where i ranges from 0 to the value of ?GL_MAX_LIGHTS - 1. ?GL_MAX_LIGHTS is an implementation dependent constant that is greater than or equal to eight. Pname specifies one of ten light source parameters, again by symbolic name.

External documentation.

getMapdv(Target, Query, V)

-spec getMapdv(Target :: enum(), Query :: enum(), V :: mem()) -> ok.

Equivalent to getMapiv/3.

getMapfv(Target, Query, V)

-spec getMapfv(Target :: enum(), Query :: enum(), V :: mem()) -> ok.

Equivalent to getMapiv/3.

getMapiv(Target, Query, V)

-spec getMapiv(Target :: enum(), Query :: enum(), V :: mem()) -> ok.

glMap1 and glMap2 define evaluators. gl:getMap() returns evaluator parameters. Target chooses a map, Query selects a specific parameter, and V points to storage where the values will be returned.

External documentation.

getMaterialfv(Face, Pname)

-spec getMaterialfv(Face :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getMaterialiv/2.

getMaterialiv(Face, Pname)

-spec getMaterialiv(Face :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getMaterial() returns in Params the value or values of parameter Pname of material Face. Six parameters are defined:

External documentation.

getMinmax(Target, Reset, Format, Types, Values)

-spec getMinmax(Target :: enum(), Reset :: 0 | 1, Format :: enum(), Types :: enum(), Values :: mem()) ->
                   ok.

gl:getMinmax/5 returns the accumulated minimum and maximum pixel values (computed on a per-component basis) in a one-dimensional image of width 2. The first set of return values are the minima, and the second set of return values are the maxima. The format of the return values is determined by Format, and their type is determined by Types.

External documentation.

getMinmaxParameterfv(Target, Pname)

-spec getMinmaxParameterfv(Target :: enum(), Pname :: enum()) -> {f()}.

Equivalent to getMinmaxParameteriv/2.

getMinmaxParameteriv(Target, Pname)

-spec getMinmaxParameteriv(Target :: enum(), Pname :: enum()) -> {i()}.

gl:getMinmaxParameter() retrieves parameters for the current minmax table by setting Pname to one of the following values:

External documentation.

getMultisamplefv(Pname, Index)

-spec getMultisamplefv(Pname :: enum(), Index :: i()) -> {f(), f()}.

gl:getMultisamplefv/2 queries the location of a given sample. Pname specifies the sample parameter to retrieve and must be ?GL_SAMPLE_POSITION. Index corresponds to the sample for which the location should be returned. The sample location is returned as two floating-point values in Val[0] and Val[1], each between 0 and 1, corresponding to the X and Y locations respectively in the GL pixel space of that sample. (0.5, 0.5) this corresponds to the pixel center. Index must be between zero and the value of ?GL_SAMPLES minus one.

External documentation.

getPixelMapfv(Map, Values)

-spec getPixelMapfv(Map :: enum(), Values :: mem()) -> ok.

Equivalent to getPixelMapusv/2.

getPixelMapuiv(Map, Values)

-spec getPixelMapuiv(Map :: enum(), Values :: mem()) -> ok.

Equivalent to getPixelMapusv/2.

getPixelMapusv(Map, Values)

-spec getPixelMapusv(Map :: enum(), Values :: mem()) -> ok.

See the gl:pixelMap() reference page for a description of the acceptable values for the Map parameter. gl:getPixelMap() returns in Data the contents of the pixel map specified in Map. Pixel maps are used during the execution of gl:readPixels/7, gl:drawPixels/5, gl:copyPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9. to map color indices, stencil indices, color components, and depth components to other values.

External documentation.

getPolygonStipple()

-spec getPolygonStipple() -> binary().

gl:getPolygonStipple/0 returns to Pattern a 32×32 polygon stipple pattern. The pattern is packed into memory as if gl:readPixels/7 with both height and width of 32, type of ?GL_BITMAP, and format of ?GL_COLOR_INDEX were called, and the stipple pattern were stored in an internal 32×32 color index buffer. Unlike gl:readPixels/7, however, pixel transfer operations (shift, offset, pixel map) are not applied to the returned stipple image.

External documentation.

getProgramBinary(Program, BufSize)

-spec getProgramBinary(Program :: i(), BufSize :: i()) -> {BinaryFormat :: enum(), Binary :: binary()}.

gl:getProgramBinary/2 returns a binary representation of the compiled and linked executable for Program into the array of bytes whose address is specified in Binary. The maximum number of bytes that may be written into Binary is specified by BufSize. If the program binary is greater in size than BufSize bytes, then an error is generated, otherwise the actual number of bytes written into Binary is returned in the variable whose address is given by Length. If Length is ?NULL, then no length is returned.

External documentation.

getProgramInfoLog(Program, BufSize)

-spec getProgramInfoLog(Program :: i(), BufSize :: i()) -> string().

gl:getProgramInfoLog/2 returns the information log for the specified program object. The information log for a program object is modified when the program object is linked or validated. The string that is returned will be null terminated.

External documentation.

getProgramInterfaceiv(Program, ProgramInterface, Pname)

-spec getProgramInterfaceiv(Program :: i(), ProgramInterface :: enum(), Pname :: enum()) -> i().

gl:getProgramInterfaceiv/3 queries the property of the interface identifed by ProgramInterface in Program, the property name of which is given by Pname.

External documentation.

getProgramiv(Program, Pname)

-spec getProgramiv(Program :: i(), Pname :: enum()) -> i().

gl:getProgram() returns in Params the value of a parameter for a specific program object. The following parameters are defined:

External documentation.

getProgramPipelineInfoLog(Pipeline, BufSize)

-spec getProgramPipelineInfoLog(Pipeline :: i(), BufSize :: i()) -> string().

gl:getProgramPipelineInfoLog/2 retrieves the info log for the program pipeline object Pipeline. The info log, including its null terminator, is written into the array of characters whose address is given by InfoLog. The maximum number of characters that may be written into InfoLog is given by BufSize, and the actual number of characters written into InfoLog is returned in the integer whose address is given by Length. If Length is ?NULL, no length is returned.

External documentation.

getProgramPipelineiv(Pipeline, Pname)

-spec getProgramPipelineiv(Pipeline :: i(), Pname :: enum()) -> i().

gl:getProgramPipelineiv/2 retrieves the value of a property of the program pipeline object Pipeline. Pname specifies the name of the parameter whose value to retrieve. The value of the parameter is written to the variable whose address is given by Params.

External documentation.

getProgramResourceIndex(Program, ProgramInterface, Name)

-spec getProgramResourceIndex(Program :: i(), ProgramInterface :: enum(), Name :: string()) -> i().

gl:getProgramResourceIndex/3 returns the unsigned integer index assigned to a resource named Name in the interface type ProgramInterface of program object Program.

External documentation.

getProgramResourceLocation(Program, ProgramInterface, Name)

-spec getProgramResourceLocation(Program :: i(), ProgramInterface :: enum(), Name :: string()) -> i().

gl:getProgramResourceLocation/3 returns the location assigned to the variable named Name in interface ProgramInterface of program object Program. Program must be the name of a program that has been linked successfully. ProgramInterface must be one of ?GL_UNIFORM, ?GL_PROGRAM_INPUT, ?GL_PROGRAM_OUTPUT, ?GL_VERTEX_SUBROUTINE_UNIFORM, ?GL_TESS_CONTROL_SUBROUTINE_UNIFORM, ?GL_TESS_EVALUATION_SUBROUTINE_UNIFORM, ?GL_GEOMETRY_SUBROUTINE_UNIFORM, ?GL_FRAGMENT_SUBROUTINE_UNIFORM, ?GL_COMPUTE_SUBROUTINE_UNIFORM, or ?GL_TRANSFORM_FEEDBACK_BUFFER.

External documentation.

getProgramResourceLocationIndex(Program, ProgramInterface, Name)

-spec getProgramResourceLocationIndex(Program :: i(), ProgramInterface :: enum(), Name :: string()) ->
                                         i().

gl:getProgramResourceLocationIndex/3 returns the fragment color index assigned to the variable named Name in interface ProgramInterface of program object Program. Program must be the name of a program that has been linked successfully. ProgramInterface must be ?GL_PROGRAM_OUTPUT.

External documentation.

getProgramResourceName(Program, ProgramInterface, Index, BufSize)

-spec getProgramResourceName(Program :: i(), ProgramInterface :: enum(), Index :: i(), BufSize :: i()) ->
                                string().

gl:getProgramResourceName/4 retrieves the name string assigned to the single active resource with an index of Index in the interface ProgramInterface of program object Program. Index must be less than the number of entries in the active resource list for ProgramInterface.

External documentation.

getProgramStageiv(Program, Shadertype, Pname)

-spec getProgramStageiv(Program :: i(), Shadertype :: enum(), Pname :: enum()) -> i().

gl:getProgramStage() queries a parameter of a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query the parameter. Pname specifies which parameter should be queried. The value or values of the parameter to be queried is returned in the variable whose address is given in Values.

External documentation.

getQueryBufferObjecti64v(Id, Buffer, Pname, Offset)

-spec getQueryBufferObjecti64v(Id :: i(), Buffer :: i(), Pname :: enum(), Offset :: i()) -> ok.

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectiv(Id, Buffer, Pname, Offset)

-spec getQueryBufferObjectiv(Id :: i(), Buffer :: i(), Pname :: enum(), Offset :: i()) -> ok.

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectui64v(Id, Buffer, Pname, Offset)

-spec getQueryBufferObjectui64v(Id :: i(), Buffer :: i(), Pname :: enum(), Offset :: i()) -> ok.

Equivalent to getQueryObjectuiv/2.

getQueryBufferObjectuiv(Id, Buffer, Pname, Offset)

-spec getQueryBufferObjectuiv(Id :: i(), Buffer :: i(), Pname :: enum(), Offset :: i()) -> ok.

Equivalent to getQueryObjectuiv/2.

getQueryIndexediv(Target, Index, Pname)

-spec getQueryIndexediv(Target :: enum(), Index :: i(), Pname :: enum()) -> i().

gl:getQueryIndexediv/3 returns in Params a selected parameter of the indexed query object target specified by Target and Index. Index specifies the index of the query object target and must be between zero and a target-specific maxiumum.

External documentation.

getQueryiv(Target, Pname)

-spec getQueryiv(Target :: enum(), Pname :: enum()) -> i().

gl:getQueryiv/2 returns in Params a selected parameter of the query object target specified by Target.

External documentation.

getQueryObjecti64v(Id, Pname)

-spec getQueryObjecti64v(Id :: i(), Pname :: enum()) -> i().

Equivalent to getQueryObjectuiv/2.

getQueryObjectiv(Id, Pname)

-spec getQueryObjectiv(Id :: i(), Pname :: enum()) -> i().

Equivalent to getQueryObjectuiv/2.

getQueryObjectui64v(Id, Pname)

-spec getQueryObjectui64v(Id :: i(), Pname :: enum()) -> i().

Equivalent to getQueryObjectuiv/2.

getQueryObjectuiv(Id, Pname)

-spec getQueryObjectuiv(Id :: i(), Pname :: enum()) -> i().

These commands return a selected parameter of the query object specified by Id. gl:getQueryObject() returns in Params a selected parameter of the query object specified by Id. gl:getQueryBufferObject() returns in Buffer a selected parameter of the query object specified by Id, by writing it to Buffer's data store at the byte offset specified by Offset.

External documentation.

getRenderbufferParameteriv(Target, Pname)

-spec getRenderbufferParameteriv(Target :: enum(), Pname :: enum()) -> i().

gl:getRenderbufferParameteriv/2 and glGetNamedRenderbufferParameteriv query parameters of a specified renderbuffer object.

External documentation.

getSamplerParameterfv(Sampler, Pname)

-spec getSamplerParameterfv(Sampler :: i(), Pname :: enum()) -> [f()].

Equivalent to getSamplerParameteriv/2.

getSamplerParameterIiv(Sampler, Pname)

-spec getSamplerParameterIiv(Sampler :: i(), Pname :: enum()) -> [i()].

Equivalent to getSamplerParameteriv/2.

getSamplerParameterIuiv(Sampler, Pname)

-spec getSamplerParameterIuiv(Sampler :: i(), Pname :: enum()) -> [i()].

Equivalent to getSamplerParameteriv/2.

getSamplerParameteriv(Sampler, Pname)

-spec getSamplerParameteriv(Sampler :: i(), Pname :: enum()) -> [i()].

gl:getSamplerParameter() returns in Params the value or values of the sampler parameter specified as Pname. Sampler defines the target sampler, and must be the name of an existing sampler object, returned from a previous call to gl:genSamplers/1. Pname accepts the same symbols as gl:samplerParameter(), with the same interpretations:

External documentation.

getShaderInfoLog(Shader, BufSize)

-spec getShaderInfoLog(Shader :: i(), BufSize :: i()) -> string().

gl:getShaderInfoLog/2 returns the information log for the specified shader object. The information log for a shader object is modified when the shader is compiled. The string that is returned will be null terminated.

External documentation.

getShaderiv(Shader, Pname)

-spec getShaderiv(Shader :: i(), Pname :: enum()) -> i().

gl:getShader() returns in Params the value of a parameter for a specific shader object. The following parameters are defined:

External documentation.

getShaderPrecisionFormat(Shadertype, Precisiontype)

-spec getShaderPrecisionFormat(Shadertype :: enum(), Precisiontype :: enum()) ->
                                  {Range :: {i(), i()}, Precision :: i()}.

gl:getShaderPrecisionFormat/2 retrieves the numeric range and precision for the implementation's representation of quantities in different numeric formats in specified shader type. ShaderType specifies the type of shader for which the numeric precision and range is to be retrieved and must be one of ?GL_VERTEX_SHADER or ?GL_FRAGMENT_SHADER. PrecisionType specifies the numeric format to query and must be one of ?GL_LOW_FLOAT, ?GL_MEDIUM_FLOAT``?GL_HIGH_FLOAT, ?GL_LOW_INT, ?GL_MEDIUM_INT, or ?GL_HIGH_INT.

External documentation.

getShaderSource(Shader, BufSize)

-spec getShaderSource(Shader :: i(), BufSize :: i()) -> string().

gl:getShaderSource/2 returns the concatenation of the source code strings from the shader object specified by Shader. The source code strings for a shader object are the result of a previous call to gl:shaderSource/2. The string returned by the function will be null terminated.

External documentation.

getString(Name)

-spec getString(Name :: enum()) -> string().

Equivalent to getStringi/2.

getStringi(Name, Index)

-spec getStringi(Name :: enum(), Index :: i()) -> string().

gl:getString/1 returns a pointer to a static string describing some aspect of the current GL connection. Name can be one of the following:

External documentation.

getSubroutineIndex(Program, Shadertype, Name)

-spec getSubroutineIndex(Program :: i(), Shadertype :: enum(), Name :: string()) -> i().

gl:getSubroutineIndex/3 returns the index of a subroutine uniform within a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query shader subroutine index. Name contains the null-terminated name of the subroutine uniform whose name to query.

External documentation.

getSubroutineUniformLocation(Program, Shadertype, Name)

-spec getSubroutineUniformLocation(Program :: i(), Shadertype :: enum(), Name :: string()) -> i().

gl:getSubroutineUniformLocation/3 returns the location of the subroutine uniform variable Name in the shader stage of type Shadertype attached to Program, with behavior otherwise identical to gl:getUniformLocation/2.

External documentation.

getSynciv(Sync, Pname, BufSize)

-spec getSynciv(Sync :: i(), Pname :: enum(), BufSize :: i()) -> [i()].

gl:getSynciv/3 retrieves properties of a sync object. Sync specifies the name of the sync object whose properties to retrieve.

External documentation.

getTexEnvfv(Target, Pname)

-spec getTexEnvfv(Target :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getTexEnviv/2.

getTexEnviv(Target, Pname)

-spec getTexEnviv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getTexEnv() returns in Params selected values of a texture environment that was specified with gl:texEnv(). Target specifies a texture environment.

External documentation.

getTexGendv(Coord, Pname)

-spec getTexGendv(Coord :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getTexGeniv/2.

getTexGenfv(Coord, Pname)

-spec getTexGenfv(Coord :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getTexGeniv/2.

getTexGeniv(Coord, Pname)

-spec getTexGeniv(Coord :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getTexGen() returns in Params selected parameters of a texture coordinate generation function that was specified using gl:texGen(). Coord names one of the (s, t, r, q) texture coordinates, using the symbolic constant ?GL_S, ?GL_T, ?GL_R, or ?GL_Q.

External documentation.

getTexImage(Target, Level, Format, Type, Pixels)

-spec getTexImage(Target :: enum(), Level :: i(), Format :: enum(), Type :: enum(), Pixels :: mem()) ->
                     ok.

gl:getTexImage/5, glGetnTexImage and glGetTextureImage functions return a texture image into Pixels. For gl:getTexImage/5 and glGetnTexImage, Target specifies whether the desired texture image is one specified by gl:texImage1D/8 (?GL_TEXTURE_1D), gl:texImage2D/9 (?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_2D or any of ?GL_TEXTURE_CUBE_MAP_*), or gl:texImage3D/10 (?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP_ARRAY). For glGetTextureImage, Texture specifies the texture object name. In addition to types of textures accepted by gl:getTexImage/5 and glGetnTexImage, the function also accepts cube map texture objects (with effective target ?GL_TEXTURE_CUBE_MAP). Level specifies the level-of-detail number of the desired image. Format and Type specify the format and type of the desired image array. See the reference page for gl:texImage1D/8 for a description of the acceptable values for the Format and Type parameters, respectively. For glGetnTexImage and glGetTextureImage functions, bufSize tells the size of the buffer to receive the retrieved pixel data. glGetnTexImage and glGetTextureImage do not write more than BufSize bytes into Pixels.

External documentation.

getTexLevelParameterfv(Target, Level, Pname)

-spec getTexLevelParameterfv(Target :: enum(), Level :: i(), Pname :: enum()) -> {f()}.

Equivalent to getTexLevelParameteriv/3.

getTexLevelParameteriv(Target, Level, Pname)

-spec getTexLevelParameteriv(Target :: enum(), Level :: i(), Pname :: enum()) -> {i()}.

gl:getTexLevelParameterfv/3, gl:getTexLevelParameteriv/3, glGetTextureLevelParameterfv and glGetTextureLevelParameteriv return in Params texture parameter values for a specific level-of-detail value, specified as Level. For the first two functions, Target defines the target texture, either ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_PROXY_TEXTURE_1D, ?GL_PROXY_TEXTURE_2D, ?GL_PROXY_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP_POSITIVE_X, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_X, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Y, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, ?GL_TEXTURE_CUBE_MAP_POSITIVE_Z, ?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or ?GL_PROXY_TEXTURE_CUBE_MAP. The remaining two take a Texture argument which specifies the name of the texture object.

External documentation.

getTexParameterfv(Target, Pname)

-spec getTexParameterfv(Target :: enum(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getTexParameteriv/2.

getTexParameterIiv(Target, Pname)

-spec getTexParameterIiv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

Equivalent to getTexParameteriv/2.

getTexParameterIuiv(Target, Pname)

-spec getTexParameterIuiv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

Equivalent to getTexParameteriv/2.

getTexParameteriv(Target, Pname)

-spec getTexParameteriv(Target :: enum(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getTexParameter() and glGetTextureParameter return in Params the value or values of the texture parameter specified as Pname. Target defines the target texture. ?GL_TEXTURE_1D, ?GL_TEXTURE_2D, ?GL_TEXTURE_3D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_RECTANGLE, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, ?GL_TEXTURE_2D_MULTISAMPLE, or ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY specify one-, two-, or three-dimensional, one-dimensional array, two-dimensional array, rectangle, cube-mapped or cube-mapped array, two-dimensional multisample, or two-dimensional multisample array texturing, respectively. Pname accepts the same symbols as gl:texParameter(), with the same interpretations:

External documentation.

getTransformFeedbackVarying(Program, Index, BufSize)

-spec getTransformFeedbackVarying(Program :: i(), Index :: i(), BufSize :: i()) ->
                                     {Size :: i(), Type :: enum(), Name :: string()}.

Information about the set of varying variables in a linked program that will be captured during transform feedback may be retrieved by calling gl:getTransformFeedbackVarying/3. gl:getTransformFeedbackVarying/3 provides information about the varying variable selected by Index. An Index of 0 selects the first varying variable specified in the Varyings array passed to gl:transformFeedbackVaryings/3, and an Index of the value of ?GL_TRANSFORM_FEEDBACK_VARYINGS minus one selects the last such variable.

External documentation.

getUniformBlockIndex(Program, UniformBlockName)

-spec getUniformBlockIndex(Program :: i(), UniformBlockName :: string()) -> i().

gl:getUniformBlockIndex/2 retrieves the index of a uniform block within Program.

External documentation.

getUniformdv(Program, Location)

-spec getUniformdv(Program :: i(), Location :: i()) -> matrix().

Equivalent to getUniformuiv/2.

getUniformfv(Program, Location)

-spec getUniformfv(Program :: i(), Location :: i()) -> matrix().

Equivalent to getUniformuiv/2.

getUniformIndices(Program, UniformNames)

-spec getUniformIndices(Program :: i(), UniformNames :: [unicode:chardata()]) -> [i()].

gl:getUniformIndices/2 retrieves the indices of a number of uniforms within Program.

External documentation.

getUniformiv(Program, Location)

-spec getUniformiv(Program :: i(), Location :: i()) ->
                      {i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i()}.

Equivalent to getUniformuiv/2.

getUniformLocation(Program, Name)

-spec getUniformLocation(Program :: i(), Name :: string()) -> i().

glGetUniformLocationreturns an integer that represents the location of a specific uniform variable within a program object. Name must be a null terminated string that contains no white space. Name must be an active uniform variable name in Program that is not a structure, an array of structures, or a subcomponent of a vector or a matrix. This function returns -1 if Name does not correspond to an active uniform variable in Program, if Name starts with the reserved prefix "gl_", or if Name is associated with an atomic counter or a named uniform block.

External documentation.

getUniformSubroutineuiv(Shadertype, Location)

-spec getUniformSubroutineuiv(Shadertype :: enum(), Location :: i()) ->
                                 {i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i(),
                                  i()}.

gl:getUniformSubroutine() retrieves the value of the subroutine uniform at location Location for shader stage Shadertype of the current program. Location must be less than the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the shader currently in use at shader stage Shadertype. The value of the subroutine uniform is returned in Values.

External documentation.

getUniformuiv(Program, Location)

-spec getUniformuiv(Program :: i(), Location :: i()) ->
                       {i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i(), i()}.

gl:getUniform() and glGetnUniform return in Params the value(s) of the specified uniform variable. The type of the uniform variable specified by Location determines the number of values returned. If the uniform variable is defined in the shader as a boolean, int, or float, a single value will be returned. If it is defined as a vec2, ivec2, or bvec2, two values will be returned. If it is defined as a vec3, ivec3, or bvec3, three values will be returned, and so on. To query values stored in uniform variables declared as arrays, call gl:getUniform() for each element of the array. To query values stored in uniform variables declared as structures, call gl:getUniform() for each field in the structure. The values for uniform variables declared as a matrix will be returned in column major order.

External documentation.

getVertexAttribdv(Index, Pname)

-spec getVertexAttribdv(Index :: i(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getVertexAttribiv/2.

getVertexAttribfv(Index, Pname)

-spec getVertexAttribfv(Index :: i(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getVertexAttribiv/2.

getVertexAttribIiv(Index, Pname)

-spec getVertexAttribIiv(Index :: i(), Pname :: enum()) -> {i(), i(), i(), i()}.

Equivalent to getVertexAttribiv/2.

getVertexAttribIuiv(Index, Pname)

-spec getVertexAttribIuiv(Index :: i(), Pname :: enum()) -> {i(), i(), i(), i()}.

Equivalent to getVertexAttribiv/2.

getVertexAttribiv(Index, Pname)

-spec getVertexAttribiv(Index :: i(), Pname :: enum()) -> {i(), i(), i(), i()}.

gl:getVertexAttrib() returns in Params the value of a generic vertex attribute parameter. The generic vertex attribute to be queried is specified by Index, and the parameter to be queried is specified by Pname.

External documentation.

getVertexAttribLdv(Index, Pname)

-spec getVertexAttribLdv(Index :: i(), Pname :: enum()) -> {f(), f(), f(), f()}.

Equivalent to getVertexAttribiv/2.

hint(Target, Mode)

-spec hint(Target :: enum(), Mode :: enum()) -> ok.

Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. Target is a symbolic constant indicating the behavior to be controlled, and Mode is another symbolic constant indicating the desired behavior. The initial value for each Target is ?GL_DONT_CARE. Mode can be one of the following:

External documentation.

histogram(Target, Width, Internalformat, Sink)

-spec histogram(Target :: enum(), Width :: i(), Internalformat :: enum(), Sink :: 0 | 1) -> ok.

When ?GL_HISTOGRAM is enabled, RGBA color components are converted to histogram table indices by clamping to the range [0,1], multiplying by the width of the histogram table, and rounding to the nearest integer. The table entries selected by the RGBA indices are then incremented. (If the internal format of the histogram table includes luminance, then the index derived from the R color component determines the luminance table entry to be incremented.) If a histogram table entry is incremented beyond its maximum value, then its value becomes undefined. (This is not an error.)

External documentation.

indexd(C)

-spec indexd(C :: f()) -> ok.

Equivalent to indexubv/1.

indexdv/1

-spec indexdv({C :: f()}) -> ok.

Equivalent to indexubv/1.

indexf(C)

-spec indexf(C :: f()) -> ok.

Equivalent to indexubv/1.

indexfv/1

-spec indexfv({C :: f()}) -> ok.

Equivalent to indexubv/1.

indexi(C)

-spec indexi(C :: i()) -> ok.

Equivalent to indexubv/1.

indexiv/1

-spec indexiv({C :: i()}) -> ok.

Equivalent to indexubv/1.

indexMask(Mask)

-spec indexMask(Mask :: i()) -> ok.

gl:indexMask/1 controls the writing of individual bits in the color index buffers. The least significant n bits of Mask, where n is the number of bits in a color index buffer, specify a mask. Where a 1 (one) appears in the mask, it's possible to write to the corresponding bit in the color index buffer (or buffers). Where a 0 (zero) appears, the corresponding bit is write-protected.

External documentation.

indexPointer(Type, Stride, Ptr)

-spec indexPointer(Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:indexPointer/3 specifies the location and data format of an array of color indexes to use when rendering. Type specifies the data type of each color index and Stride specifies the byte stride from one color index to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

External documentation.

indexs(C)

-spec indexs(C :: i()) -> ok.

Equivalent to indexubv/1.

indexsv/1

-spec indexsv({C :: i()}) -> ok.

Equivalent to indexubv/1.

indexub(C)

-spec indexub(C :: i()) -> ok.

Equivalent to indexubv/1.

indexubv/1

-spec indexubv({C :: i()}) -> ok.

gl:index() updates the current (single-valued) color index. It takes one argument, the new value for the current color index.

External documentation.

initNames()

-spec initNames() -> ok.

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. gl:initNames/0 causes the name stack to be initialized to its default empty state.

External documentation.

interleavedArrays(Format, Stride, Pointer)

-spec interleavedArrays(Format :: enum(), Stride :: i(), Pointer :: offset() | mem()) -> ok.

gl:interleavedArrays/3 lets you specify and enable individual color, normal, texture and vertex arrays whose elements are part of a larger aggregate array element. For some implementations, this is more efficient than specifying the arrays separately.

External documentation.

invalidateBufferData(Buffer)

-spec invalidateBufferData(Buffer :: i()) -> ok.

gl:invalidateBufferData/1 invalidates all of the content of the data store of a buffer object. After invalidation, the content of the buffer's data store becomes undefined.

External documentation.

invalidateBufferSubData(Buffer, Offset, Length)

-spec invalidateBufferSubData(Buffer :: i(), Offset :: i(), Length :: i()) -> ok.

gl:invalidateBufferSubData/3 invalidates all or part of the content of the data store of a buffer object. After invalidation, the content of the specified range of the buffer's data store becomes undefined. The start of the range is given by Offset and its size is given by Length, both measured in basic machine units.

External documentation.

invalidateFramebuffer(Target, Attachments)

-spec invalidateFramebuffer(Target :: enum(), Attachments :: [enum()]) -> ok.

gl:invalidateFramebuffer/2 and glInvalidateNamedFramebufferData invalidate the entire contents of a specified set of attachments of a framebuffer.

External documentation.

invalidateSubFramebuffer(Target, Attachments, X, Y, Width, Height)

-spec invalidateSubFramebuffer(Target :: enum(),
                               Attachments :: [enum()],
                               X :: i(),
                               Y :: i(),
                               Width :: i(),
                               Height :: i()) ->
                                  ok.

gl:invalidateSubFramebuffer/6 and glInvalidateNamedFramebufferSubData invalidate the contents of a specified region of a specified set of attachments of a framebuffer.

External documentation.

invalidateTexImage(Texture, Level)

-spec invalidateTexImage(Texture :: i(), Level :: i()) -> ok.

gl:invalidateTexSubImage/8 invalidates all of a texture image. Texture and Level indicated which texture image is being invalidated. After this command, data in the texture image has undefined values.

External documentation.

invalidateTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth)

-spec invalidateTexSubImage(Texture, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth) -> ok
                               when
                                   Texture :: i(),
                                   Level :: i(),
                                   Xoffset :: i(),
                                   Yoffset :: i(),
                                   Zoffset :: i(),
                                   Width :: i(),
                                   Height :: i(),
                                   Depth :: i().

gl:invalidateTexSubImage/8 invalidates all or part of a texture image. Texture and Level indicated which texture image is being invalidated. After this command, data in that subregion have undefined values. Xoffset, Yoffset, Zoffset, Width, Height, and Depth are interpreted as they are in gl:texSubImage3D/11. For texture targets that don't have certain dimensions, this command treats those dimensions as having a size of 1. For example, to invalidate a portion of a two- dimensional texture, the application would use Zoffset equal to zero and Depth equal to one. Cube map textures are treated as an array of six slices in the z-dimension, where a value of Zoffset is interpreted as specifying face ?GL_TEXTURE_CUBE_MAP_POSITIVE_X + Zoffset.

External documentation.

isBuffer(Buffer)

-spec isBuffer(Buffer :: i()) -> 0 | 1.

gl:isBuffer/1 returns ?GL_TRUE if Buffer is currently the name of a buffer object. If Buffer is zero, or is a non-zero value that is not currently the name of a buffer object, or if an error occurs, gl:isBuffer/1 returns ?GL_FALSE.

External documentation.

isEnabled(Cap)

-spec isEnabled(Cap :: enum()) -> 0 | 1.

Equivalent to isEnabledi/2.

isEnabledi(Target, Index)

-spec isEnabledi(Target :: enum(), Index :: i()) -> 0 | 1.

gl:isEnabled/1 returns ?GL_TRUE if Cap is an enabled capability and returns ?GL_FALSE otherwise. Boolean states that are indexed may be tested with gl:isEnabledi/2. For gl:isEnabledi/2, Index specifies the index of the capability to test. Index must be between zero and the count of indexed capabilities for Cap. Initially all capabilities except ?GL_DITHER are disabled; ?GL_DITHER is initially enabled.

External documentation.

isFramebuffer(Framebuffer)

-spec isFramebuffer(Framebuffer :: i()) -> 0 | 1.

gl:isFramebuffer/1 returns ?GL_TRUE if Framebuffer is currently the name of a framebuffer object. If Framebuffer is zero, or if ?framebuffer is not the name of a framebuffer object, or if an error occurs, gl:isFramebuffer/1 returns ?GL_FALSE. If Framebuffer is a name returned by gl:genFramebuffers/1, by that has not yet been bound through a call to gl:bindFramebuffer/2, then the name is not a framebuffer object and gl:isFramebuffer/1 returns ?GL_FALSE.

External documentation.

isList(List)

-spec isList(List :: i()) -> 0 | 1.

gl:isList/1 returns ?GL_TRUE if List is the name of a display list and returns ?GL_FALSE if it is not, or if an error occurs.

External documentation.

isProgram(Program)

-spec isProgram(Program :: i()) -> 0 | 1.

gl:isProgram/1 returns ?GL_TRUE if Program is the name of a program object previously created with gl:createProgram/0 and not yet deleted with gl:deleteProgram/1. If Program is zero or a non-zero value that is not the name of a program object, or if an error occurs, gl:isProgram/1 returns ?GL_FALSE.

External documentation.

isProgramPipeline(Pipeline)

-spec isProgramPipeline(Pipeline :: i()) -> 0 | 1.

gl:isProgramPipeline/1 returns ?GL_TRUE if Pipeline is currently the name of a program pipeline object. If Pipeline is zero, or if ?pipeline is not the name of a program pipeline object, or if an error occurs, gl:isProgramPipeline/1 returns ?GL_FALSE. If Pipeline is a name returned by gl:genProgramPipelines/1, but that has not yet been bound through a call to gl:bindProgramPipeline/1, then the name is not a program pipeline object and gl:isProgramPipeline/1 returns ?GL_FALSE.

External documentation.

isQuery(Id)

-spec isQuery(Id :: i()) -> 0 | 1.

gl:isQuery/1 returns ?GL_TRUE if Id is currently the name of a query object. If Id is zero, or is a non-zero value that is not currently the name of a query object, or if an error occurs, gl:isQuery/1 returns ?GL_FALSE.

External documentation.

isRenderbuffer(Renderbuffer)

-spec isRenderbuffer(Renderbuffer :: i()) -> 0 | 1.

gl:isRenderbuffer/1 returns ?GL_TRUE if Renderbuffer is currently the name of a renderbuffer object. If Renderbuffer is zero, or if Renderbuffer is not the name of a renderbuffer object, or if an error occurs, gl:isRenderbuffer/1 returns ?GL_FALSE. If Renderbuffer is a name returned by gl:genRenderbuffers/1, by that has not yet been bound through a call to gl:bindRenderbuffer/2 or gl:framebufferRenderbuffer/4, then the name is not a renderbuffer object and gl:isRenderbuffer/1 returns ?GL_FALSE.

External documentation.

isSampler(Sampler)

-spec isSampler(Sampler :: i()) -> 0 | 1.

gl:isSampler/1 returns ?GL_TRUE if Id is currently the name of a sampler object. If Id is zero, or is a non-zero value that is not currently the name of a sampler object, or if an error occurs, gl:isSampler/1 returns ?GL_FALSE.

External documentation.

isShader(Shader)

-spec isShader(Shader :: i()) -> 0 | 1.

gl:isShader/1 returns ?GL_TRUE if Shader is the name of a shader object previously created with gl:createShader/1 and not yet deleted with gl:deleteShader/1. If Shader is zero or a non-zero value that is not the name of a shader object, or if an error occurs, glIsShaderreturns ?GL_FALSE.

External documentation.

isSync(Sync)

-spec isSync(Sync :: i()) -> 0 | 1.

gl:isSync/1 returns ?GL_TRUE if Sync is currently the name of a sync object. If Sync is not the name of a sync object, or if an error occurs, gl:isSync/1 returns ?GL_FALSE. Note that zero is not the name of a sync object.

External documentation.

isTexture(Texture)

-spec isTexture(Texture :: i()) -> 0 | 1.

gl:isTexture/1 returns ?GL_TRUE if Texture is currently the name of a texture. If Texture is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, gl:isTexture/1 returns ?GL_FALSE.

External documentation.

isTransformFeedback(Id)

-spec isTransformFeedback(Id :: i()) -> 0 | 1.

gl:isTransformFeedback/1 returns ?GL_TRUE if Id is currently the name of a transform feedback object. If Id is zero, or if ?id is not the name of a transform feedback object, or if an error occurs, gl:isTransformFeedback/1 returns ?GL_FALSE. If Id is a name returned by gl:genTransformFeedbacks/1, but that has not yet been bound through a call to gl:bindTransformFeedback/2, then the name is not a transform feedback object and gl:isTransformFeedback/1 returns ?GL_FALSE.

External documentation.

isVertexArray(Array)

-spec isVertexArray(Array :: i()) -> 0 | 1.

gl:isVertexArray/1 returns ?GL_TRUE if Array is currently the name of a vertex array object. If Array is zero, or if Array is not the name of a vertex array object, or if an error occurs, gl:isVertexArray/1 returns ?GL_FALSE. If Array is a name returned by gl:genVertexArrays/1, by that has not yet been bound through a call to gl:bindVertexArray/1, then the name is not a vertex array object and gl:isVertexArray/1 returns ?GL_FALSE.

External documentation.

lightf(Light, Pname, Param)

-spec lightf(Light :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to lightiv/3.

lightfv(Light, Pname, Params)

-spec lightfv(Light :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to lightiv/3.

lighti(Light, Pname, Param)

-spec lighti(Light :: enum(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to lightiv/3.

lightiv(Light, Pname, Params)

-spec lightiv(Light :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

gl:light() sets the values of individual light source parameters. Light names the light and is a symbolic name of the form ?GL_LIGHT i, where i ranges from 0 to the value of ?GL_MAX_LIGHTS - 1. Pname specifies one of ten light source parameters, again by symbolic name. Params is either a single value or a pointer to an array that contains the new values.

External documentation.

lightModelf(Pname, Param)

-spec lightModelf(Pname :: enum(), Param :: f()) -> ok.

Equivalent to lightModeliv/2.

lightModelfv(Pname, Params)

-spec lightModelfv(Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to lightModeliv/2.

lightModeli(Pname, Param)

-spec lightModeli(Pname :: enum(), Param :: i()) -> ok.

Equivalent to lightModeliv/2.

lightModeliv(Pname, Params)

-spec lightModeliv(Pname :: enum(), Params :: tuple()) -> ok.

gl:lightModel() sets the lighting model parameter. Pname names a parameter and Params gives the new value. There are three lighting model parameters:

External documentation.

lineStipple(Factor, Pattern)

-spec lineStipple(Factor :: i(), Pattern :: i()) -> ok.

Line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is achieved by using three parameters: the 16-bit line stipple pattern Pattern, the repeat count Factor, and an integer stipple counter s.

External documentation.

lineWidth(Width)

-spec lineWidth(Width :: f()) -> ok.

gl:lineWidth/1 specifies the rasterized width of both aliased and antialiased lines. Using a line width other than 1 has different effects, depending on whether line antialiasing is enabled. To enable and disable line antialiasing, call gl:enable/1 and gl:disable/1 with argument ?GL_LINE_SMOOTH. Line antialiasing is initially disabled.

External documentation.

linkProgram(Program)

-spec linkProgram(Program :: i()) -> ok.

gl:linkProgram/1 links the program object specified by Program. If any shader objects of type ?GL_VERTEX_SHADER are attached to Program, they will be used to create an executable that will run on the programmable vertex processor. If any shader objects of type ?GL_GEOMETRY_SHADER are attached to Program, they will be used to create an executable that will run on the programmable geometry processor. If any shader objects of type ?GL_FRAGMENT_SHADER are attached to Program, they will be used to create an executable that will run on the programmable fragment processor.

External documentation.

listBase(Base)

-spec listBase(Base :: i()) -> ok.

gl:callLists/1 specifies an array of offsets. Display-list names are generated by adding Base to each offset. Names that reference valid display lists are executed; the others are ignored.

External documentation.

loadIdentity()

-spec loadIdentity() -> ok.

gl:loadIdentity/0 replaces the current matrix with the identity matrix. It is semantically equivalent to calling gl:loadMatrix() with the identity matrix

External documentation.

loadMatrixd(M)

-spec loadMatrixd(M :: matrix()) -> ok.

Equivalent to loadMatrixf/1.

loadMatrixf(M)

-spec loadMatrixf(M :: matrix()) -> ok.

gl:loadMatrix() replaces the current matrix with the one whose elements are specified by M. The current matrix is the projection matrix, modelview matrix, or texture matrix, depending on the current matrix mode (see gl:matrixMode/1).

External documentation.

loadName(Name)

-spec loadName(Name :: i()) -> ok.

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers and is initially empty.

External documentation.

loadTransposeMatrixd(M)

-spec loadTransposeMatrixd(M :: matrix()) -> ok.

Equivalent to loadTransposeMatrixf/1.

loadTransposeMatrixf(M)

-spec loadTransposeMatrixf(M :: matrix()) -> ok.

gl:loadTransposeMatrix() replaces the current matrix with the one whose elements are specified by M. The current matrix is the projection matrix, modelview matrix, or texture matrix, depending on the current matrix mode (see gl:matrixMode/1).

External documentation.

logicOp(Opcode)

-spec logicOp(Opcode :: enum()) -> ok.

gl:logicOp/1 specifies a logical operation that, when enabled, is applied between the incoming RGBA color and the RGBA color at the corresponding location in the frame buffer. To enable or disable the logical operation, call gl:enable/1 and gl:disable/1 using the symbolic constant ?GL_COLOR_LOGIC_OP. The initial value is disabled.

External documentation.

map1d(Target, U1, U2, Stride, Order, Points)

-spec map1d(Target :: enum(), U1 :: f(), U2 :: f(), Stride :: i(), Order :: i(), Points :: binary()) ->
               ok.

Equivalent to map1f/6.

map1f(Target, U1, U2, Stride, Order, Points)

-spec map1f(Target :: enum(), U1 :: f(), U2 :: f(), Stride :: i(), Order :: i(), Points :: binary()) ->
               ok.

Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent to further stages of GL processing just as if they had been presented using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands, except that the generated values do not update the current normal, texture coordinates, or color.

External documentation.

map2d(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points)

-spec map2d(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points) -> ok
               when
                   Target :: enum(),
                   U1 :: f(),
                   U2 :: f(),
                   Ustride :: i(),
                   Uorder :: i(),
                   V1 :: f(),
                   V2 :: f(),
                   Vstride :: i(),
                   Vorder :: i(),
                   Points :: binary().

Equivalent to map2f/10.

map2f(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points)

-spec map2f(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points) -> ok
               when
                   Target :: enum(),
                   U1 :: f(),
                   U2 :: f(),
                   Ustride :: i(),
                   Uorder :: i(),
                   V1 :: f(),
                   V2 :: f(),
                   Vstride :: i(),
                   Vorder :: i(),
                   Points :: binary().

Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent on to further stages of GL processing just as if they had been presented using gl:vertex(), gl:normal(), gl:texCoord(), and gl:color() commands, except that the generated values do not update the current normal, texture coordinates, or color.

External documentation.

mapGrid1d(Un, U1, U2)

-spec mapGrid1d(Un :: i(), U1 :: f(), U2 :: f()) -> ok.

Equivalent to mapGrid2f/6.

mapGrid1f(Un, U1, U2)

-spec mapGrid1f(Un :: i(), U1 :: f(), U2 :: f()) -> ok.

Equivalent to mapGrid2f/6.

mapGrid2d(Un, U1, U2, Vn, V1, V2)

-spec mapGrid2d(Un :: i(), U1 :: f(), U2 :: f(), Vn :: i(), V1 :: f(), V2 :: f()) -> ok.

Equivalent to mapGrid2f/6.

mapGrid2f(Un, U1, U2, Vn, V1, V2)

-spec mapGrid2f(Un :: i(), U1 :: f(), U2 :: f(), Vn :: i(), V1 :: f(), V2 :: f()) -> ok.

gl:mapGrid() and gl:evalMesh() are used together to efficiently generate and evaluate a series of evenly-spaced map domain values. gl:evalMesh() steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2.

External documentation.

materialf(Face, Pname, Param)

-spec materialf(Face :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to materialiv/3.

materialfv(Face, Pname, Params)

-spec materialfv(Face :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to materialiv/3.

materiali(Face, Pname, Param)

-spec materiali(Face :: enum(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to materialiv/3.

materialiv(Face, Pname, Params)

-spec materialiv(Face :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

gl:material() assigns values to material parameters. There are two matched sets of material parameters. One, the front-facing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled). The other set, back-facing, is used to shade back-facing polygons only when two-sided lighting is enabled. Refer to the gl:lightModel() reference page for details concerning one- and two-sided lighting calculations.

External documentation.

matrixMode(Mode)

-spec matrixMode(Mode :: enum()) -> ok.

gl:matrixMode/1 sets the current matrix mode. Mode can assume one of four values:

External documentation.

memoryBarrier(Barriers)

-spec memoryBarrier(Barriers :: i()) -> ok.

Equivalent to memoryBarrierByRegion/1.

memoryBarrierByRegion(Barriers)

-spec memoryBarrierByRegion(Barriers :: i()) -> ok.

gl:memoryBarrier/1 defines a barrier ordering the memory transactions issued prior to the command relative to those issued after the barrier. For the purposes of this ordering, memory transactions performed by shaders are considered to be issued by the rendering command that triggered the execution of the shader. Barriers is a bitfield indicating the set of operations that are synchronized with shader stores; the bits used in Barriers are as follows:

External documentation.

minmax(Target, Internalformat, Sink)

-spec minmax(Target :: enum(), Internalformat :: enum(), Sink :: 0 | 1) -> ok.

When ?GL_MINMAX is enabled, the RGBA components of incoming pixels are compared to the minimum and maximum values for each component, which are stored in the two-element minmax table. (The first element stores the minima, and the second element stores the maxima.) If a pixel component is greater than the corresponding component in the maximum element, then the maximum element is updated with the pixel component value. If a pixel component is less than the corresponding component in the minimum element, then the minimum element is updated with the pixel component value. (In both cases, if the internal format of the minmax table includes luminance, then the R color component of incoming pixels is used for comparison.) The contents of the minmax table may be retrieved at a later time by calling gl:getMinmax/5. The minmax operation is enabled or disabled by calling gl:enable/1 or gl:disable/1, respectively, with an argument of ?GL_MINMAX.

External documentation.

minSampleShading(Value)

-spec minSampleShading(Value :: f()) -> ok.

gl:minSampleShading/1 specifies the rate at which samples are shaded within a covered pixel. Sample-rate shading is enabled by calling gl:enable/1 with the parameter ?GL_SAMPLE_SHADING. If ?GL_MULTISAMPLE or ?GL_SAMPLE_SHADING is disabled, sample shading has no effect. Otherwise, an implementation must provide at least as many unique color values for each covered fragment as specified by Value times Samples where Samples is the value of ?GL_SAMPLES for the current framebuffer. At least 1 sample for each covered fragment is generated.

External documentation.

multiDrawArrays(Mode, First, Count)

-spec multiDrawArrays(Mode :: enum(), First :: [integer()] | mem(), Count :: [integer()] | mem()) -> ok.

gl:multiDrawArrays/3 specifies multiple sets of geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to gl:multiDrawArrays/3.

External documentation.

multiDrawArraysIndirect(Mode, Indirect, Drawcount, Stride)

-spec multiDrawArraysIndirect(Mode :: enum(),
                              Indirect :: offset() | mem(),
                              Drawcount :: i(),
                              Stride :: i()) ->
                                 ok.

gl:multiDrawArraysIndirect/4 specifies multiple geometric primitives with very few subroutine calls. gl:multiDrawArraysIndirect/4 behaves similarly to a multitude of calls to gl:drawArraysInstancedBaseInstance/5, execept that the parameters to each call to gl:drawArraysInstancedBaseInstance/5 are stored in an array in memory at the address given by Indirect, separated by the stride, in basic machine units, specified by Stride. If Stride is zero, then the array is assumed to be tightly packed in memory.

External documentation.

multiDrawArraysIndirectCount(Mode, Indirect, Drawcount, Maxdrawcount, Stride)

-spec multiDrawArraysIndirectCount(Mode, Indirect, Drawcount, Maxdrawcount, Stride) -> ok
                                      when
                                          Mode :: enum(),
                                          Indirect :: offset() | mem(),
                                          Drawcount :: i(),
                                          Maxdrawcount :: i(),
                                          Stride :: i().

No documentation available.

multiTexCoord1d(Target, S)

-spec multiTexCoord1d(Target :: enum(), S :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1dv/2

-spec multiTexCoord1dv(Target :: enum(), {S :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1f(Target, S)

-spec multiTexCoord1f(Target :: enum(), S :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1fv/2

-spec multiTexCoord1fv(Target :: enum(), {S :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1i(Target, S)

-spec multiTexCoord1i(Target :: enum(), S :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1iv/2

-spec multiTexCoord1iv(Target :: enum(), {S :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1s(Target, S)

-spec multiTexCoord1s(Target :: enum(), S :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord1sv/2

-spec multiTexCoord1sv(Target :: enum(), {S :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2d(Target, S, T)

-spec multiTexCoord2d(Target :: enum(), S :: f(), T :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2dv/2

-spec multiTexCoord2dv(Target :: enum(), {S :: f(), T :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2f(Target, S, T)

-spec multiTexCoord2f(Target :: enum(), S :: f(), T :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2fv/2

-spec multiTexCoord2fv(Target :: enum(), {S :: f(), T :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2i(Target, S, T)

-spec multiTexCoord2i(Target :: enum(), S :: i(), T :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2iv/2

-spec multiTexCoord2iv(Target :: enum(), {S :: i(), T :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2s(Target, S, T)

-spec multiTexCoord2s(Target :: enum(), S :: i(), T :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord2sv/2

-spec multiTexCoord2sv(Target :: enum(), {S :: i(), T :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3d(Target, S, T, R)

-spec multiTexCoord3d(Target :: enum(), S :: f(), T :: f(), R :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3dv/2

-spec multiTexCoord3dv(Target :: enum(), {S :: f(), T :: f(), R :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3f(Target, S, T, R)

-spec multiTexCoord3f(Target :: enum(), S :: f(), T :: f(), R :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3fv/2

-spec multiTexCoord3fv(Target :: enum(), {S :: f(), T :: f(), R :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3i(Target, S, T, R)

-spec multiTexCoord3i(Target :: enum(), S :: i(), T :: i(), R :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3iv/2

-spec multiTexCoord3iv(Target :: enum(), {S :: i(), T :: i(), R :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3s(Target, S, T, R)

-spec multiTexCoord3s(Target :: enum(), S :: i(), T :: i(), R :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord3sv/2

-spec multiTexCoord3sv(Target :: enum(), {S :: i(), T :: i(), R :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4d(Target, S, T, R, Q)

-spec multiTexCoord4d(Target :: enum(), S :: f(), T :: f(), R :: f(), Q :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4dv/2

-spec multiTexCoord4dv(Target :: enum(), {S :: f(), T :: f(), R :: f(), Q :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4f(Target, S, T, R, Q)

-spec multiTexCoord4f(Target :: enum(), S :: f(), T :: f(), R :: f(), Q :: f()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4fv/2

-spec multiTexCoord4fv(Target :: enum(), {S :: f(), T :: f(), R :: f(), Q :: f()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4i(Target, S, T, R, Q)

-spec multiTexCoord4i(Target :: enum(), S :: i(), T :: i(), R :: i(), Q :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4iv/2

-spec multiTexCoord4iv(Target :: enum(), {S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4s(Target, S, T, R, Q)

-spec multiTexCoord4s(Target :: enum(), S :: i(), T :: i(), R :: i(), Q :: i()) -> ok.

Equivalent to multiTexCoord4sv/2.

multiTexCoord4sv/2

-spec multiTexCoord4sv(Target :: enum(), {S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.

gl:multiTexCoord() specifies texture coordinates in one, two, three, or four dimensions. gl:multiTexCoord1() sets the current texture coordinates to (s 0 0 1); a call to gl:multiTexCoord2() sets them to (s t 0 1). Similarly, gl:multiTexCoord3() specifies the texture coordinates as (s t r 1), and gl:multiTexCoord4() defines all four components explicitly as (s t r q).

External documentation.

multMatrixd(M)

-spec multMatrixd(M :: matrix()) -> ok.

Equivalent to multMatrixf/1.

multMatrixf(M)

-spec multMatrixf(M :: matrix()) -> ok.

gl:multMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product.

External documentation.

multTransposeMatrixd(M)

-spec multTransposeMatrixd(M :: matrix()) -> ok.

Equivalent to multTransposeMatrixf/1.

multTransposeMatrixf(M)

-spec multTransposeMatrixf(M :: matrix()) -> ok.

gl:multTransposeMatrix() multiplies the current matrix with the one specified using M, and replaces the current matrix with the product.

External documentation.

newList(List, Mode)

-spec newList(List :: i(), Mode :: enum()) -> ok.

Display lists are groups of GL commands that have been stored for subsequent execution. Display lists are created with gl:newList/2. All subsequent commands are placed in the display list, in the order issued, until gl:endList/0 is called.

External documentation.

normal3b(Nx, Ny, Nz)

-spec normal3b(Nx :: i(), Ny :: i(), Nz :: i()) -> ok.

Equivalent to normal3sv/1.

normal3bv/1

-spec normal3bv({Nx :: i(), Ny :: i(), Nz :: i()}) -> ok.

Equivalent to normal3sv/1.

normal3d(Nx, Ny, Nz)

-spec normal3d(Nx :: f(), Ny :: f(), Nz :: f()) -> ok.

Equivalent to normal3sv/1.

normal3dv/1

-spec normal3dv({Nx :: f(), Ny :: f(), Nz :: f()}) -> ok.

Equivalent to normal3sv/1.

normal3f(Nx, Ny, Nz)

-spec normal3f(Nx :: f(), Ny :: f(), Nz :: f()) -> ok.

Equivalent to normal3sv/1.

normal3fv/1

-spec normal3fv({Nx :: f(), Ny :: f(), Nz :: f()}) -> ok.

Equivalent to normal3sv/1.

normal3i(Nx, Ny, Nz)

-spec normal3i(Nx :: i(), Ny :: i(), Nz :: i()) -> ok.

Equivalent to normal3sv/1.

normal3iv/1

-spec normal3iv({Nx :: i(), Ny :: i(), Nz :: i()}) -> ok.

Equivalent to normal3sv/1.

normal3s(Nx, Ny, Nz)

-spec normal3s(Nx :: i(), Ny :: i(), Nz :: i()) -> ok.

Equivalent to normal3sv/1.

normal3sv/1

-spec normal3sv({Nx :: i(), Ny :: i(), Nz :: i()}) -> ok.

The current normal is set to the given coordinates whenever gl:normal() is issued. Byte, short, or integer arguments are converted to floating-point format with a linear mapping that maps the most positive representable integer value to 1.0 and the most negative representable integer value to -1.0.

External documentation.

normalPointer(Type, Stride, Ptr)

-spec normalPointer(Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:normalPointer/3 specifies the location and data format of an array of normals to use when rendering. Type specifies the data type of each normal coordinate, and Stride specifies the byte stride from one normal to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

External documentation.

objectPtrLabel(Ptr, Length, Label)

-spec objectPtrLabel(Ptr :: offset() | mem(), Length :: i(), Label :: string()) -> ok.

gl:objectPtrLabel/3 labels the sync object identified by Ptr.

External documentation.

ortho(Left, Right, Bottom, Top, Near_val, Far_val)

-spec ortho(Left :: f(), Right :: f(), Bottom :: f(), Top :: f(), Near_val :: f(), Far_val :: f()) -> ok.

gl:ortho/6 describes a transformation that produces a parallel projection. The current matrix (see gl:matrixMode/1) is multiplied by this matrix and the result replaces the current matrix, as if gl:multMatrix() were called with the following matrix as its argument:

External documentation.

passThrough(Token)

-spec passThrough(Token :: f()) -> ok.

External documentation.

patchParameterfv(Pname, Values)

-spec patchParameterfv(Pname :: enum(), Values :: [f()]) -> ok.

Equivalent to patchParameteri/2.

patchParameteri(Pname, Value)

-spec patchParameteri(Pname :: enum(), Value :: i()) -> ok.

gl:patchParameter() specifies the parameters that will be used for patch primitives. Pname specifies the parameter to modify and must be either ?GL_PATCH_VERTICES, ?GL_PATCH_DEFAULT_OUTER_LEVEL or ?GL_PATCH_DEFAULT_INNER_LEVEL. For gl:patchParameteri/2, Value specifies the new value for the parameter specified by Pname. For gl:patchParameterfv/2, Values specifies the address of an array containing the new values for the parameter specified by Pname.

External documentation.

pauseTransformFeedback()

-spec pauseTransformFeedback() -> ok.

gl:pauseTransformFeedback/0 pauses transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.

External documentation.

pixelMapfv(Map, Mapsize, Values)

-spec pixelMapfv(Map :: enum(), Mapsize :: i(), Values :: binary()) -> ok.

Equivalent to pixelMapusv/3.

pixelMapuiv(Map, Mapsize, Values)

-spec pixelMapuiv(Map :: enum(), Mapsize :: i(), Values :: binary()) -> ok.

Equivalent to pixelMapusv/3.

pixelMapusv(Map, Mapsize, Values)

-spec pixelMapusv(Map :: enum(), Mapsize :: i(), Values :: binary()) -> ok.

gl:pixelMap() sets up translation tables, or maps, used by gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8. Use of these maps is described completely in the gl:pixelTransfer() reference page, and partly in the reference pages for the pixel and texture image commands. Only the specification of the maps is described in this reference page.

External documentation.

pixelStoref(Pname, Param)

-spec pixelStoref(Pname :: enum(), Param :: f()) -> ok.

Equivalent to pixelStorei/2.

pixelStorei(Pname, Param)

-spec pixelStorei(Pname :: enum(), Param :: i()) -> ok.

gl:pixelStore() sets pixel storage modes that affect the operation of subsequent gl:readPixels/7 as well as the unpacking of texture patterns (see gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, gl:texSubImage3D/11), gl:compressedTexImage1D/7, gl:compressedTexImage2D/8, gl:compressedTexImage3D/9, gl:compressedTexSubImage1D/7, gl:compressedTexSubImage2D/9 or gl:compressedTexSubImage1D/7.

External documentation.

pixelTransferf(Pname, Param)

-spec pixelTransferf(Pname :: enum(), Param :: f()) -> ok.

Equivalent to pixelTransferi/2.

pixelTransferi(Pname, Param)

-spec pixelTransferi(Pname :: enum(), Param :: i()) -> ok.

gl:pixelTransfer() sets pixel transfer modes that affect the operation of subsequent gl:copyPixels/5, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, gl:drawPixels/5, gl:readPixels/7, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11 commands. Additionally, if the ARB_imaging subset is supported, the routines gl:colorTable/6, gl:colorSubTable/6, gl:convolutionFilter1D/6, gl:convolutionFilter2D/7, gl:histogram/4, gl:minmax/3, and gl:separableFilter2D/8 are also affected. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (gl:copyPixels/5gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, gl:copyTexSubImage3D/9, and gl:readPixels/7), or unpacked from client memory (gl:drawPixels/5, gl:texImage1D/8, gl:texImage2D/9, gl:texImage3D/10, gl:texSubImage1D/7, gl:texSubImage2D/9, and gl:texSubImage3D/11). Pixel transfer operations happen in the same order, and in the same manner, regardless of the command that resulted in the pixel operation. Pixel storage modes (see gl:pixelStore()) control the unpacking of pixels being read from client memory and the packing of pixels being written back into client memory.

External documentation.

pixelZoom(Xfactor, Yfactor)

-spec pixelZoom(Xfactor :: f(), Yfactor :: f()) -> ok.

gl:pixelZoom/2 specifies values for the x and y zoom factors. During the execution of gl:drawPixels/5 or gl:copyPixels/5, if ( xr, yr) is the current raster position, and a given element is in the mth row and nth column of the pixel rectangle, then pixels whose centers are in the rectangle with corners at

External documentation.

pointParameterf(Pname, Param)

-spec pointParameterf(Pname :: enum(), Param :: f()) -> ok.

Equivalent to pointParameteriv/2.

pointParameterfv(Pname, Params)

-spec pointParameterfv(Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to pointParameteriv/2.

pointParameteri(Pname, Param)

-spec pointParameteri(Pname :: enum(), Param :: i()) -> ok.

Equivalent to pointParameteriv/2.

pointParameteriv(Pname, Params)

-spec pointParameteriv(Pname :: enum(), Params :: tuple()) -> ok.

The following values are accepted for Pname:

External documentation.

pointSize(Size)

-spec pointSize(Size :: f()) -> ok.

gl:pointSize/1 specifies the rasterized diameter of points. If point size mode is disabled (see gl:enable/1 with parameter ?GL_PROGRAM_POINT_SIZE), this value will be used to rasterize points. Otherwise, the value written to the shading language built-in variable gl_PointSize will be used.

External documentation.

polygonMode(Face, Mode)

-spec polygonMode(Face :: enum(), Mode :: enum()) -> ok.

gl:polygonMode/2 controls the interpretation of polygons for rasterization. Face describes which polygons Mode applies to: both front and back-facing polygons (?GL_FRONT_AND_BACK). The polygon mode affects only the final rasterization of polygons. In particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied.

External documentation.

polygonOffset(Factor, Units)

-spec polygonOffset(Factor :: f(), Units :: f()) -> ok.

When ?GL_POLYGON_OFFSET_FILL, ?GL_POLYGON_OFFSET_LINE, or ?GL_POLYGON_OFFSET_POINT is enabled, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The value of the offset is factor×DZ+r×units, where DZ is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value that is guaranteed to produce a resolvable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer.

External documentation.

polygonOffsetClamp(Factor, Units, Clamp)

-spec polygonOffsetClamp(Factor :: f(), Units :: f(), Clamp :: f()) -> ok.

No documentation available.

polygonStipple(Mask)

-spec polygonStipple(Mask :: binary()) -> ok.

Polygon stippling, like line stippling (see gl:lineStipple/2), masks out certain fragments produced by rasterization, creating a pattern. Stippling is independent of polygon antialiasing.

External documentation.

popAttrib()

-spec popAttrib() -> ok.

Equivalent to pushAttrib/1.

popClientAttrib()

-spec popClientAttrib() -> ok.

Equivalent to pushClientAttrib/1.

popDebugGroup()

-spec popDebugGroup() -> ok.

Equivalent to pushDebugGroup/4.

popMatrix()

-spec popMatrix() -> ok.

Equivalent to pushMatrix/0.

popName()

-spec popName() -> ok.

Equivalent to pushName/1.

primitiveRestartIndex(Index)

-spec primitiveRestartIndex(Index :: i()) -> ok.

gl:primitiveRestartIndex/1 specifies a vertex array element that is treated specially when primitive restarting is enabled. This is known as the primitive restart index.

External documentation.

prioritizeTextures(Textures, Priorities)

-spec prioritizeTextures(Textures :: [i()], Priorities :: [clamp()]) -> ok.

gl:prioritizeTextures/2 assigns the N texture priorities given in Priorities to the N textures named in Textures.

External documentation.

programBinary(Program, BinaryFormat, Binary)

-spec programBinary(Program :: i(), BinaryFormat :: enum(), Binary :: binary()) -> ok.

gl:programBinary/3 loads a program object with a program binary previously returned from gl:getProgramBinary/2. BinaryFormat and Binary must be those returned by a previous call to gl:getProgramBinary/2, and Length must be the length returned by gl:getProgramBinary/2, or by gl:getProgram() when called with Pname set to ?GL_PROGRAM_BINARY_LENGTH. If these conditions are not met, loading the program binary will fail and Program's ?GL_LINK_STATUS will be set to ?GL_FALSE.

External documentation.

programParameteri(Program, Pname, Value)

-spec programParameteri(Program :: i(), Pname :: enum(), Value :: i()) -> ok.

gl:programParameter() specifies a new value for the parameter nameed by Pname for the program object Program.

External documentation.

programUniform1d(Program, Location, V0)

-spec programUniform1d(Program :: i(), Location :: i(), V0 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1dv(Program, Location, Value)

-spec programUniform1dv(Program :: i(), Location :: i(), Value :: [f()]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1f(Program, Location, V0)

-spec programUniform1f(Program :: i(), Location :: i(), V0 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1fv(Program, Location, Value)

-spec programUniform1fv(Program :: i(), Location :: i(), Value :: [f()]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1i(Program, Location, V0)

-spec programUniform1i(Program :: i(), Location :: i(), V0 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1iv(Program, Location, Value)

-spec programUniform1iv(Program :: i(), Location :: i(), Value :: [i()]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1ui(Program, Location, V0)

-spec programUniform1ui(Program :: i(), Location :: i(), V0 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform1uiv(Program, Location, Value)

-spec programUniform1uiv(Program :: i(), Location :: i(), Value :: [i()]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2d(Program, Location, V0, V1)

-spec programUniform2d(Program :: i(), Location :: i(), V0 :: f(), V1 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2dv(Program, Location, Value)

-spec programUniform2dv(Program :: i(), Location :: i(), Value :: [{f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2f(Program, Location, V0, V1)

-spec programUniform2f(Program :: i(), Location :: i(), V0 :: f(), V1 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2fv(Program, Location, Value)

-spec programUniform2fv(Program :: i(), Location :: i(), Value :: [{f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2i(Program, Location, V0, V1)

-spec programUniform2i(Program :: i(), Location :: i(), V0 :: i(), V1 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2iv(Program, Location, Value)

-spec programUniform2iv(Program :: i(), Location :: i(), Value :: [{i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2ui(Program, Location, V0, V1)

-spec programUniform2ui(Program :: i(), Location :: i(), V0 :: i(), V1 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform2uiv(Program, Location, Value)

-spec programUniform2uiv(Program :: i(), Location :: i(), Value :: [{i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3d(Program, Location, V0, V1, V2)

-spec programUniform3d(Program :: i(), Location :: i(), V0 :: f(), V1 :: f(), V2 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3dv(Program, Location, Value)

-spec programUniform3dv(Program :: i(), Location :: i(), Value :: [{f(), f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3f(Program, Location, V0, V1, V2)

-spec programUniform3f(Program :: i(), Location :: i(), V0 :: f(), V1 :: f(), V2 :: f()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3fv(Program, Location, Value)

-spec programUniform3fv(Program :: i(), Location :: i(), Value :: [{f(), f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3i(Program, Location, V0, V1, V2)

-spec programUniform3i(Program :: i(), Location :: i(), V0 :: i(), V1 :: i(), V2 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3iv(Program, Location, Value)

-spec programUniform3iv(Program :: i(), Location :: i(), Value :: [{i(), i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3ui(Program, Location, V0, V1, V2)

-spec programUniform3ui(Program :: i(), Location :: i(), V0 :: i(), V1 :: i(), V2 :: i()) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform3uiv(Program, Location, Value)

-spec programUniform3uiv(Program :: i(), Location :: i(), Value :: [{i(), i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4d(Program, Location, V0, V1, V2, V3)

-spec programUniform4d(Program :: i(), Location :: i(), V0 :: f(), V1 :: f(), V2 :: f(), V3 :: f()) ->
                          ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4dv(Program, Location, Value)

-spec programUniform4dv(Program :: i(), Location :: i(), Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4f(Program, Location, V0, V1, V2, V3)

-spec programUniform4f(Program :: i(), Location :: i(), V0 :: f(), V1 :: f(), V2 :: f(), V3 :: f()) ->
                          ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4fv(Program, Location, Value)

-spec programUniform4fv(Program :: i(), Location :: i(), Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4i(Program, Location, V0, V1, V2, V3)

-spec programUniform4i(Program :: i(), Location :: i(), V0 :: i(), V1 :: i(), V2 :: i(), V3 :: i()) ->
                          ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4iv(Program, Location, Value)

-spec programUniform4iv(Program :: i(), Location :: i(), Value :: [{i(), i(), i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4ui(Program, Location, V0, V1, V2, V3)

-spec programUniform4ui(Program :: i(), Location :: i(), V0 :: i(), V1 :: i(), V2 :: i(), V3 :: i()) ->
                           ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniform4uiv(Program, Location, Value)

-spec programUniform4uiv(Program :: i(), Location :: i(), Value :: [{i(), i(), i(), i()}]) -> ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2dv(Program, Location, Transpose, Value)

-spec programUniformMatrix2dv(Program :: i(),
                              Location :: i(),
                              Transpose :: 0 | 1,
                              Value :: [{f(), f(), f(), f()}]) ->
                                 ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2fv(Program, Location, Transpose, Value)

-spec programUniformMatrix2fv(Program :: i(),
                              Location :: i(),
                              Transpose :: 0 | 1,
                              Value :: [{f(), f(), f(), f()}]) ->
                                 ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x3dv(Program, Location, Transpose, Value)

-spec programUniformMatrix2x3dv(Program :: i(),
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                                   ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x3fv(Program, Location, Transpose, Value)

-spec programUniformMatrix2x3fv(Program :: i(),
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                                   ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x4dv(Program, Location, Transpose, Value)

-spec programUniformMatrix2x4dv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix2x4fv(Program, Location, Transpose, Value)

-spec programUniformMatrix2x4fv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3dv(Program, Location, Transpose, Value)

-spec programUniformMatrix3dv(Program, Location, Transpose, Value) -> ok
                                 when
                                     Program :: i(),
                                     Location :: i(),
                                     Transpose :: 0 | 1,
                                     Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3fv(Program, Location, Transpose, Value)

-spec programUniformMatrix3fv(Program, Location, Transpose, Value) -> ok
                                 when
                                     Program :: i(),
                                     Location :: i(),
                                     Transpose :: 0 | 1,
                                     Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x2dv(Program, Location, Transpose, Value)

-spec programUniformMatrix3x2dv(Program :: i(),
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                                   ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x2fv(Program, Location, Transpose, Value)

-spec programUniformMatrix3x2fv(Program :: i(),
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                                   ok.

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x4dv(Program, Location, Transpose, Value)

-spec programUniformMatrix3x4dv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value ::
                                           [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix3x4fv(Program, Location, Transpose, Value)

-spec programUniformMatrix3x4fv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value ::
                                           [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4dv(Program, Location, Transpose, Value)

-spec programUniformMatrix4dv(Program, Location, Transpose, Value) -> ok
                                 when
                                     Program :: i(),
                                     Location :: i(),
                                     Transpose :: 0 | 1,
                                     Value ::
                                         [{f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4fv(Program, Location, Transpose, Value)

-spec programUniformMatrix4fv(Program, Location, Transpose, Value) -> ok
                                 when
                                     Program :: i(),
                                     Location :: i(),
                                     Transpose :: 0 | 1,
                                     Value ::
                                         [{f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f(),
                                           f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x2dv(Program, Location, Transpose, Value)

-spec programUniformMatrix4x2dv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x2fv(Program, Location, Transpose, Value)

-spec programUniformMatrix4x2fv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x3dv(Program, Location, Transpose, Value)

-spec programUniformMatrix4x3dv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value ::
                                           [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to programUniformMatrix4x3fv/4.

programUniformMatrix4x3fv(Program, Location, Transpose, Value)

-spec programUniformMatrix4x3fv(Program, Location, Transpose, Value) -> ok
                                   when
                                       Program :: i(),
                                       Location :: i(),
                                       Transpose :: 0 | 1,
                                       Value ::
                                           [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

gl:programUniform() modifies the value of a uniform variable or a uniform variable array. The location of the uniform variable to be modified is specified by Location, which should be a value returned by gl:getUniformLocation/2. gl:programUniform() operates on the program object specified by Program.

External documentation.

provokingVertex(Mode)

-spec provokingVertex(Mode :: enum()) -> ok.

Flatshading a vertex shader varying output means to assign all vetices of the primitive the same value for that output. The vertex from which these values is derived is known as the provoking vertex and gl:provokingVertex/1 specifies which vertex is to be used as the source of data for flat shaded varyings.

External documentation.

pushAttrib(Mask)

-spec pushAttrib(Mask :: i()) -> ok.

gl:pushAttrib/1 takes one argument, a mask that indicates which groups of state variables to save on the attribute stack. Symbolic constants are used to set bits in the mask. Mask is typically constructed by specifying the bitwise-or of several of these constants together. The special mask ?GL_ALL_ATTRIB_BITS can be used to save all stackable states.

External documentation.

pushClientAttrib(Mask)

-spec pushClientAttrib(Mask :: i()) -> ok.

gl:pushClientAttrib/1 takes one argument, a mask that indicates which groups of client-state variables to save on the client attribute stack. Symbolic constants are used to set bits in the mask. Mask is typically constructed by specifying the bitwise-or of several of these constants together. The special mask ?GL_CLIENT_ALL_ATTRIB_BITS can be used to save all stackable client state.

External documentation.

pushDebugGroup(Source, Id, Length, Message)

-spec pushDebugGroup(Source :: enum(), Id :: i(), Length :: i(), Message :: string()) -> ok.

gl:pushDebugGroup/4 pushes a debug group described by the string Message into the command stream. The value of Id specifies the ID of messages generated. The parameter Length contains the number of characters in Message. If Length is negative, it is implied that Message contains a null terminated string. The message has the specified Source and Id, the Type``?GL_DEBUG_TYPE_PUSH_GROUP, and Severity``?GL_DEBUG_SEVERITY_NOTIFICATION. The GL will put a new debug group on top of the debug group stack which inherits the control of the volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group.

External documentation.

pushMatrix()

-spec pushMatrix() -> ok.

There is a stack of matrices for each of the matrix modes. In ?GL_MODELVIEW mode, the stack depth is at least 32. In the other modes, ?GL_COLOR, ?GL_PROJECTION, and ?GL_TEXTURE, the depth is at least 2. The current matrix in any mode is the matrix on the top of the stack for that mode.

External documentation.

pushName(Name)

-spec pushName(Name :: i()) -> ok.

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers and is initially empty.

External documentation.

queryCounter(Id, Target)

-spec queryCounter(Id :: i(), Target :: enum()) -> ok.

gl:queryCounter/2 causes the GL to record the current time into the query object named Id. Target must be ?GL_TIMESTAMP. The time is recorded after all previous commands on the GL client and server state and the framebuffer have been fully realized. When the time is recorded, the query result for that object is marked available. gl:queryCounter/2 timer queries can be used within a gl:beginQuery/2 / gl:endQuery/1 block where the target is ?GL_TIME_ELAPSED and it does not affect the result of that query object.

External documentation.

rasterPos2d(X, Y)

-spec rasterPos2d(X :: f(), Y :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2dv/1

-spec rasterPos2dv({X :: f(), Y :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2f(X, Y)

-spec rasterPos2f(X :: f(), Y :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2fv/1

-spec rasterPos2fv({X :: f(), Y :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2i(X, Y)

-spec rasterPos2i(X :: i(), Y :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2iv/1

-spec rasterPos2iv({X :: i(), Y :: i()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2s(X, Y)

-spec rasterPos2s(X :: i(), Y :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos2sv/1

-spec rasterPos2sv({X :: i(), Y :: i()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3d(X, Y, Z)

-spec rasterPos3d(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3dv/1

-spec rasterPos3dv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3f(X, Y, Z)

-spec rasterPos3f(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3fv/1

-spec rasterPos3fv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3i(X, Y, Z)

-spec rasterPos3i(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3iv/1

-spec rasterPos3iv({X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3s(X, Y, Z)

-spec rasterPos3s(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos3sv/1

-spec rasterPos3sv({X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4d(X, Y, Z, W)

-spec rasterPos4d(X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4dv/1

-spec rasterPos4dv({X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4f(X, Y, Z, W)

-spec rasterPos4f(X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4fv/1

-spec rasterPos4fv({X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4i(X, Y, Z, W)

-spec rasterPos4i(X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4iv/1

-spec rasterPos4iv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4s(X, Y, Z, W)

-spec rasterPos4s(X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to rasterPos4sv/1.

rasterPos4sv/1

-spec rasterPos4sv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See gl:bitmap/7, gl:drawPixels/5, and gl:copyPixels/5.

External documentation.

readBuffer(Mode)

-spec readBuffer(Mode :: enum()) -> ok.

gl:readBuffer/1 specifies a color buffer as the source for subsequent gl:readPixels/7, gl:copyTexImage1D/7, gl:copyTexImage2D/8, gl:copyTexSubImage1D/6, gl:copyTexSubImage2D/8, and gl:copyTexSubImage3D/9 commands. Mode accepts one of twelve or more predefined values. In a fully configured system, ?GL_FRONT, ?GL_LEFT, and ?GL_FRONT_LEFT all name the front left buffer, ?GL_FRONT_RIGHT and ?GL_RIGHT name the front right buffer, and ?GL_BACK_LEFT and ?GL_BACK name the back left buffer. Further more, the constants ?GL_COLOR_ATTACHMENT``i may be used to indicate the ith color attachment where i ranges from zero to the value of ?GL_MAX_COLOR_ATTACHMENTS minus one.

External documentation.

readPixels(X, Y, Width, Height, Format, Type, Pixels)

-spec readPixels(X, Y, Width, Height, Format, Type, Pixels) -> ok
                    when
                        X :: i(),
                        Y :: i(),
                        Width :: i(),
                        Height :: i(),
                        Format :: enum(),
                        Type :: enum(),
                        Pixels :: mem().

gl:readPixels/7 and glReadnPixels return pixel data from the frame buffer, starting with the pixel whose lower left corner is at location (X, Y), into client memory starting at location Data. Several parameters control the processing of the pixel data before it is placed into client memory. These parameters are set with gl:pixelStore(). This reference page describes the effects on gl:readPixels/7 and glReadnPixels of most, but not all of the parameters specified by these three commands.

External documentation.

rectd(X1, Y1, X2, Y2)

-spec rectd(X1 :: f(), Y1 :: f(), X2 :: f(), Y2 :: f()) -> ok.

Equivalent to rectsv/2.

rectdv(V1, V2)

-spec rectdv(V1 :: {f(), f()}, V2 :: {f(), f()}) -> ok.

Equivalent to rectsv/2.

rectf(X1, Y1, X2, Y2)

-spec rectf(X1 :: f(), Y1 :: f(), X2 :: f(), Y2 :: f()) -> ok.

Equivalent to rectsv/2.

rectfv(V1, V2)

-spec rectfv(V1 :: {f(), f()}, V2 :: {f(), f()}) -> ok.

Equivalent to rectsv/2.

recti(X1, Y1, X2, Y2)

-spec recti(X1 :: i(), Y1 :: i(), X2 :: i(), Y2 :: i()) -> ok.

Equivalent to rectsv/2.

rectiv(V1, V2)

-spec rectiv(V1 :: {i(), i()}, V2 :: {i(), i()}) -> ok.

Equivalent to rectsv/2.

rects(X1, Y1, X2, Y2)

-spec rects(X1 :: i(), Y1 :: i(), X2 :: i(), Y2 :: i()) -> ok.

Equivalent to rectsv/2.

rectsv(V1, V2)

-spec rectsv(V1 :: {i(), i()}, V2 :: {i(), i()}) -> ok.

gl:rect() supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of (x y) coordinates or as two pointers to arrays, each containing an (x y) pair. The resulting rectangle is defined in the z=0 plane.

External documentation.

releaseShaderCompiler()

-spec releaseShaderCompiler() -> ok.

gl:releaseShaderCompiler/0 provides a hint to the implementation that it may free internal resources associated with its shader compiler. gl:compileShader/1 may subsequently be called and the implementation may at that time reallocate resources previously freed by the call to gl:releaseShaderCompiler/0.

External documentation.

renderbufferStorage(Target, Internalformat, Width, Height)

-spec renderbufferStorage(Target :: enum(), Internalformat :: enum(), Width :: i(), Height :: i()) -> ok.

gl:renderbufferStorage/4 is equivalent to calling gl:renderbufferStorageMultisample/5 with the Samples set to zero, and glNamedRenderbufferStorage is equivalent to calling glNamedRenderbufferStorageMultisample with the samples set to zero.

External documentation.

renderbufferStorageMultisample(Target, Samples, Internalformat, Width, Height)

-spec renderbufferStorageMultisample(Target :: enum(),
                                     Samples :: i(),
                                     Internalformat :: enum(),
                                     Width :: i(),
                                     Height :: i()) ->
                                        ok.

gl:renderbufferStorageMultisample/5 and glNamedRenderbufferStorageMultisample establish the data storage, format, dimensions and number of samples of a renderbuffer object's image.

External documentation.

renderMode(Mode)

-spec renderMode(Mode :: enum()) -> i().

gl:renderMode/1 sets the rasterization mode. It takes one argument, Mode, which can assume one of three predefined values:

External documentation.

resetHistogram(Target)

-spec resetHistogram(Target :: enum()) -> ok.

gl:resetHistogram/1 resets all the elements of the current histogram table to zero.

External documentation.

resetMinmax(Target)

-spec resetMinmax(Target :: enum()) -> ok.

gl:resetMinmax/1 resets the elements of the current minmax table to their initial values: the ``maximum'' element receives the minimum possible component values, and the ``minimum'' element receives the maximum possible component values.

External documentation.

resumeTransformFeedback()

-spec resumeTransformFeedback() -> ok.

gl:resumeTransformFeedback/0 resumes transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.

External documentation.

rotated(Angle, X, Y, Z)

-spec rotated(Angle :: f(), X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to rotatef/4.

rotatef(Angle, X, Y, Z)

-spec rotatef(Angle :: f(), X :: f(), Y :: f(), Z :: f()) -> ok.

gl:rotate() produces a rotation of Angle degrees around the vector (x y z). The current matrix (see gl:matrixMode/1) is multiplied by a rotation matrix with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix as its argument:

External documentation.

sampleCoverage(Value, Invert)

-spec sampleCoverage(Value :: clamp(), Invert :: 0 | 1) -> ok.

Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. Multisampling transparently antialiases points, lines, polygons, and images if it is enabled.

External documentation.

sampleMaski(MaskNumber, Mask)

-spec sampleMaski(MaskNumber :: i(), Mask :: i()) -> ok.

gl:sampleMaski/2 sets one 32-bit sub-word of the multi-word sample mask, ?GL_SAMPLE_MASK_VALUE.

External documentation.

samplerParameterf(Sampler, Pname, Param)

-spec samplerParameterf(Sampler :: i(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to samplerParameteriv/3.

samplerParameterfv(Sampler, Pname, Param)

-spec samplerParameterfv(Sampler :: i(), Pname :: enum(), Param :: [f()]) -> ok.

Equivalent to samplerParameteriv/3.

samplerParameterIiv(Sampler, Pname, Param)

-spec samplerParameterIiv(Sampler :: i(), Pname :: enum(), Param :: [i()]) -> ok.

Equivalent to samplerParameteriv/3.

samplerParameterIuiv(Sampler, Pname, Param)

-spec samplerParameterIuiv(Sampler :: i(), Pname :: enum(), Param :: [i()]) -> ok.

Equivalent to samplerParameteriv/3.

samplerParameteri(Sampler, Pname, Param)

-spec samplerParameteri(Sampler :: i(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to samplerParameteriv/3.

samplerParameteriv(Sampler, Pname, Param)

-spec samplerParameteriv(Sampler :: i(), Pname :: enum(), Param :: [i()]) -> ok.

gl:samplerParameter() assigns the value or values in Params to the sampler parameter specified as Pname. Sampler specifies the sampler object to be modified, and must be the name of a sampler object previously returned from a call to gl:genSamplers/1. The following symbols are accepted in Pname:

External documentation.

scaled(X, Y, Z)

-spec scaled(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to scalef/3.

scalef(X, Y, Z)

-spec scalef(X :: f(), Y :: f(), Z :: f()) -> ok.

gl:scale() produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes.

External documentation.

scissor(X, Y, Width, Height)

-spec scissor(X :: i(), Y :: i(), Width :: i(), Height :: i()) -> ok.

gl:scissor/4 defines a rectangle, called the scissor box, in window coordinates. The first two arguments, X and Y, specify the lower left corner of the box. Width and Height specify the width and height of the box.

External documentation.

scissorArrayv(First, V)

-spec scissorArrayv(First :: i(), V :: [{i(), i(), i(), i()}]) -> ok.

gl:scissorArrayv/2 defines rectangles, called scissor boxes, in window coordinates for each viewport. First specifies the index of the first scissor box to modify and Count specifies the number of scissor boxes to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. V specifies the address of an array containing integers specifying the lower left corner of the scissor boxes, and the width and height of the scissor boxes, in that order.

External documentation.

scissorIndexed(Index, Left, Bottom, Width, Height)

-spec scissorIndexed(Index :: i(), Left :: i(), Bottom :: i(), Width :: i(), Height :: i()) -> ok.

Equivalent to scissorIndexedv/2.

scissorIndexedv(Index, V)

-spec scissorIndexedv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

gl:scissorIndexed/5 defines the scissor box for a specified viewport. Index specifies the index of scissor box to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:scissorIndexed/5, Left, Bottom, Width and Height specify the left, bottom, width and height of the scissor box, in pixels, respectively. For gl:scissorIndexedv/2, V specifies the address of an array containing integers specifying the lower left corner of the scissor box, and the width and height of the scissor box, in that order.

External documentation.

secondaryColor3b(Red, Green, Blue)

-spec secondaryColor3b(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3bv/1

-spec secondaryColor3bv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3d(Red, Green, Blue)

-spec secondaryColor3d(Red :: f(), Green :: f(), Blue :: f()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3dv/1

-spec secondaryColor3dv({Red :: f(), Green :: f(), Blue :: f()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3f(Red, Green, Blue)

-spec secondaryColor3f(Red :: f(), Green :: f(), Blue :: f()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3fv/1

-spec secondaryColor3fv({Red :: f(), Green :: f(), Blue :: f()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3i(Red, Green, Blue)

-spec secondaryColor3i(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3iv/1

-spec secondaryColor3iv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3s(Red, Green, Blue)

-spec secondaryColor3s(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3sv/1

-spec secondaryColor3sv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3ub(Red, Green, Blue)

-spec secondaryColor3ub(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3ubv/1

-spec secondaryColor3ubv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3ui(Red, Green, Blue)

-spec secondaryColor3ui(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3uiv/1

-spec secondaryColor3uiv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3us(Red, Green, Blue)

-spec secondaryColor3us(Red :: i(), Green :: i(), Blue :: i()) -> ok.

Equivalent to secondaryColor3usv/1.

secondaryColor3usv/1

-spec secondaryColor3usv({Red :: i(), Green :: i(), Blue :: i()}) -> ok.

The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA color (where alpha is always set to 0.0) that is associated with every vertex.

External documentation.

secondaryColorPointer(Size, Type, Stride, Pointer)

-spec secondaryColorPointer(Size :: i(), Type :: enum(), Stride :: i(), Pointer :: offset() | mem()) ->
                               ok.

gl:secondaryColorPointer/4 specifies the location and data format of an array of color components to use when rendering. Size specifies the number of components per color, and must be 3. Type specifies the data type of each color component, and Stride specifies the byte stride from one color to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

External documentation.

selectBuffer(Size, Buffer)

-spec selectBuffer(Size :: i(), Buffer :: mem()) -> ok.

gl:selectBuffer/2 has two arguments: Buffer is a pointer to an array of unsigned integers, and Size indicates the size of the array. Buffer returns values from the name stack (see gl:initNames/0, gl:loadName/1, gl:pushName/1) when the rendering mode is ?GL_SELECT (see gl:renderMode/1). gl:selectBuffer/2 must be issued before selection mode is enabled, and it must not be issued while the rendering mode is ?GL_SELECT.

External documentation.

separableFilter2D(Target, Internalformat, Width, Height, Format, Type, Row, Column)

-spec separableFilter2D(Target, Internalformat, Width, Height, Format, Type, Row, Column) -> ok
                           when
                               Target :: enum(),
                               Internalformat :: enum(),
                               Width :: i(),
                               Height :: i(),
                               Format :: enum(),
                               Type :: enum(),
                               Row :: offset() | mem(),
                               Column :: offset() | mem().

gl:separableFilter2D/8 builds a two-dimensional separable convolution filter kernel from two arrays of pixels.

External documentation.

shadeModel(Mode)

-spec shadeModel(Mode :: enum()) -> ok.

GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting if lighting is enabled, or it is the current color at the time the vertex was specified if lighting is disabled.

External documentation.

shaderBinary(Shaders, Binaryformat, Binary)

-spec shaderBinary(Shaders :: [i()], Binaryformat :: enum(), Binary :: binary()) -> ok.

gl:shaderBinary/3 loads pre-compiled shader binary code into the Count shader objects whose handles are given in Shaders. Binary points to Length bytes of binary shader code stored in client memory. BinaryFormat specifies the format of the pre-compiled code.

External documentation.

shaderSource(Shader, String)

-spec shaderSource(Shader :: i(), String :: [unicode:chardata()]) -> ok.

gl:shaderSource/2 sets the source code in Shader to the source code in the array of strings specified by String. Any source code previously stored in the shader object is completely replaced. The number of strings in the array is specified by Count. If Length is ?NULL, each string is assumed to be null terminated. If Length is a value other than ?NULL, it points to an array containing a string length for each of the corresponding elements of String. Each element in the Length array may contain the length of the corresponding string (the null character is not counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or parsed at this time; they are simply copied into the specified shader object.

External documentation.

shaderStorageBlockBinding(Program, StorageBlockIndex, StorageBlockBinding)

-spec shaderStorageBlockBinding(Program :: i(), StorageBlockIndex :: i(), StorageBlockBinding :: i()) ->
                                   ok.

gl:shaderStorageBlockBinding/3, changes the active shader storage block with an assigned index of StorageBlockIndex in program object Program. StorageBlockIndex must be an active shader storage block index in Program. StorageBlockBinding must be less than the value of ?GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS. If successful, gl:shaderStorageBlockBinding/3 specifies that Program will use the data store of the buffer object bound to the binding point StorageBlockBinding to read and write the values of the buffer variables in the shader storage block identified by StorageBlockIndex.

External documentation.

stencilFunc(Func, Ref, Mask)

-spec stencilFunc(Func :: enum(), Ref :: i(), Mask :: i()) -> ok.

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. Stencil planes are first drawn into using GL drawing primitives, then geometry and images are rendered using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

External documentation.

stencilFuncSeparate(Face, Func, Ref, Mask)

-spec stencilFuncSeparate(Face :: enum(), Func :: enum(), Ref :: i(), Mask :: i()) -> ok.

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

External documentation.

stencilMask(Mask)

-spec stencilMask(Mask :: i()) -> ok.

gl:stencilMask/1 controls the writing of individual bits in the stencil planes. The least significant n bits of Mask, where n is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing.

External documentation.

stencilMaskSeparate(Face, Mask)

-spec stencilMaskSeparate(Face :: enum(), Mask :: i()) -> ok.

gl:stencilMaskSeparate/2 controls the writing of individual bits in the stencil planes. The least significant n bits of Mask, where n is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing.

External documentation.

stencilOp(Fail, Zfail, Zpass)

-spec stencilOp(Fail :: enum(), Zfail :: enum(), Zpass :: enum()) -> ok.

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

External documentation.

stencilOpSeparate(Face, Sfail, Dpfail, Dppass)

-spec stencilOpSeparate(Face :: enum(), Sfail :: enum(), Dpfail :: enum(), Dppass :: enum()) -> ok.

Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering.

External documentation.

texBuffer(Target, Internalformat, Buffer)

-spec texBuffer(Target :: enum(), Internalformat :: enum(), Buffer :: i()) -> ok.

Equivalent to textureBuffer/3.

texBufferRange(Target, Internalformat, Buffer, Offset, Size)

-spec texBufferRange(Target :: enum(),
                     Internalformat :: enum(),
                     Buffer :: i(),
                     Offset :: i(),
                     Size :: i()) ->
                        ok.

Equivalent to textureBufferRange/5.

texCoord1d(S)

-spec texCoord1d(S :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord1dv/1

-spec texCoord1dv({S :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord1f(S)

-spec texCoord1f(S :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord1fv/1

-spec texCoord1fv({S :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord1i(S)

-spec texCoord1i(S :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord1iv/1

-spec texCoord1iv({S :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord1s(S)

-spec texCoord1s(S :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord1sv/1

-spec texCoord1sv({S :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord2d(S, T)

-spec texCoord2d(S :: f(), T :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord2dv/1

-spec texCoord2dv({S :: f(), T :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord2f(S, T)

-spec texCoord2f(S :: f(), T :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord2fv/1

-spec texCoord2fv({S :: f(), T :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord2i(S, T)

-spec texCoord2i(S :: i(), T :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord2iv/1

-spec texCoord2iv({S :: i(), T :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord2s(S, T)

-spec texCoord2s(S :: i(), T :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord2sv/1

-spec texCoord2sv({S :: i(), T :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord3d(S, T, R)

-spec texCoord3d(S :: f(), T :: f(), R :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord3dv/1

-spec texCoord3dv({S :: f(), T :: f(), R :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord3f(S, T, R)

-spec texCoord3f(S :: f(), T :: f(), R :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord3fv/1

-spec texCoord3fv({S :: f(), T :: f(), R :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord3i(S, T, R)

-spec texCoord3i(S :: i(), T :: i(), R :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord3iv/1

-spec texCoord3iv({S :: i(), T :: i(), R :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord3s(S, T, R)

-spec texCoord3s(S :: i(), T :: i(), R :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord3sv/1

-spec texCoord3sv({S :: i(), T :: i(), R :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord4d(S, T, R, Q)

-spec texCoord4d(S :: f(), T :: f(), R :: f(), Q :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord4dv/1

-spec texCoord4dv({S :: f(), T :: f(), R :: f(), Q :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord4f(S, T, R, Q)

-spec texCoord4f(S :: f(), T :: f(), R :: f(), Q :: f()) -> ok.

Equivalent to texCoord4sv/1.

texCoord4fv/1

-spec texCoord4fv({S :: f(), T :: f(), R :: f(), Q :: f()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord4i(S, T, R, Q)

-spec texCoord4i(S :: i(), T :: i(), R :: i(), Q :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord4iv/1

-spec texCoord4iv({S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.

Equivalent to texCoord4sv/1.

texCoord4s(S, T, R, Q)

-spec texCoord4s(S :: i(), T :: i(), R :: i(), Q :: i()) -> ok.

Equivalent to texCoord4sv/1.

texCoord4sv/1

-spec texCoord4sv({S :: i(), T :: i(), R :: i(), Q :: i()}) -> ok.

gl:texCoord() specifies texture coordinates in one, two, three, or four dimensions. gl:texCoord1() sets the current texture coordinates to (s 0 0 1); a call to gl:texCoord2() sets them to (s t 0 1). Similarly, gl:texCoord3() specifies the texture coordinates as (s t r 1), and gl:texCoord4() defines all four components explicitly as (s t r q).

External documentation.

texCoordPointer(Size, Type, Stride, Ptr)

-spec texCoordPointer(Size :: i(), Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:texCoordPointer/4 specifies the location and data format of an array of texture coordinates to use when rendering. Size specifies the number of coordinates per texture coordinate set, and must be 1, 2, 3, or 4. Type specifies the data type of each texture coordinate, and Stride specifies the byte stride from one texture coordinate set to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

External documentation.

texEnvf(Target, Pname, Param)

-spec texEnvf(Target :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to texEnviv/3.

texEnvfv(Target, Pname, Params)

-spec texEnvfv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texEnviv/3.

texEnvi(Target, Pname, Param)

-spec texEnvi(Target :: enum(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to texEnviv/3.

texEnviv(Target, Pname, Params)

-spec texEnviv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

A texture environment specifies how texture values are interpreted when a fragment is textured. When Target is ?GL_TEXTURE_FILTER_CONTROL, Pname must be ?GL_TEXTURE_LOD_BIAS. When Target is ?GL_TEXTURE_ENV, Pname can be ?GL_TEXTURE_ENV_MODE, ?GL_TEXTURE_ENV_COLOR, ?GL_COMBINE_RGB, ?GL_COMBINE_ALPHA, ?GL_RGB_SCALE, ?GL_ALPHA_SCALE, ?GL_SRC0_RGB, ?GL_SRC1_RGB, ?GL_SRC2_RGB, ?GL_SRC0_ALPHA, ?GL_SRC1_ALPHA, or ?GL_SRC2_ALPHA.

External documentation.

texGend(Coord, Pname, Param)

-spec texGend(Coord :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to texGeniv/3.

texGendv(Coord, Pname, Params)

-spec texGendv(Coord :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texGeniv/3.

texGenf(Coord, Pname, Param)

-spec texGenf(Coord :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to texGeniv/3.

texGenfv(Coord, Pname, Params)

-spec texGenfv(Coord :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texGeniv/3.

texGeni(Coord, Pname, Param)

-spec texGeni(Coord :: enum(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to texGeniv/3.

texGeniv(Coord, Pname, Params)

-spec texGeniv(Coord :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

gl:texGen() selects a texture-coordinate generation function or supplies coefficients for one of the functions. Coord names one of the (s, t, r, q) texture coordinates; it must be one of the symbols ?GL_S, ?GL_T, ?GL_R, or ?GL_Q. Pname must be one of three symbolic constants: ?GL_TEXTURE_GEN_MODE, ?GL_OBJECT_PLANE, or ?GL_EYE_PLANE. If Pname is ?GL_TEXTURE_GEN_MODE, then Params chooses a mode, one of ?GL_OBJECT_LINEAR, ?GL_EYE_LINEAR, ?GL_SPHERE_MAP, ?GL_NORMAL_MAP, or ?GL_REFLECTION_MAP. If Pname is either ?GL_OBJECT_PLANE or ?GL_EYE_PLANE, Params contains coefficients for the corresponding texture generation function.

External documentation.

texImage1D(Target, Level, InternalFormat, Width, Border, Format, Type, Pixels)

-spec texImage1D(Target, Level, InternalFormat, Width, Border, Format, Type, Pixels) -> ok
                    when
                        Target :: enum(),
                        Level :: i(),
                        InternalFormat :: i(),
                        Width :: i(),
                        Border :: i(),
                        Format :: enum(),
                        Type :: enum(),
                        Pixels :: offset() | mem().

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D.

External documentation.

texImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, Pixels)

-spec texImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, Pixels) -> ok
                    when
                        Target :: enum(),
                        Level :: i(),
                        InternalFormat :: i(),
                        Width :: i(),
                        Height :: i(),
                        Border :: i(),
                        Format :: enum(),
                        Type :: enum(),
                        Pixels :: offset() | mem().

Texturing allows elements of an image array to be read by shaders.

External documentation.

texImage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations)

-spec texImage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations) -> ok
                               when
                                   Target :: enum(),
                                   Samples :: i(),
                                   Internalformat :: enum(),
                                   Width :: i(),
                                   Height :: i(),
                                   Fixedsamplelocations :: 0 | 1.

gl:texImage2DMultisample/6 establishes the data storage, format, dimensions and number of samples of a multisample texture's image.

External documentation.

texImage3D(Target, Level, InternalFormat, Width, Height, Depth, Border, Format, Type, Pixels)

-spec texImage3D(Target, Level, InternalFormat, Width, Height, Depth, Border, Format, Type, Pixels) ->
                    ok
                    when
                        Target :: enum(),
                        Level :: i(),
                        InternalFormat :: i(),
                        Width :: i(),
                        Height :: i(),
                        Depth :: i(),
                        Border :: i(),
                        Format :: enum(),
                        Type :: enum(),
                        Pixels :: offset() | mem().

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable three-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_3D.

External documentation.

texImage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations)

-spec texImage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations) ->
                               ok
                               when
                                   Target :: enum(),
                                   Samples :: i(),
                                   Internalformat :: enum(),
                                   Width :: i(),
                                   Height :: i(),
                                   Depth :: i(),
                                   Fixedsamplelocations :: 0 | 1.

gl:texImage3DMultisample/7 establishes the data storage, format, dimensions and number of samples of a multisample texture's image.

External documentation.

texParameterf(Target, Pname, Param)

-spec texParameterf(Target :: enum(), Pname :: enum(), Param :: f()) -> ok.

Equivalent to texParameteriv/3.

texParameterfv(Target, Pname, Params)

-spec texParameterfv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texParameteriv/3.

texParameterIiv(Target, Pname, Params)

-spec texParameterIiv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texParameteriv/3.

texParameterIuiv(Target, Pname, Params)

-spec texParameterIuiv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

Equivalent to texParameteriv/3.

texParameteri(Target, Pname, Param)

-spec texParameteri(Target :: enum(), Pname :: enum(), Param :: i()) -> ok.

Equivalent to texParameteriv/3.

texParameteriv(Target, Pname, Params)

-spec texParameteriv(Target :: enum(), Pname :: enum(), Params :: tuple()) -> ok.

gl:texParameter() and gl:textureParameter() assign the value or values in Params to the texture parameter specified as Pname. For gl:texParameter(), Target defines the target texture, either ?GL_TEXTURE_1D, ?GL_TEXTURE_1D_ARRAY, ?GL_TEXTURE_2D, ?GL_TEXTURE_2D_ARRAY, ?GL_TEXTURE_2D_MULTISAMPLE, ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY, ?GL_TEXTURE_3D, ?GL_TEXTURE_CUBE_MAP, ?GL_TEXTURE_CUBE_MAP_ARRAY, or ?GL_TEXTURE_RECTANGLE. The following symbols are accepted in Pname:

External documentation.

texStorage1D(Target, Levels, Internalformat, Width)

-spec texStorage1D(Target :: enum(), Levels :: i(), Internalformat :: enum(), Width :: i()) -> ok.

gl:texStorage1D/4 and gl:textureStorage1D() specify the storage requirements for all levels of a one-dimensional texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

External documentation.

texStorage2D(Target, Levels, Internalformat, Width, Height)

-spec texStorage2D(Target :: enum(),
                   Levels :: i(),
                   Internalformat :: enum(),
                   Width :: i(),
                   Height :: i()) ->
                      ok.

gl:texStorage2D/5 and gl:textureStorage2D() specify the storage requirements for all levels of a two-dimensional texture or one-dimensional texture array simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

External documentation.

texStorage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations)

-spec texStorage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations) ->
                                 ok
                                 when
                                     Target :: enum(),
                                     Samples :: i(),
                                     Internalformat :: enum(),
                                     Width :: i(),
                                     Height :: i(),
                                     Fixedsamplelocations :: 0 | 1.

gl:texStorage2DMultisample/6 and gl:textureStorage2DMultisample() specify the storage requirements for a two-dimensional multisample texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

External documentation.

texStorage3D(Target, Levels, Internalformat, Width, Height, Depth)

-spec texStorage3D(Target, Levels, Internalformat, Width, Height, Depth) -> ok
                      when
                          Target :: enum(),
                          Levels :: i(),
                          Internalformat :: enum(),
                          Width :: i(),
                          Height :: i(),
                          Depth :: i().

gl:texStorage3D/6 and gl:textureStorage3D() specify the storage requirements for all levels of a three-dimensional, two-dimensional array or cube-map array texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

External documentation.

texStorage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations)

-spec texStorage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth,
                              Fixedsamplelocations) ->
                                 ok
                                 when
                                     Target :: enum(),
                                     Samples :: i(),
                                     Internalformat :: enum(),
                                     Width :: i(),
                                     Height :: i(),
                                     Depth :: i(),
                                     Fixedsamplelocations :: 0 | 1.

gl:texStorage3DMultisample/7 and gl:textureStorage3DMultisample() specify the storage requirements for a two-dimensional multisample array texture. Once a texture is specified with this command, its format and dimensions become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.

External documentation.

texSubImage1D(Target, Level, Xoffset, Width, Format, Type, Pixels)

-spec texSubImage1D(Target, Level, Xoffset, Width, Format, Type, Pixels) -> ok
                       when
                           Target :: enum(),
                           Level :: i(),
                           Xoffset :: i(),
                           Width :: i(),
                           Format :: enum(),
                           Type :: enum(),
                           Pixels :: offset() | mem().

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable or disable one-dimensional texturing, call gl:enable/1 and gl:disable/1 with argument ?GL_TEXTURE_1D.

External documentation.

texSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, Type, Pixels)

-spec texSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, Type, Pixels) -> ok
                       when
                           Target :: enum(),
                           Level :: i(),
                           Xoffset :: i(),
                           Yoffset :: i(),
                           Width :: i(),
                           Height :: i(),
                           Format :: enum(),
                           Type :: enum(),
                           Pixels :: offset() | mem().

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled.

External documentation.

texSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Pixels)

-spec texSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type,
                    Pixels) ->
                       ok
                       when
                           Target :: enum(),
                           Level :: i(),
                           Xoffset :: i(),
                           Yoffset :: i(),
                           Zoffset :: i(),
                           Width :: i(),
                           Height :: i(),
                           Depth :: i(),
                           Format :: enum(),
                           Type :: enum(),
                           Pixels :: offset() | mem().

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled.

External documentation.

textureBarrier()

-spec textureBarrier() -> ok.

The values of rendered fragments are undefined when a shader stage fetches texels and the same texels are written via fragment shader outputs, even if the reads and writes are not in the same drawing command. To safely read the result of a written texel via a texel fetch in a subsequent drawing command, call gl:textureBarrier/0 between the two drawing commands to guarantee that writes have completed and caches have been invalidated before subsequent drawing commands are executed.

External documentation.

textureBuffer(Texture, Internalformat, Buffer)

-spec textureBuffer(Texture :: i(), Internalformat :: enum(), Buffer :: i()) -> ok.

gl:texBuffer/3 and gl:textureBuffer/3 attaches the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture.

External documentation.

textureBufferRange(Texture, Internalformat, Buffer, Offset, Size)

-spec textureBufferRange(Texture :: i(),
                         Internalformat :: enum(),
                         Buffer :: i(),
                         Offset :: i(),
                         Size :: i()) ->
                            ok.

gl:texBufferRange/5 and gl:textureBufferRange/5 attach a range of the data store of a specified buffer object to a specified texture object, and specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture.

External documentation.

textureView(Texture, Target, Origtexture, Internalformat, Minlevel, Numlevels, Minlayer, Numlayers)

-spec textureView(Texture, Target, Origtexture, Internalformat, Minlevel, Numlevels, Minlayer,
                  Numlayers) ->
                     ok
                     when
                         Texture :: i(),
                         Target :: enum(),
                         Origtexture :: i(),
                         Internalformat :: enum(),
                         Minlevel :: i(),
                         Numlevels :: i(),
                         Minlayer :: i(),
                         Numlayers :: i().

gl:textureView/8 initializes a texture object as an alias, or view of another texture object, sharing some or all of the parent texture's data store with the initialized texture. Texture specifies a name previously reserved by a successful call to gl:genTextures/1 but that has not yet been bound or given a target. Target specifies the target for the newly initialized texture and must be compatible with the target of the parent texture, given in Origtexture as specified in the following table:

External documentation.

transformFeedbackBufferBase(Xfb, Index, Buffer)

-spec transformFeedbackBufferBase(Xfb :: i(), Index :: i(), Buffer :: i()) -> ok.

gl:transformFeedbackBufferBase/3 binds the buffer object Buffer to the binding point at index Index of the transform feedback object Xfb.

External documentation.

transformFeedbackBufferRange(Xfb, Index, Buffer, Offset, Size)

-spec transformFeedbackBufferRange(Xfb :: i(), Index :: i(), Buffer :: i(), Offset :: i(), Size :: i()) ->
                                      ok.

gl:transformFeedbackBufferRange/5 binds a range of the buffer object Buffer represented by Offset and Size to the binding point at index Index of the transform feedback object Xfb.

External documentation.

transformFeedbackVaryings(Program, Varyings, BufferMode)

-spec transformFeedbackVaryings(Program :: i(), Varyings :: [unicode:chardata()], BufferMode :: enum()) ->
                                   ok.

The names of the vertex or geometry shader outputs to be recorded in transform feedback mode are specified using gl:transformFeedbackVaryings/3. When a geometry shader is active, transform feedback records the values of selected geometry shader output variables from the emitted vertices. Otherwise, the values of the selected vertex shader outputs are recorded.

External documentation.

translated(X, Y, Z)

-spec translated(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to translatef/3.

translatef(X, Y, Z)

-spec translatef(X :: f(), Y :: f(), Z :: f()) -> ok.

gl:translate() produces a translation by (x y z). The current matrix (see gl:matrixMode/1) is multiplied by this translation matrix, with the product replacing the current matrix, as if gl:multMatrix() were called with the following matrix for its argument:

External documentation.

uniform1d(Location, X)

-spec uniform1d(Location :: i(), X :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1dv(Location, Value)

-spec uniform1dv(Location :: i(), Value :: [f()]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1f(Location, V0)

-spec uniform1f(Location :: i(), V0 :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1fv(Location, Value)

-spec uniform1fv(Location :: i(), Value :: [f()]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1i(Location, V0)

-spec uniform1i(Location :: i(), V0 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1iv(Location, Value)

-spec uniform1iv(Location :: i(), Value :: [i()]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1ui(Location, V0)

-spec uniform1ui(Location :: i(), V0 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform1uiv(Location, Value)

-spec uniform1uiv(Location :: i(), Value :: [i()]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2d(Location, X, Y)

-spec uniform2d(Location :: i(), X :: f(), Y :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2dv(Location, Value)

-spec uniform2dv(Location :: i(), Value :: [{f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2f(Location, V0, V1)

-spec uniform2f(Location :: i(), V0 :: f(), V1 :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2fv(Location, Value)

-spec uniform2fv(Location :: i(), Value :: [{f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2i(Location, V0, V1)

-spec uniform2i(Location :: i(), V0 :: i(), V1 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2iv(Location, Value)

-spec uniform2iv(Location :: i(), Value :: [{i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2ui(Location, V0, V1)

-spec uniform2ui(Location :: i(), V0 :: i(), V1 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform2uiv(Location, Value)

-spec uniform2uiv(Location :: i(), Value :: [{i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3d(Location, X, Y, Z)

-spec uniform3d(Location :: i(), X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3dv(Location, Value)

-spec uniform3dv(Location :: i(), Value :: [{f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3f(Location, V0, V1, V2)

-spec uniform3f(Location :: i(), V0 :: f(), V1 :: f(), V2 :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3fv(Location, Value)

-spec uniform3fv(Location :: i(), Value :: [{f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3i(Location, V0, V1, V2)

-spec uniform3i(Location :: i(), V0 :: i(), V1 :: i(), V2 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3iv(Location, Value)

-spec uniform3iv(Location :: i(), Value :: [{i(), i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3ui(Location, V0, V1, V2)

-spec uniform3ui(Location :: i(), V0 :: i(), V1 :: i(), V2 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform3uiv(Location, Value)

-spec uniform3uiv(Location :: i(), Value :: [{i(), i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4d(Location, X, Y, Z, W)

-spec uniform4d(Location :: i(), X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4dv(Location, Value)

-spec uniform4dv(Location :: i(), Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4f(Location, V0, V1, V2, V3)

-spec uniform4f(Location :: i(), V0 :: f(), V1 :: f(), V2 :: f(), V3 :: f()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4fv(Location, Value)

-spec uniform4fv(Location :: i(), Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4i(Location, V0, V1, V2, V3)

-spec uniform4i(Location :: i(), V0 :: i(), V1 :: i(), V2 :: i(), V3 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4iv(Location, Value)

-spec uniform4iv(Location :: i(), Value :: [{i(), i(), i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4ui(Location, V0, V1, V2, V3)

-spec uniform4ui(Location :: i(), V0 :: i(), V1 :: i(), V2 :: i(), V3 :: i()) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniform4uiv(Location, Value)

-spec uniform4uiv(Location :: i(), Value :: [{i(), i(), i(), i()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniformBlockBinding(Program, UniformBlockIndex, UniformBlockBinding)

-spec uniformBlockBinding(Program :: i(), UniformBlockIndex :: i(), UniformBlockBinding :: i()) -> ok.

Binding points for active uniform blocks are assigned using gl:uniformBlockBinding/3. Each of a program's active uniform blocks has a corresponding uniform buffer binding point. Program is the name of a program object for which the command gl:linkProgram/1 has been issued in the past.

External documentation.

uniformMatrix2dv(Location, Transpose, Value)

-spec uniformMatrix2dv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2fv(Location, Transpose, Value)

-spec uniformMatrix2fv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f()}]) -> ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x3dv(Location, Transpose, Value)

-spec uniformMatrix2x3dv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x3fv(Location, Transpose, Value)

-spec uniformMatrix2x3fv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x4dv(Location, Transpose, Value)

-spec uniformMatrix2x4dv(Location :: i(),
                         Transpose :: 0 | 1,
                         Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix2x4fv(Location, Transpose, Value)

-spec uniformMatrix2x4fv(Location :: i(),
                         Transpose :: 0 | 1,
                         Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3dv(Location, Transpose, Value)

-spec uniformMatrix3dv(Location :: i(),
                       Transpose :: 0 | 1,
                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                          ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3fv(Location, Transpose, Value)

-spec uniformMatrix3fv(Location :: i(),
                       Transpose :: 0 | 1,
                       Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                          ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x2dv(Location, Transpose, Value)

-spec uniformMatrix3x2dv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x2fv(Location, Transpose, Value)

-spec uniformMatrix3x2fv(Location :: i(), Transpose :: 0 | 1, Value :: [{f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x4dv(Location, Transpose, Value)

-spec uniformMatrix3x4dv(Location, Transpose, Value) -> ok
                            when
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix3x4fv(Location, Transpose, Value)

-spec uniformMatrix3x4fv(Location, Transpose, Value) -> ok
                            when
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4dv(Location, Transpose, Value)

-spec uniformMatrix4dv(Location, Transpose, Value) -> ok
                          when
                              Location :: i(),
                              Transpose :: 0 | 1,
                              Value ::
                                  [{f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f()}].

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4fv(Location, Transpose, Value)

-spec uniformMatrix4fv(Location, Transpose, Value) -> ok
                          when
                              Location :: i(),
                              Transpose :: 0 | 1,
                              Value ::
                                  [{f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f(),
                                    f()}].

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x2dv(Location, Transpose, Value)

-spec uniformMatrix4x2dv(Location :: i(),
                         Transpose :: 0 | 1,
                         Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x2fv(Location, Transpose, Value)

-spec uniformMatrix4x2fv(Location :: i(),
                         Transpose :: 0 | 1,
                         Value :: [{f(), f(), f(), f(), f(), f(), f(), f()}]) ->
                            ok.

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x3dv(Location, Transpose, Value)

-spec uniformMatrix4x3dv(Location, Transpose, Value) -> ok
                            when
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

Equivalent to uniformMatrix4x3fv/3.

uniformMatrix4x3fv(Location, Transpose, Value)

-spec uniformMatrix4x3fv(Location, Transpose, Value) -> ok
                            when
                                Location :: i(),
                                Transpose :: 0 | 1,
                                Value :: [{f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}].

gl:uniform() modifies the value of a uniform variable or a uniform variable array. The location of the uniform variable to be modified is specified by Location, which should be a value returned by gl:getUniformLocation/2. gl:uniform() operates on the program object that was made part of current state by calling gl:useProgram/1.

External documentation.

uniformSubroutinesuiv(Shadertype, Indices)

-spec uniformSubroutinesuiv(Shadertype :: enum(), Indices :: [i()]) -> ok.

gl:uniformSubroutines() loads all active subroutine uniforms for shader stage Shadertype of the current program with subroutine indices from Indices, storing Indices[i] into the uniform at location I. Count must be equal to the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the program currently in use at shader stage Shadertype. Furthermore, all values in Indices must be less than the value of ?GL_ACTIVE_SUBROUTINES for the shader stage.

External documentation.

useProgram(Program)

-spec useProgram(Program :: i()) -> ok.

gl:useProgram/1 installs the program object specified by Program as part of current rendering state. One or more executables are created in a program object by successfully attaching shader objects to it with gl:attachShader/2, successfully compiling the shader objects with gl:compileShader/1, and successfully linking the program object with gl:linkProgram/1.

External documentation.

useProgramStages(Pipeline, Stages, Program)

-spec useProgramStages(Pipeline :: i(), Stages :: i(), Program :: i()) -> ok.

gl:useProgramStages/3 binds executables from a program object associated with a specified set of shader stages to the program pipeline object given by Pipeline. Pipeline specifies the program pipeline object to which to bind the executables. Stages contains a logical combination of bits indicating the shader stages to use within Program with the program pipeline object Pipeline. Stages must be a logical combination of ?GL_VERTEX_SHADER_BIT, ?GL_TESS_CONTROL_SHADER_BIT, ?GL_TESS_EVALUATION_SHADER_BIT, ?GL_GEOMETRY_SHADER_BIT, ?GL_FRAGMENT_SHADER_BIT and ?GL_COMPUTE_SHADER_BIT. Additionally, the special value ?GL_ALL_SHADER_BITS may be specified to indicate that all executables contained in Program should be installed in Pipeline.

External documentation.

validateProgram(Program)

-spec validateProgram(Program :: i()) -> ok.

gl:validateProgram/1 checks to see whether the executables contained in Program can execute given the current OpenGL state. The information generated by the validation process will be stored in Program's information log. The validation information may consist of an empty string, or it may be a string containing information about how the current program object interacts with the rest of current OpenGL state. This provides a way for OpenGL implementers to convey more information about why the current program is inefficient, suboptimal, failing to execute, and so on.

External documentation.

validateProgramPipeline(Pipeline)

-spec validateProgramPipeline(Pipeline :: i()) -> ok.

gl:validateProgramPipeline/1 instructs the implementation to validate the shader executables contained in Pipeline against the current GL state. The implementation may use this as an opportunity to perform any internal shader modifications that may be required to ensure correct operation of the installed shaders given the current GL state.

External documentation.

vertex2d(X, Y)

-spec vertex2d(X :: f(), Y :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex2dv/1

-spec vertex2dv({X :: f(), Y :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex2f(X, Y)

-spec vertex2f(X :: f(), Y :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex2fv/1

-spec vertex2fv({X :: f(), Y :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex2i(X, Y)

-spec vertex2i(X :: i(), Y :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex2iv/1

-spec vertex2iv({X :: i(), Y :: i()}) -> ok.

Equivalent to vertex4sv/1.

vertex2s(X, Y)

-spec vertex2s(X :: i(), Y :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex2sv/1

-spec vertex2sv({X :: i(), Y :: i()}) -> ok.

Equivalent to vertex4sv/1.

vertex3d(X, Y, Z)

-spec vertex3d(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex3dv/1

-spec vertex3dv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex3f(X, Y, Z)

-spec vertex3f(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex3fv/1

-spec vertex3fv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex3i(X, Y, Z)

-spec vertex3i(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex3iv/1

-spec vertex3iv({X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to vertex4sv/1.

vertex3s(X, Y, Z)

-spec vertex3s(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex3sv/1

-spec vertex3sv({X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to vertex4sv/1.

vertex4d(X, Y, Z, W)

-spec vertex4d(X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex4dv/1

-spec vertex4dv({X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex4f(X, Y, Z, W)

-spec vertex4f(X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to vertex4sv/1.

vertex4fv/1

-spec vertex4fv({X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to vertex4sv/1.

vertex4i(X, Y, Z, W)

-spec vertex4i(X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex4iv/1

-spec vertex4iv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to vertex4sv/1.

vertex4s(X, Y, Z, W)

-spec vertex4s(X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertex4sv/1.

vertex4sv/1

-spec vertex4sv({X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

gl:vertex() commands are used within gl:'begin'/1/gl:'end'/0 pairs to specify point, line, and polygon vertices. The current color, normal, texture coordinates, and fog coordinate are associated with the vertex when gl:vertex() is called.

External documentation.

vertexArrayAttribBinding(Vaobj, Attribindex, Bindingindex)

-spec vertexArrayAttribBinding(Vaobj :: i(), Attribindex :: i(), Bindingindex :: i()) -> ok.

Equivalent to vertexAttribBinding/2.

vertexArrayAttribFormat(Vaobj, Attribindex, Size, Type, Normalized, Relativeoffset)

-spec vertexArrayAttribFormat(Vaobj, Attribindex, Size, Type, Normalized, Relativeoffset) -> ok
                                 when
                                     Vaobj :: i(),
                                     Attribindex :: i(),
                                     Size :: i(),
                                     Type :: enum(),
                                     Normalized :: 0 | 1,
                                     Relativeoffset :: i().

Equivalent to vertexAttribLPointer/5.

vertexArrayAttribIFormat(Vaobj, Attribindex, Size, Type, Relativeoffset)

-spec vertexArrayAttribIFormat(Vaobj :: i(),
                               Attribindex :: i(),
                               Size :: i(),
                               Type :: enum(),
                               Relativeoffset :: i()) ->
                                  ok.

Equivalent to vertexAttribLPointer/5.

vertexArrayAttribLFormat(Vaobj, Attribindex, Size, Type, Relativeoffset)

-spec vertexArrayAttribLFormat(Vaobj :: i(),
                               Attribindex :: i(),
                               Size :: i(),
                               Type :: enum(),
                               Relativeoffset :: i()) ->
                                  ok.

Equivalent to vertexAttribLPointer/5.

vertexArrayBindingDivisor(Vaobj, Bindingindex, Divisor)

-spec vertexArrayBindingDivisor(Vaobj :: i(), Bindingindex :: i(), Divisor :: i()) -> ok.

Equivalent to vertexBindingDivisor/2.

vertexArrayElementBuffer(Vaobj, Buffer)

-spec vertexArrayElementBuffer(Vaobj :: i(), Buffer :: i()) -> ok.

gl:vertexArrayElementBuffer/2 binds a buffer object with id Buffer to the element array buffer bind point of a vertex array object with id Vaobj. If Buffer is zero, any existing element array buffer binding to Vaobj is removed.

External documentation.

vertexArrayVertexBuffer(Vaobj, Bindingindex, Buffer, Offset, Stride)

-spec vertexArrayVertexBuffer(Vaobj :: i(),
                              Bindingindex :: i(),
                              Buffer :: i(),
                              Offset :: i(),
                              Stride :: i()) ->
                                 ok.

gl:bindVertexBuffer/4 and gl:vertexArrayVertexBuffer/5 bind the buffer named Buffer to the vertex buffer binding point whose index is given by Bindingindex. gl:bindVertexBuffer/4 modifies the binding of the currently bound vertex array object, whereas gl:vertexArrayVertexBuffer/5 allows the caller to specify ID of the vertex array object with an argument named Vaobj, for which the binding should be modified. Offset and Stride specify the offset of the first element within the buffer and the distance between elements within the buffer, respectively, and are both measured in basic machine units. Bindingindex must be less than the value of ?GL_MAX_VERTEX_ATTRIB_BINDINGS. Offset and Stride must be greater than or equal to zero. If Buffer is zero, then any buffer currently bound to the specified binding point is unbound.

External documentation.

vertexArrayVertexBuffers(Vaobj, First, Buffers, Offsets, Strides)

-spec vertexArrayVertexBuffers(Vaobj :: i(),
                               First :: i(),
                               Buffers :: [i()],
                               Offsets :: [i()],
                               Strides :: [i()]) ->
                                  ok.

gl:bindVertexBuffers/4 and gl:vertexArrayVertexBuffers/5 bind storage from an array of existing buffer objects to a specified number of consecutive vertex buffer binding points units in a vertex array object. For gl:bindVertexBuffers/4, the vertex array object is the currently bound vertex array object. For gl:vertexArrayVertexBuffers/5, Vaobj is the name of the vertex array object.

External documentation.

vertexAttrib1d(Index, X)

-spec vertexAttrib1d(Index :: i(), X :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib1dv/2

-spec vertexAttrib1dv(Index :: i(), {X :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib1f(Index, X)

-spec vertexAttrib1f(Index :: i(), X :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib1fv/2

-spec vertexAttrib1fv(Index :: i(), {X :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib1s(Index, X)

-spec vertexAttrib1s(Index :: i(), X :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib1sv/2

-spec vertexAttrib1sv(Index :: i(), {X :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2d(Index, X, Y)

-spec vertexAttrib2d(Index :: i(), X :: f(), Y :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2dv/2

-spec vertexAttrib2dv(Index :: i(), {X :: f(), Y :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2f(Index, X, Y)

-spec vertexAttrib2f(Index :: i(), X :: f(), Y :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2fv/2

-spec vertexAttrib2fv(Index :: i(), {X :: f(), Y :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2s(Index, X, Y)

-spec vertexAttrib2s(Index :: i(), X :: i(), Y :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib2sv/2

-spec vertexAttrib2sv(Index :: i(), {X :: i(), Y :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3d(Index, X, Y, Z)

-spec vertexAttrib3d(Index :: i(), X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3dv/2

-spec vertexAttrib3dv(Index :: i(), {X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3f(Index, X, Y, Z)

-spec vertexAttrib3f(Index :: i(), X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3fv/2

-spec vertexAttrib3fv(Index :: i(), {X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3s(Index, X, Y, Z)

-spec vertexAttrib3s(Index :: i(), X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib3sv/2

-spec vertexAttrib3sv(Index :: i(), {X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4bv(Index, V)

-spec vertexAttrib4bv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4d(Index, X, Y, Z, W)

-spec vertexAttrib4d(Index :: i(), X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4dv/2

-spec vertexAttrib4dv(Index :: i(), {X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4f(Index, X, Y, Z, W)

-spec vertexAttrib4f(Index :: i(), X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4fv/2

-spec vertexAttrib4fv(Index :: i(), {X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4iv(Index, V)

-spec vertexAttrib4iv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nbv(Index, V)

-spec vertexAttrib4Nbv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Niv(Index, V)

-spec vertexAttrib4Niv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nsv(Index, V)

-spec vertexAttrib4Nsv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nub(Index, X, Y, Z, W)

-spec vertexAttrib4Nub(Index :: i(), X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nubv/2

-spec vertexAttrib4Nubv(Index :: i(), {X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nuiv(Index, V)

-spec vertexAttrib4Nuiv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4Nusv(Index, V)

-spec vertexAttrib4Nusv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4s(Index, X, Y, Z, W)

-spec vertexAttrib4s(Index :: i(), X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4sv/2

-spec vertexAttrib4sv(Index :: i(), {X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4ubv(Index, V)

-spec vertexAttrib4ubv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4uiv(Index, V)

-spec vertexAttrib4uiv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttrib4usv(Index, V)

-spec vertexAttrib4usv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribBinding(Attribindex, Bindingindex)

-spec vertexAttribBinding(Attribindex :: i(), Bindingindex :: i()) -> ok.

gl:vertexAttribBinding/2 and gl:vertexArrayAttribBinding/3 establishes an association between the generic vertex attribute of a vertex array object whose index is given by Attribindex, and a vertex buffer binding whose index is given by Bindingindex. For gl:vertexAttribBinding/2, the vertex array object affected is that currently bound. For gl:vertexArrayAttribBinding/3, Vaobj is the name of the vertex array object.

External documentation.

vertexAttribDivisor(Index, Divisor)

-spec vertexAttribDivisor(Index :: i(), Divisor :: i()) -> ok.

gl:vertexAttribDivisor/2 modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw call. If Divisor is zero, the attribute at slot Index advances once per vertex. If Divisor is non-zero, the attribute advances once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if its ?GL_VERTEX_ATTRIB_ARRAY_DIVISOR value is non-zero.

External documentation.

vertexAttribFormat(Attribindex, Size, Type, Normalized, Relativeoffset)

-spec vertexAttribFormat(Attribindex :: i(),
                         Size :: i(),
                         Type :: enum(),
                         Normalized :: 0 | 1,
                         Relativeoffset :: i()) ->
                            ok.

Equivalent to vertexAttribLPointer/5.

vertexAttribI1i(Index, X)

-spec vertexAttribI1i(Index :: i(), X :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI1iv/2

-spec vertexAttribI1iv(Index :: i(), {X :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI1ui(Index, X)

-spec vertexAttribI1ui(Index :: i(), X :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI1uiv/2

-spec vertexAttribI1uiv(Index :: i(), {X :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI2i(Index, X, Y)

-spec vertexAttribI2i(Index :: i(), X :: i(), Y :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI2iv/2

-spec vertexAttribI2iv(Index :: i(), {X :: i(), Y :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI2ui(Index, X, Y)

-spec vertexAttribI2ui(Index :: i(), X :: i(), Y :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI2uiv/2

-spec vertexAttribI2uiv(Index :: i(), {X :: i(), Y :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI3i(Index, X, Y, Z)

-spec vertexAttribI3i(Index :: i(), X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI3iv/2

-spec vertexAttribI3iv(Index :: i(), {X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI3ui(Index, X, Y, Z)

-spec vertexAttribI3ui(Index :: i(), X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI3uiv/2

-spec vertexAttribI3uiv(Index :: i(), {X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4bv(Index, V)

-spec vertexAttribI4bv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4i(Index, X, Y, Z, W)

-spec vertexAttribI4i(Index :: i(), X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4iv/2

-spec vertexAttribI4iv(Index :: i(), {X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4sv(Index, V)

-spec vertexAttribI4sv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4ubv(Index, V)

-spec vertexAttribI4ubv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4ui(Index, X, Y, Z, W)

-spec vertexAttribI4ui(Index :: i(), X :: i(), Y :: i(), Z :: i(), W :: i()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4uiv/2

-spec vertexAttribI4uiv(Index :: i(), {X :: i(), Y :: i(), Z :: i(), W :: i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribI4usv(Index, V)

-spec vertexAttribI4usv(Index :: i(), V :: {i(), i(), i(), i()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribIFormat(Attribindex, Size, Type, Relativeoffset)

-spec vertexAttribIFormat(Attribindex :: i(), Size :: i(), Type :: enum(), Relativeoffset :: i()) -> ok.

Equivalent to vertexAttribLPointer/5.

vertexAttribIPointer(Index, Size, Type, Stride, Pointer)

-spec vertexAttribIPointer(Index :: i(),
                           Size :: i(),
                           Type :: enum(),
                           Stride :: i(),
                           Pointer :: offset() | mem()) ->
                              ok.

Equivalent to vertexAttribLPointer/5.

vertexAttribL1d(Index, X)

-spec vertexAttribL1d(Index :: i(), X :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL1dv/2

-spec vertexAttribL1dv(Index :: i(), {X :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL2d(Index, X, Y)

-spec vertexAttribL2d(Index :: i(), X :: f(), Y :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL2dv/2

-spec vertexAttribL2dv(Index :: i(), {X :: f(), Y :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL3d(Index, X, Y, Z)

-spec vertexAttribL3d(Index :: i(), X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL3dv/2

-spec vertexAttribL3dv(Index :: i(), {X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL4d(Index, X, Y, Z, W)

-spec vertexAttribL4d(Index :: i(), X :: f(), Y :: f(), Z :: f(), W :: f()) -> ok.

Equivalent to vertexAttribL4dv/2.

vertexAttribL4dv/2

-spec vertexAttribL4dv(Index :: i(), {X :: f(), Y :: f(), Z :: f(), W :: f()}) -> ok.

The gl:vertexAttrib() family of entry points allows an application to pass generic vertex attributes in numbered locations.

External documentation.

vertexAttribLFormat(Attribindex, Size, Type, Relativeoffset)

-spec vertexAttribLFormat(Attribindex :: i(), Size :: i(), Type :: enum(), Relativeoffset :: i()) -> ok.

Equivalent to vertexAttribLPointer/5.

vertexAttribLPointer(Index, Size, Type, Stride, Pointer)

-spec vertexAttribLPointer(Index :: i(),
                           Size :: i(),
                           Type :: enum(),
                           Stride :: i(),
                           Pointer :: offset() | mem()) ->
                              ok.

gl:vertexAttribFormat/5, gl:vertexAttribIFormat/4 and gl:vertexAttribLFormat/4, as well as gl:vertexArrayAttribFormat/6, gl:vertexArrayAttribIFormat/5 and gl:vertexArrayAttribLFormat/5 specify the organization of data in vertex arrays. The first three calls operate on the bound vertex array object, whereas the last three ones modify the state of a vertex array object with ID Vaobj. Attribindex specifies the index of the generic vertex attribute array whose data layout is being described, and must be less than the value of ?GL_MAX_VERTEX_ATTRIBS.

External documentation.

vertexAttribPointer(Index, Size, Type, Normalized, Stride, Pointer)

-spec vertexAttribPointer(Index, Size, Type, Normalized, Stride, Pointer) -> ok
                             when
                                 Index :: i(),
                                 Size :: i(),
                                 Type :: enum(),
                                 Normalized :: 0 | 1,
                                 Stride :: i(),
                                 Pointer :: offset() | mem().

gl:vertexAttribPointer/6, gl:vertexAttribIPointer/5 and gl:vertexAttribLPointer/5 specify the location and data format of the array of generic vertex attributes at index Index to use when rendering. Size specifies the number of components per attribute and must be 1, 2, 3, 4, or ?GL_BGRA. Type specifies the data type of each component, and Stride specifies the byte stride from one attribute to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays.

External documentation.

vertexBindingDivisor(Bindingindex, Divisor)

-spec vertexBindingDivisor(Bindingindex :: i(), Divisor :: i()) -> ok.

gl:vertexBindingDivisor/2 and gl:vertexArrayBindingDivisor/3 modify the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw command. If Divisor is zero, the attributes using the buffer bound to Bindingindex advance once per vertex. If Divisor is non-zero, the attributes advance once per Divisor instances of the set(s) of vertices being rendered. An attribute is referred to as instanced if the corresponding Divisor value is non-zero.

External documentation.

vertexPointer(Size, Type, Stride, Ptr)

-spec vertexPointer(Size :: i(), Type :: enum(), Stride :: i(), Ptr :: offset() | mem()) -> ok.

gl:vertexPointer/4 specifies the location and data format of an array of vertex coordinates to use when rendering. Size specifies the number of coordinates per vertex, and must be 2, 3, or 4. Type specifies the data type of each coordinate, and Stride specifies the byte stride from one vertex to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see gl:interleavedArrays/3.)

External documentation.

viewport(X, Y, Width, Height)

-spec viewport(X :: i(), Y :: i(), Width :: i(), Height :: i()) -> ok.

gl:viewport/4 specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:

External documentation.

viewportArrayv(First, V)

-spec viewportArrayv(First :: i(), V :: [{f(), f(), f(), f()}]) -> ok.

gl:viewportArrayv/2 specifies the parameters for multiple viewports simulataneously. First specifies the index of the first viewport to modify and Count specifies the number of viewports to modify. First must be less than the value of ?GL_MAX_VIEWPORTS, and First + Count must be less than or equal to the value of ?GL_MAX_VIEWPORTS. Viewports whose indices lie outside the range [First, First + Count) are not modified. V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:

External documentation.

viewportIndexedf(Index, X, Y, W, H)

-spec viewportIndexedf(Index :: i(), X :: f(), Y :: f(), W :: f(), H :: f()) -> ok.

Equivalent to viewportIndexedfv/2.

viewportIndexedfv(Index, V)

-spec viewportIndexedfv(Index :: i(), V :: {f(), f(), f(), f()}) -> ok.

gl:viewportIndexedf/5 and gl:viewportIndexedfv/2 specify the parameters for a single viewport. Index specifies the index of the viewport to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:viewportIndexedf/5, X, Y, W, and H specify the left, bottom, width and height of the viewport in pixels, respectively. For gl:viewportIndexedfv/2, V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:

External documentation.

waitSync(Sync, Flags, Timeout)

-spec waitSync(Sync :: i(), Flags :: i(), Timeout :: i()) -> ok.

gl:waitSync/3 causes the GL server to block and wait until Sync becomes signaled. Sync is the name of an existing sync object upon which to wait. Flags and Timeout are currently not used and must be set to zero and the special value ?GL_TIMEOUT_IGNORED, respectively

Flags and Timeout are placeholders for anticipated future extensions of sync object capabilities. They must have these reserved values in order that existing code calling gl:waitSync/3 operate properly in the presence of such extensions.

External documentation.

windowPos2d(X, Y)

-spec windowPos2d(X :: f(), Y :: f()) -> ok.

Equivalent to windowPos3sv/1.

windowPos2dv/1

-spec windowPos2dv({X :: f(), Y :: f()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos2f(X, Y)

-spec windowPos2f(X :: f(), Y :: f()) -> ok.

Equivalent to windowPos3sv/1.

windowPos2fv/1

-spec windowPos2fv({X :: f(), Y :: f()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos2i(X, Y)

-spec windowPos2i(X :: i(), Y :: i()) -> ok.

Equivalent to windowPos3sv/1.

windowPos2iv/1

-spec windowPos2iv({X :: i(), Y :: i()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos2s(X, Y)

-spec windowPos2s(X :: i(), Y :: i()) -> ok.

Equivalent to windowPos3sv/1.

windowPos2sv/1

-spec windowPos2sv({X :: i(), Y :: i()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos3d(X, Y, Z)

-spec windowPos3d(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to windowPos3sv/1.

windowPos3dv/1

-spec windowPos3dv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos3f(X, Y, Z)

-spec windowPos3f(X :: f(), Y :: f(), Z :: f()) -> ok.

Equivalent to windowPos3sv/1.

windowPos3fv/1

-spec windowPos3fv({X :: f(), Y :: f(), Z :: f()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos3i(X, Y, Z)

-spec windowPos3i(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to windowPos3sv/1.

windowPos3iv/1

-spec windowPos3iv({X :: i(), Y :: i(), Z :: i()}) -> ok.

Equivalent to windowPos3sv/1.

windowPos3s(X, Y, Z)

-spec windowPos3s(X :: i(), Y :: i(), Z :: i()) -> ok.

Equivalent to windowPos3sv/1.

windowPos3sv/1

-spec windowPos3sv({X :: i(), Y :: i(), Z :: i()}) -> ok.

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See gl:bitmap/7, gl:drawPixels/5, and gl:copyPixels/5.

External documentation.

glu

Erlang wrapper functions for OpenGL

Standard OpenGL API

This documents the functions as a brief version of the complete OpenGL reference pages.

Summary

Types

enum()

f()

i()

m12()

m16()

matrix()

mem()

vertex()

Functions

build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data)

glu:build1DMipmapLevels/9 builds a subset of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data)

glu:build1DMipmaps/6 builds a series of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data)

glu:build2DMipmapLevels/10 builds a subset of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data)

glu:build2DMipmaps/7 builds a series of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives.

build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max, Data)

glu:build3DMipmapLevels/11 builds a subset of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data)

glu:build3DMipmaps/8 builds a series of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives.

checkExtension(ExtName, ExtString)

glu:checkExtension/2 returns ?GLU_TRUE if ExtName is supported otherwise ?GLU_FALSE is returned.

cylinder(Quad, Base, Top, Height, Slices, Stacks)

glu:cylinder/6 draws a cylinder oriented along the z axis. The base of the cylinder is placed at z = 0 and the top at z=height. Like a sphere, a cylinder is subdivided around the z axis into slices and along the z axis into stacks.

deleteQuadric(Quad)

glu:deleteQuadric/1 destroys the quadrics object (created with glu:newQuadric/0) and frees any memory it uses. Once glu:deleteQuadric/1 has been called, Quad cannot be used again.

disk(Quad, Inner, Outer, Slices, Loops)

glu:disk/5 renders a disk on the z = 0 plane. The disk has a radius of Outer and contains a concentric circular hole with a radius of Inner. If Inner is 0, then no hole is generated. The disk is subdivided around the z axis into slices (like pizza slices) and also about the z axis into rings (as specified by Slices and Loops, respectively).

errorString(Error)

glu:errorString/1 produces an error string from a GL or GLU error code. The string is in ISO Latin 1 format. For example, glu:errorString/1(?GLU_OUT_OF_MEMORY) returns the string out of memory.

getString(Name)

glu:getString/1 returns a pointer to a static string describing the GLU version or the GLU extensions that are supported.

lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ)

glu:lookAt/9 creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an UP vector.

newQuadric()

glu:newQuadric/0 creates and returns a pointer to a new quadrics object. This object must be referred to when calling quadrics rendering and control functions. A return value of 0 means that there is not enough memory to allocate the object.

ortho2D(Left, Right, Bottom, Top)

glu:ortho2D/4 sets up a two-dimensional orthographic viewing region. This is equivalent to calling gl:ortho/6 with near=-1 and far=1.

partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep)

glu:partialDisk/7 renders a partial disk on the z=0 plane. A partial disk is similar to a full disk, except that only the subset of the disk from Start through Start + Sweep is included (where 0 degrees is along the +f2yf axis, 90 degrees along the +x axis, 180 degrees along the -y axis, and 270 degrees along the -x axis).

perspective(Fovy, Aspect, ZNear, ZFar)

glu:perspective/4 specifies a viewing frustum into the world coordinate system. In general, the aspect ratio in glu:perspective/4 should match the aspect ratio of the associated viewport. For example, aspect=2.0 means the viewer's angle of view is twice as wide in x as it is in y. If the viewport is twice as wide as it is tall, it displays the image without distortion.

pickMatrix(X, Y, DelX, DelY, Viewport)

glu:pickMatrix/5 creates a projection matrix that can be used to restrict drawing to a small region of the viewport. This is typically useful to determine what objects are being drawn near the cursor. Use glu:pickMatrix/5 to restrict drawing to a small region around the cursor. Then, enter selection mode (with gl:renderMode/1) and rerender the scene. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer.

project(ObjX, ObjY, ObjZ, Model, Proj, View)

glu:project/6 transforms the specified object coordinates into window coordinates using Model, Proj, and View. The result is stored in WinX, WinY, and WinZ. A return value of ?GLU_TRUE indicates success, a return value of ?GLU_FALSE indicates failure.

quadricDrawStyle(Quad, Draw)

glu:quadricDrawStyle/2 specifies the draw style for quadrics rendered with Quad. The legal values are as follows

quadricNormals(Quad, Normal)

glu:quadricNormals/2 specifies what kind of normals are desired for quadrics rendered with Quad. The legal values are as follows

quadricOrientation(Quad, Orientation)

glu:quadricOrientation/2 specifies what kind of orientation is desired for quadrics rendered with Quad. The Orientation values are as follows

quadricTexture(Quad, Texture)

glu:quadricTexture/2 specifies if texture coordinates should be generated for quadrics rendered with Quad. If the value of Texture is ?GLU_TRUE, then texture coordinates are generated, and if Texture is ?GLU_FALSE, they are not. The initial value is ?GLU_FALSE.

scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut)

glu:scaleImage/9 scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image.

sphere(Quad, Radius, Slices, Stacks)

glu:sphere/4 draws a sphere of the given radius centered around the origin. The sphere is subdivided around the z axis into slices and along the z axis into stacks (similar to lines of longitude and latitude).

tesselate(Normal, Vs)

Triangulates a polygon, the polygon is specified by a Normal and Vs a list of vertex positions.

unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal)

glu:unProject/6 maps the specified window coordinates into object coordinates using Model, Proj, and View. The result is stored in ObjX, ObjY, and ObjZ. A return value of ?GLU_TRUE indicates success; a return value of ?GLU_FALSE indicates failure.

unProject(WinX, WinY, WinZ, Model, Proj, View)

Equivalent to unProject4/9.

Types

enum()

(not exported)

-type enum() :: non_neg_integer().

f()

(not exported)

-type f() :: float().

i()

(not exported)

-type i() :: integer().

m12()

(not exported)

-type m12() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.

m16()

(not exported)

-type m16() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.

matrix()

(not exported)

-type matrix() :: m12() | m16().

mem()

(not exported)

-type mem() :: binary() | tuple().

vertex()

(not exported)

-type vertex() :: {float(), float(), float()}.

Functions

build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data)

-spec build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data) -> i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build1DMipmapLevels/9 builds a subset of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

External documentation.

build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data)

-spec build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build1DMipmaps/6 builds a series of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

External documentation.

build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data)

-spec build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data) ->
                             i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Height :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build2DMipmapLevels/10 builds a subset of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

External documentation.

build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data)

-spec build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Height :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build2DMipmaps/7 builds a series of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives.

External documentation.

build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max, Data)

-spec build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max,
                          Data) ->
                             i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Height :: i(),
                                 Depth :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build3DMipmapLevels/11 builds a subset of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.

External documentation.

build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data)

-spec build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Height :: i(),
                            Depth :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build3DMipmaps/8 builds a series of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives.

External documentation.

checkExtension(ExtName, ExtString)

-spec checkExtension(ExtName :: string(), ExtString :: string()) -> 0 | 1.

glu:checkExtension/2 returns ?GLU_TRUE if ExtName is supported otherwise ?GLU_FALSE is returned.

External documentation.

cylinder(Quad, Base, Top, Height, Slices, Stacks)

-spec cylinder(Quad :: i(), Base :: f(), Top :: f(), Height :: f(), Slices :: i(), Stacks :: i()) -> ok.

glu:cylinder/6 draws a cylinder oriented along the z axis. The base of the cylinder is placed at z = 0 and the top at z=height. Like a sphere, a cylinder is subdivided around the z axis into slices and along the z axis into stacks.

External documentation.

deleteQuadric(Quad)

-spec deleteQuadric(Quad :: i()) -> ok.

glu:deleteQuadric/1 destroys the quadrics object (created with glu:newQuadric/0) and frees any memory it uses. Once glu:deleteQuadric/1 has been called, Quad cannot be used again.

External documentation.

disk(Quad, Inner, Outer, Slices, Loops)

-spec disk(Quad :: i(), Inner :: f(), Outer :: f(), Slices :: i(), Loops :: i()) -> ok.

glu:disk/5 renders a disk on the z = 0 plane. The disk has a radius of Outer and contains a concentric circular hole with a radius of Inner. If Inner is 0, then no hole is generated. The disk is subdivided around the z axis into slices (like pizza slices) and also about the z axis into rings (as specified by Slices and Loops, respectively).

External documentation.

errorString(Error)

-spec errorString(Error :: enum()) -> string().

glu:errorString/1 produces an error string from a GL or GLU error code. The string is in ISO Latin 1 format. For example, glu:errorString/1(?GLU_OUT_OF_MEMORY) returns the string out of memory.

External documentation.

getString(Name)

-spec getString(Name :: enum()) -> string().

glu:getString/1 returns a pointer to a static string describing the GLU version or the GLU extensions that are supported.

External documentation.

lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ)

-spec lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ) -> ok
                when
                    EyeX :: f(),
                    EyeY :: f(),
                    EyeZ :: f(),
                    CenterX :: f(),
                    CenterY :: f(),
                    CenterZ :: f(),
                    UpX :: f(),
                    UpY :: f(),
                    UpZ :: f().

glu:lookAt/9 creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an UP vector.

External documentation.

newQuadric()

-spec newQuadric() -> i().

glu:newQuadric/0 creates and returns a pointer to a new quadrics object. This object must be referred to when calling quadrics rendering and control functions. A return value of 0 means that there is not enough memory to allocate the object.

External documentation.

ortho2D(Left, Right, Bottom, Top)

-spec ortho2D(Left :: f(), Right :: f(), Bottom :: f(), Top :: f()) -> ok.

glu:ortho2D/4 sets up a two-dimensional orthographic viewing region. This is equivalent to calling gl:ortho/6 with near=-1 and far=1.

External documentation.

partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep)

-spec partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep) -> ok
                     when
                         Quad :: i(),
                         Inner :: f(),
                         Outer :: f(),
                         Slices :: i(),
                         Loops :: i(),
                         Start :: f(),
                         Sweep :: f().

glu:partialDisk/7 renders a partial disk on the z=0 plane. A partial disk is similar to a full disk, except that only the subset of the disk from Start through Start + Sweep is included (where 0 degrees is along the +f2yf axis, 90 degrees along the +x axis, 180 degrees along the -y axis, and 270 degrees along the -x axis).

External documentation.

perspective(Fovy, Aspect, ZNear, ZFar)

-spec perspective(Fovy :: f(), Aspect :: f(), ZNear :: f(), ZFar :: f()) -> ok.

glu:perspective/4 specifies a viewing frustum into the world coordinate system. In general, the aspect ratio in glu:perspective/4 should match the aspect ratio of the associated viewport. For example, aspect=2.0 means the viewer's angle of view is twice as wide in x as it is in y. If the viewport is twice as wide as it is tall, it displays the image without distortion.

External documentation.

pickMatrix(X, Y, DelX, DelY, Viewport)

-spec pickMatrix(X :: f(), Y :: f(), DelX :: f(), DelY :: f(), Viewport :: {i(), i(), i(), i()}) -> ok.

glu:pickMatrix/5 creates a projection matrix that can be used to restrict drawing to a small region of the viewport. This is typically useful to determine what objects are being drawn near the cursor. Use glu:pickMatrix/5 to restrict drawing to a small region around the cursor. Then, enter selection mode (with gl:renderMode/1) and rerender the scene. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer.

External documentation.

project(ObjX, ObjY, ObjZ, Model, Proj, View)

-spec project(ObjX, ObjY, ObjZ, Model, Proj, View) -> {i(), WinX :: f(), WinY :: f(), WinZ :: f()}
                 when
                     ObjX :: f(),
                     ObjY :: f(),
                     ObjZ :: f(),
                     Model :: matrix(),
                     Proj :: matrix(),
                     View :: {i(), i(), i(), i()}.

glu:project/6 transforms the specified object coordinates into window coordinates using Model, Proj, and View. The result is stored in WinX, WinY, and WinZ. A return value of ?GLU_TRUE indicates success, a return value of ?GLU_FALSE indicates failure.

External documentation.

quadricDrawStyle(Quad, Draw)

-spec quadricDrawStyle(Quad :: i(), Draw :: enum()) -> ok.

glu:quadricDrawStyle/2 specifies the draw style for quadrics rendered with Quad. The legal values are as follows:

External documentation.

quadricNormals(Quad, Normal)

-spec quadricNormals(Quad :: i(), Normal :: enum()) -> ok.

glu:quadricNormals/2 specifies what kind of normals are desired for quadrics rendered with Quad. The legal values are as follows:

External documentation.

quadricOrientation(Quad, Orientation)

-spec quadricOrientation(Quad :: i(), Orientation :: enum()) -> ok.

glu:quadricOrientation/2 specifies what kind of orientation is desired for quadrics rendered with Quad. The Orientation values are as follows:

External documentation.

quadricTexture(Quad, Texture)

-spec quadricTexture(Quad :: i(), Texture :: 0 | 1) -> ok.

glu:quadricTexture/2 specifies if texture coordinates should be generated for quadrics rendered with Quad. If the value of Texture is ?GLU_TRUE, then texture coordinates are generated, and if Texture is ?GLU_FALSE, they are not. The initial value is ?GLU_FALSE.

External documentation.

scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut)

-spec scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut) -> i()
                    when
                        Format :: enum(),
                        WIn :: i(),
                        HIn :: i(),
                        TypeIn :: enum(),
                        DataIn :: binary(),
                        WOut :: i(),
                        HOut :: i(),
                        TypeOut :: enum(),
                        DataOut :: mem().

glu:scaleImage/9 scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image.

External documentation.

sphere(Quad, Radius, Slices, Stacks)

-spec sphere(Quad :: i(), Radius :: f(), Slices :: i(), Stacks :: i()) -> ok.

glu:sphere/4 draws a sphere of the given radius centered around the origin. The sphere is subdivided around the z axis into slices and along the z axis into stacks (similar to lines of longitude and latitude).

External documentation.

tesselate(Normal, Vs)

-spec tesselate(Normal, [Vs]) -> {Triangles, VertexPos}
                   when
                       Normal :: vertex(),
                       Vs :: vertex(),
                       Triangles :: [integer()],
                       VertexPos :: binary().

Triangulates a polygon, the polygon is specified by a Normal and Vs a list of vertex positions.

The function returns a list of indices of the vertices and a binary (64bit native float) containing an array of vertex positions, it starts with the vertices in Vs and may contain newly created vertices in the end.

unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal)

-spec unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal) ->
                    {i(), ObjX :: f(), ObjY :: f(), ObjZ :: f(), ObjW :: f()}
                    when
                        WinX :: f(),
                        WinY :: f(),
                        WinZ :: f(),
                        ClipW :: f(),
                        Model :: matrix(),
                        Proj :: matrix(),
                        View :: {i(), i(), i(), i()},
                        NearVal :: f(),
                        FarVal :: f().

glu:unProject/6 maps the specified window coordinates into object coordinates using Model, Proj, and View. The result is stored in ObjX, ObjY, and ObjZ. A return value of ?GLU_TRUE indicates success; a return value of ?GLU_FALSE indicates failure.

External documentation.

unProject(WinX, WinY, WinZ, Model, Proj, View)

-spec unProject(WinX, WinY, WinZ, Model, Proj, View) -> {i(), ObjX :: f(), ObjY :: f(), ObjZ :: f()}
                   when
                       WinX :: f(),
                       WinY :: f(),
                       WinZ :: f(),
                       Model :: matrix(),
                       Proj :: matrix(),
                       View :: {i(), i(), i(), i()}.

Equivalent to unProject4/9.

wx

A port of wxWidgets.

This is the base api of wxWidgets. This module contains functions for starting and stopping the wx-server, as well as other utility functions.

wxWidgets is object oriented, and not functional. Thus, in Wx a module represents a class, and the object created by this class has an own type, wxCLASS(). This module represents the base class, and all other wxMODULE's are sub-classes of this class.

Objects of a class are created with wxCLASS:new(...) and destroyed with wxCLASS:destroy(). Member functions are called with wxCLASS:member(Object, ...) instead of as in C++ Object.member(...).

Sub class modules inherit (non static) functions from their parents. The inherited functions are not documented in the sub-classes.

This erlang port of wxWidgets tries to be a one-to-one mapping with the original wxWidgets library. Some things are different though, as the optional arguments use property lists and can be in any order. The main difference is the event handling which is different from the original library. See wxEvtHandler.

The following classes are implemented directly as erlang types:
wxPoint={x,y},wxSize={w,h},wxRect={x,y,w,h},wxColour={r,g,b [,a]}, wxString=unicode:chardata(), wxGBPosition={r,c},wxGBSpan={rs,cs},wxGridCellCoords={r,c}.

wxWidgets uses a process specific environment, which is created by wx:new/0. To be able to use the environment from other processes, call get_env/0 to retrieve the environment and set_env/1 to assign the environment in the other process.

Global (classless) functions are located in the wx_misc module.

DATA TYPES

wx_colour() = {R::byte(), G::byte(), B::byte()} | wx_colour4()

wx_colour4() = {R::byte(), G::byte(), B::byte(), A::byte()}

wx_datetime() = {{Year::integer(), Month::integer(), Day::integer()}, {Hour::integer(), Minute::integer(), Second::integer()}}

In Local Timezone

wx_enum() = integer()

Constant defined in wx.hrl

wx_env() = #wx_env{}

Opaque process environment

wx_memory() = binary() | #wx_mem{}

Opaque memory reference

wx_object() = #wx_ref{}

Opaque object reference

wx_wxHtmlLinkInfo() = #wxHtmlLinkInfo{href=unicode:chardata(), target=unicode:chardata()}

wx_wxMouseState() = #wxMouseState{x=integer(), y=integer(), leftDown=boolean(), middleDown=boolean(), rightDown=boolean(), controlDown=boolean(), shiftDown=boolean(), altDown=boolean(), metaDown=boolean(), cmdDown=boolean()}

See #wxMouseState{} defined in wx.hrl

Summary

Types

wx_colour4()

wx_colour()

wx_datetime()

wx_enum()

wx_env()

wx_memory()

wx_object()

wx_wxHtmlLinkInfo()

wx_wxMouseState()

Functions

batch(Fun)

Batches all wx commands used in the fun. Improves performance of the command processing by grabbing the wxWidgets thread so that no event processing will be done before the complete batch of commands is invoked.

create_memory(Size)

Creates a memory area (of Size in bytes) which can be used by an external library (i.e. opengl). It is up to the client to keep a reference to this object so it does not get garbage collected by erlang while still in use by the external library.

debug(Level)

Sets debug level. If debug level is 'verbose' or 'trace' each call is printed on console. If Level is 'driver' each allocated object and deletion is printed on the console.

demo()

Starts a Wx demo if examples directory exists and is compiled

destroy()

Stops a wx server.

equal(Ref1, Ref2)

Returns true if both arguments references the same object, false otherwise

foldl(Fun, Acc, List)

Behaves like lists:foldl/3 but batches wx commands. See batch/1.

foldr(Fun, Acc, List)

Behaves like lists:foldr/3 but batches wx commands. See batch/1.

foreach(Fun, List)

Behaves like lists:foreach/2 but batches wx commands. See batch/1.

get_env()

Gets this process's current wx environment. Can be sent to other processes to allow them use this process wx environment.

get_memory_bin(Wx_mem)

Returns the memory area as a binary.

getObjectType(Wx_ref)

Returns the object type

is_null(Wx_ref)

Returns true if object is null, false otherwise

map(Fun, List)

Behaves like lists:map/2 but batches wx commands. See batch/1.

new()

Starts a wx server.

new(Options)

Starts a wx server.

null()

Returns the null object

parent_class(Wx_ref)

release_memory(Wx_mem)

Releases the memory retained by retain_memory/1

retain_memory(Wx_mem)

Saves the memory from deletion until release_memory/1 is called. If release_memory/1 is not called the memory will not be garbage collected.

set_env(Wx_env)

Sets the process wx environment, allows this process to use another process wx environment.

subscribe_events()

Adds the calling process to the list of of processes that are listening to wx application events.

typeCast/2

Casts the object to class NewType. It is needed when using functions like wxWindow:findWindow/2, which returns a generic wxObject type.

Types

wx_colour4()

-type wx_colour4() :: {R :: byte(), G :: byte(), B :: byte(), A :: byte()}.

wx_colour()

-type wx_colour() :: {R :: byte(), G :: byte(), B :: byte()} | wx_colour4().

wx_datetime()

-type wx_datetime() ::
          {{Year :: integer(), Month :: integer(), Day :: integer()},
           {Hour :: integer(), Minute :: integer(), Second :: integer()}}.

wx_enum()

-type wx_enum() :: integer().

wx_env()

-type wx_env() :: #wx_env{ref :: term(), sv :: term(), debug :: term()}.

wx_memory()

-type wx_memory() :: binary() | #wx_mem{bin :: term(), size :: term()}.

wx_object()

-type wx_object() :: #wx_ref{ref :: term(), type :: term(), state :: term()}.

wx_wxHtmlLinkInfo()

-type wx_wxHtmlLinkInfo() :: #wxHtmlLinkInfo{href :: unicode:chardata(), target :: unicode:chardata()}.

wx_wxMouseState()

-type wx_wxMouseState() ::
          #wxMouseState{x :: integer(),
                        y :: integer(),
                        leftDown :: boolean(),
                        middleDown :: boolean(),
                        rightDown :: boolean(),
                        controlDown :: boolean(),
                        shiftDown :: boolean(),
                        altDown :: boolean(),
                        metaDown :: boolean(),
                        cmdDown :: boolean(),
                        aux1Down :: boolean(),
                        aux2Down :: boolean()}.

Functions

batch(Fun)

-spec batch(function()) -> term().

Batches all wx commands used in the fun. Improves performance of the command processing by grabbing the wxWidgets thread so that no event processing will be done before the complete batch of commands is invoked.

See also: foldl/3, foldr/3, foreach/2, map/2.

create_memory(Size)

-spec create_memory(Size :: integer()) -> wx_memory().

Creates a memory area (of Size in bytes) which can be used by an external library (i.e. opengl). It is up to the client to keep a reference to this object so it does not get garbage collected by erlang while still in use by the external library.

This is far from erlang's intentional usage and can crash the erlang emulator. Use it carefully.

debug(Level)

-spec debug(Level | [Level]) -> ok when Level :: none | verbose | trace | driver | integer().

Sets debug level. If debug level is 'verbose' or 'trace' each call is printed on console. If Level is 'driver' each allocated object and deletion is printed on the console.

demo()

-spec demo() -> ok | {error, atom()}.

Starts a Wx demo if examples directory exists and is compiled

destroy()

-spec destroy() -> ok.

Stops a wx server.

equal(Ref1, Ref2)

-spec equal(Ref1 :: wx_object(), Ref2 :: wx_object()) -> boolean().

Returns true if both arguments references the same object, false otherwise

foldl(Fun, Acc, List)

-spec foldl(function(), term(), list()) -> term().

Behaves like lists:foldl/3 but batches wx commands. See batch/1.

foldr(Fun, Acc, List)

-spec foldr(function(), term(), list()) -> term().

Behaves like lists:foldr/3 but batches wx commands. See batch/1.

foreach(Fun, List)

-spec foreach(function(), list()) -> ok.

Behaves like lists:foreach/2 but batches wx commands. See batch/1.

get_env()

-spec get_env() -> wx_env().

Gets this process's current wx environment. Can be sent to other processes to allow them use this process wx environment.

See also: set_env/1.

get_memory_bin(Wx_mem)

-spec get_memory_bin(Wx_mem :: wx_memory()) -> binary().

Returns the memory area as a binary.

getObjectType(Wx_ref)

-spec getObjectType(Wx_ref :: wx_object()) -> atom().

Returns the object type

is_null(Wx_ref)

-spec is_null(Wx_ref :: wx_object()) -> boolean().

Returns true if object is null, false otherwise

map(Fun, List)

-spec map(function(), list()) -> list().

Behaves like lists:map/2 but batches wx commands. See batch/1.

new()

-spec new() -> wx_object().

Starts a wx server.

new(Options)

-spec new([Option]) -> wx_object() when Option :: {debug, list() | atom()} | {silent_start, boolean()}.

Starts a wx server.

Option may be {debug, Level}, see debug/1. Or {silent_start, Bool}, which causes error messages at startup to be suppressed. The latter can be used as a silent test of whether wx is properly installed or not.

null()

-spec null() -> wx_object().

Returns the null object

parent_class(Wx_ref)

-spec parent_class(Wx_ref :: wx_object()) -> boolean().

release_memory(Wx_mem)

-spec release_memory(Wx_mem :: wx_memory()) -> ok.

Releases the memory retained by retain_memory/1

retain_memory(Wx_mem)

-spec retain_memory(Wx_mem :: wx_memory()) -> ok.

Saves the memory from deletion until release_memory/1 is called. If release_memory/1 is not called the memory will not be garbage collected.

set_env(Wx_env)

-spec set_env(Wx_env :: wx_env()) -> ok.

Sets the process wx environment, allows this process to use another process wx environment.

subscribe_events()

-spec subscribe_events() -> ok.

Adds the calling process to the list of of processes that are listening to wx application events.

At the moment these are all MacOSX specific events corresponding to MacNewFile() and friends from wxWidgets wxApp:

{new_file, ""}

{open_file, Filename}

{print_file, Filename}

{open_url, Url}

{reopen_app, ""}

The call always returns ok but will have sent any already received events to the calling process.

typeCast/2

-spec typeCast(wx_object(), atom()) -> wx_object().

Casts the object to class NewType. It is needed when using functions like wxWindow:findWindow/2, which returns a generic wxObject type.

wxAcceleratorEntry

An object used by an application wishing to create an accelerator table (see wxAcceleratorTable).

See:

wxAcceleratorTable

wxWindow:setAcceleratorTable/2

wxWidgets docs: wxAcceleratorEntry

Summary

Types

wxAcceleratorEntry()

Functions

destroy(This)

Destroys the object

getCommand(This)

Returns the command identifier for the accelerator table entry.

getFlags(This)

Returns the flags for the accelerator table entry.

getKeyCode(This)

Returns the keycode for the accelerator table entry.

new()

Equivalent to new([]).

new/1

Copy ctor.

set(This, Flags, KeyCode, Cmd)

Equivalent to set(This, Flags, KeyCode, Cmd, []).

set/5

Sets the accelerator entry parameters.

Types

wxAcceleratorEntry()

-type wxAcceleratorEntry() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxAcceleratorEntry()) -> ok.

Destroys the object

getCommand(This)

-spec getCommand(This) -> integer() when This :: wxAcceleratorEntry().

Returns the command identifier for the accelerator table entry.

getFlags(This)

-spec getFlags(This) -> integer() when This :: wxAcceleratorEntry().

Returns the flags for the accelerator table entry.

getKeyCode(This)

-spec getKeyCode(This) -> integer() when This :: wxAcceleratorEntry().

Returns the keycode for the accelerator table entry.

new()

-spec new() -> wxAcceleratorEntry().

Equivalent to new([]).

new/1

-spec new([Option]) -> wxAcceleratorEntry()
             when
                 Option ::
                     {flags, integer()} |
                     {keyCode, integer()} |
                     {cmd, integer()} |
                     {item, wxMenuItem:wxMenuItem()};
         (Entry) -> wxAcceleratorEntry() when Entry :: wxAcceleratorEntry().

Copy ctor.

set(This, Flags, KeyCode, Cmd)

-spec set(This, Flags, KeyCode, Cmd) -> ok
             when
                 This :: wxAcceleratorEntry(),
                 Flags :: integer(),
                 KeyCode :: integer(),
                 Cmd :: integer().

Equivalent to set(This, Flags, KeyCode, Cmd, []).

set/5

-spec set(This, Flags, KeyCode, Cmd, [Option]) -> ok
             when
                 This :: wxAcceleratorEntry(),
                 Flags :: integer(),
                 KeyCode :: integer(),
                 Cmd :: integer(),
                 Option :: {item, wxMenuItem:wxMenuItem()}.

Sets the accelerator entry parameters.

wxAcceleratorTable

An accelerator table allows the application to specify a table of keyboard shortcuts for menu or button commands.

The object ?wxNullAcceleratorTable is defined to be a table with no data, and is the initial accelerator table for a window.

Example:

Remark: An accelerator takes precedence over normal processing and can be a convenient way to program some event handling. For example, you can use an accelerator table to enable a dialog with a multi-line text control to accept CTRL-Enter as meaning 'OK'.

Predefined objects (include wx.hrl): ?wxNullAcceleratorTable

See:

wxAcceleratorEntry

wxWindow:setAcceleratorTable/2

wxWidgets docs: wxAcceleratorTable

Summary

Types

wxAcceleratorTable()

Functions

destroy(This)

Destroys the object

isOk(This)

Returns true if the accelerator table is valid.

new()

Default ctor.

new(N, Entries)

Initializes the accelerator table from an array of wxAcceleratorEntry.

ok(This)

Equivalent to: isOk/1

Types

wxAcceleratorTable()

-type wxAcceleratorTable() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxAcceleratorTable()) -> ok.

Destroys the object

isOk(This)

-spec isOk(This) -> boolean() when This :: wxAcceleratorTable().

Returns true if the accelerator table is valid.

new()

-spec new() -> wxAcceleratorTable().

Default ctor.

new(N, Entries)

-spec new(N, Entries) -> wxAcceleratorTable()
             when N :: integer(), Entries :: [wxAcceleratorEntry:wxAcceleratorEntry()].

Initializes the accelerator table from an array of wxAcceleratorEntry.

ok(This)

-spec ok(This) -> boolean() when This :: wxAcceleratorTable().

Equivalent to: isOk/1

wxActivateEvent

An activate event is sent when a window or application is being activated or deactivated.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxActivateEvent

Events

Use wxEvtHandler:connect/3 with wxActivateEventType to subscribe to events of this type.

Summary

Types

wxActivate()

wxActivateEvent()

wxActivateEventType()

Functions

getActive(This)

Returns true if the application or window is being activated, false otherwise.

Types

wxActivate()

-type wxActivate() :: #wxActivate{type :: wxActivateEvent:wxActivateEventType(), active :: boolean()}.

wxActivateEvent()

-type wxActivateEvent() :: wx:wx_object().

wxActivateEventType()

-type wxActivateEventType() :: activate | activate_app | hibernate.

Functions

getActive(This)

-spec getActive(This) -> boolean() when This :: wxActivateEvent().

Returns true if the application or window is being activated, false otherwise.

wxArtProvider

wxArtProvider class is used to customize the look of wxWidgets application.

When wxWidgets needs to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a hard-coded resource but asks wxArtProvider for it instead. This way users can plug in their own wxArtProvider class and easily replace standard art with their own version.

All that is needed is to derive a class from wxArtProvider, override either its wxArtProvider::CreateBitmap() (not implemented in wx) and/or its wxArtProvider::CreateIconBundle() (not implemented in wx) methods and register the provider with wxArtProvider::Push() (not implemented in wx):

If you need bitmap images (of the same artwork) that should be displayed at different sizes you should probably consider overriding wxArtProvider::CreateIconBundle (not implemented in wx) and supplying icon bundles that contain different bitmap sizes.

There's another way of taking advantage of this class: you can use it in your code and use platform native icons as provided by getBitmap/2 or getIcon/2.

Identifying art resources

Every bitmap and icon bundle are known to wxArtProvider under an unique ID that is used when requesting a resource from it. The ID is represented by the ?wxArtID type and can have one of these predefined values (you can see bitmaps represented by these constants in the page_samples_artprov):

Additionally, any string recognized by custom art providers registered using wxArtProvider::Push (not implemented in wx) may be used.

Note: When running under GTK+ 2, GTK+ stock item IDs (e.g. "gtk-cdrom") may be used as well: For a list of the GTK+ stock items please refer to the GTK+ documentation page. It is also possible to load icons from the current icon theme by specifying their name (without extension and directory components). Icon themes recognized by GTK+ follow the freedesktop.org Icon Themes specification. Note that themes are not guaranteed to contain all icons, so wxArtProvider may return ?wxNullBitmap or ?wxNullIcon. The default theme is typically installed in /usr/share/icons/hicolor.

Clients

The client is the entity that calls wxArtProvider's getBitmap/2 or getIcon/2 function. It is represented by wxClientID type and can have one of these values:

wxART_TOOLBAR

wxART_MENU

wxART_BUTTON

wxART_FRAME_ICON

wxART_CMN_DIALOG

wxART_HELP_BROWSER

wxART_MESSAGE_BOX

wxART_OTHER (used for all requests that don't fit into any of the categories above)

Client ID serve as a hint to wxArtProvider that is supposed to help it to choose the best looking bitmap. For example it is often desirable to use slightly different icons in menus and toolbars even though they represent the same action (e.g. wxART_FILE_OPEN). Remember that this is really only a hint for wxArtProvider - it is common that getBitmap/2 returns identical bitmap for different client values!

See:

Examples

wxArtProvider

wxWidgets docs: wxArtProvider

Summary

Types

wxArtProvider()

Functions

getBitmap(Id)

Equivalent to getBitmap(Id, []).

getBitmap(Id, Options)

Query registered providers for bitmap with given ID.

getIcon(Id)

Equivalent to getIcon(Id, []).

getIcon(Id, Options)

Same as getBitmap/2, but return a wxIcon object (or ?wxNullIcon on failure).

Types

wxArtProvider()

-type wxArtProvider() :: wx:wx_object().

Functions

getBitmap(Id)

-spec getBitmap(Id) -> wxBitmap:wxBitmap() when Id :: unicode:chardata().

Equivalent to getBitmap(Id, []).

getBitmap(Id, Options)

-spec getBitmap(Id, [Option]) -> wxBitmap:wxBitmap()
                   when
                       Id :: unicode:chardata(),
                       Option :: {client, unicode:chardata()} | {size, {W :: integer(), H :: integer()}}.

Query registered providers for bitmap with given ID.

Return: The bitmap if one of registered providers recognizes the ID or wxNullBitmap otherwise.

getIcon(Id)

-spec getIcon(Id) -> wxIcon:wxIcon() when Id :: unicode:chardata().

Equivalent to getIcon(Id, []).

getIcon(Id, Options)

-spec getIcon(Id, [Option]) -> wxIcon:wxIcon()
                 when
                     Id :: unicode:chardata(),
                     Option :: {client, unicode:chardata()} | {size, {W :: integer(), H :: integer()}}.

Same as getBitmap/2, but return a wxIcon object (or ?wxNullIcon on failure).

wxAuiDockArt

wxAuiDockArt is part of the wxAUI class framework.

See also overview_aui.

wxAuiDockArt is the art provider: provides all drawing functionality to the wxAui dock manager. This allows the dock manager to have a pluggable look-and-feel.

By default, a wxAuiManager uses an instance of this class called wxAuiDefaultDockArt (not implemented in wx) which provides bitmap art and a colour scheme that is adapted to the major platforms' look. You can either derive from that class to alter its behaviour or write a completely new dock art class. Call wxAuiManager:setArtProvider/2 to force wxAUI to use your new dock art provider.

See:

wxAuiManager

wxAuiPaneInfo

wxWidgets docs: wxAuiDockArt

Summary

Types

wxAuiDockArt()

Functions

getColour(This, Id)

Get the colour of a certain setting.

getFont(This, Id)

Get a font setting.

getMetric(This, Id)

Get the value of a certain setting.

setColour(This, Id, Colour)

Set a certain setting with the value colour.

setFont(This, Id, Font)

Set a font setting.

setMetric(This, Id, New_val)

Set a certain setting with the value new\_val.

Types

wxAuiDockArt()

-type wxAuiDockArt() :: wx:wx_object().

Functions

getColour(This, Id)

-spec getColour(This, Id) -> wx:wx_colour4() when This :: wxAuiDockArt(), Id :: integer().

Get the colour of a certain setting.

id can be one of the colour values of wxAuiPaneDockArtSetting.

getFont(This, Id)

-spec getFont(This, Id) -> wxFont:wxFont() when This :: wxAuiDockArt(), Id :: integer().

Get a font setting.

getMetric(This, Id)

-spec getMetric(This, Id) -> integer() when This :: wxAuiDockArt(), Id :: integer().

Get the value of a certain setting.

id can be one of the size values of wxAuiPaneDockArtSetting.

setColour(This, Id, Colour)

-spec setColour(This, Id, Colour) -> ok
                   when This :: wxAuiDockArt(), Id :: integer(), Colour :: wx:wx_colour().

Set a certain setting with the value colour.

id can be one of the colour values of wxAuiPaneDockArtSetting.

setFont(This, Id, Font)

-spec setFont(This, Id, Font) -> ok
                 when This :: wxAuiDockArt(), Id :: integer(), Font :: wxFont:wxFont().

Set a font setting.

setMetric(This, Id, New_val)

-spec setMetric(This, Id, New_val) -> ok
                   when This :: wxAuiDockArt(), Id :: integer(), New_val :: integer().

Set a certain setting with the value new\_val.

id can be one of the size values of wxAuiPaneDockArtSetting.

wxAuiManager

wxAuiManager is the central class of the wxAUI class framework.

wxAuiManager manages the panes associated with it for a particular wxFrame, using a pane's wxAuiPaneInfo information to determine each pane's docking and floating behaviour.

wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each frame. It uses a replaceable dock art class to do all drawing, so all drawing is localized in one area, and may be customized depending on an application's specific needs.

wxAuiManager works as follows: the programmer adds panes to the class, or makes changes to existing pane properties (dock position, floating state, show state, etc.). To apply these changes, wxAuiManager's update/1 function is called. This batch processing can be used to avoid flicker, by modifying more than one pane at a time, and then "committing" all of the changes at once by calling update/1.

Panes can be added quite easily:

Later on, the positions can be modified easily. The following will float an existing pane in a tool window:

Layers, Rows and Directions, Positions

Inside wxAUI, the docking layout is figured out by checking several pane parameters. Four of these are important for determining where a pane will end up:

Direction: Each docked pane has a direction, Top, Bottom, Left, Right, or Center. This is fairly self-explanatory. The pane will be placed in the location specified by this variable.

Position: More than one pane can be placed inside of a dock. Imagine two panes being docked on the left side of a window. One pane can be placed over another. In proportionally managed docks, the pane position indicates its sequential position, starting with zero. So, in our scenario with two panes docked on the left side, the top pane in the dock would have position 0, and the second one would occupy position 1.

Row: A row can allow for two docks to be placed next to each other. One of the most common places for this to happen is in the toolbar. Multiple toolbar rows are allowed, the first row being row 0, and the second row 1. Rows can also be used on vertically docked panes.

Layer: A layer is akin to an onion. Layer 0 is the very center of the managed pane. Thus, if a pane is in layer 0, it will be closest to the center window (also sometimes known as the "content window"). Increasing layers "swallow up" all layers of a lower value. This can look very similar to multiple rows, but is different because all panes in a lower level yield to panes in higher levels. The best way to understand layers is by running the wxAUI sample.

Styles

This class supports the following styles:

wxAUI_MGR_ALLOW_FLOATING: Allow a pane to be undocked to take the form of a wxMiniFrame.

wxAUI_MGR_ALLOW_ACTIVE_PANE: Change the color of the title bar of the pane when it is activated.

wxAUI_MGR_TRANSPARENT_DRAG: Make the pane transparent during its movement.

wxAUI_MGR_TRANSPARENT_HINT: The possible location for docking is indicated by a translucent area.

wxAUI_MGR_VENETIAN_BLINDS_HINT: The possible location for docking is indicated by gradually appearing partially transparent hint.

wxAUI_MGR_RECTANGLE_HINT: The possible location for docking is indicated by a rectangular outline.

wxAUI_MGR_HINT_FADE: The translucent area where the pane could be docked appears gradually.

wxAUI_MGR_NO_VENETIAN_BLINDS_FADE: Used in complement of wxAUI_MGR_VENETIAN_BLINDS_HINT to show the docking hint immediately.

wxAUI_MGR_LIVE_RESIZE: When a docked pane is resized, its content is refreshed in live (instead of moving the border alone and refreshing the content at the end).

wxAUI_MGR_DEFAULT: Default behaviour, combines: wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_TRANSPARENT_HINT | wxAUI_MGR_HINT_FADE | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE.

See:

Overview aui

wxAuiNotebook

wxAuiDockArt

wxAuiPaneInfo

This class is derived, and can use functions, from:

wxEvtHandler

wxWidgets docs: wxAuiManager

Events

Event types emitted from this class:

aui_pane_button

aui_pane_close

aui_pane_maximize

aui_pane_restore

aui_pane_activated

aui_render

Summary

Types

wxAuiManager()

Functions

addPane(This, Window)

Equivalent to addPane(This, Window, []).

addPane/3

addPane/4 tells the frame manager to start managing a child window.

addPane(This, Window, Pane_info, Drop_pos)

destroy(This)

Destroys the object

detachPane(This, Window)

Tells the wxAuiManager to stop managing the pane specified by window.

getAllPanes(This)

Returns an array of all panes managed by the frame manager.

getArtProvider(This)

Returns the current art provider being used.

getDockSizeConstraint(This)

Returns the current dock constraint values.

getFlags(This)

Returns the current ?wxAuiManagerOption's flags.

getManagedWindow(This)

Returns the frame currently being managed by wxAuiManager.

getManager(Window)

Calling this method will return the wxAuiManager for a given window.

getPane/2

getPane/2 is used to lookup a wxAuiPaneInfo object either by window pointer or by pane name, which acts as a unique id for a window pane.

hideHint(This)

hideHint/1 hides any docking hint that may be visible.

insertPane(This, Window, Insert_location)

Equivalent to insertPane(This, Window, Insert_location, []).

insertPane/4

This method is used to insert either a previously unmanaged pane window into the frame manager, or to insert a currently managed pane somewhere else.

loadPaneInfo(This, Pane_part, Pane)

loadPaneInfo/3 is similar to LoadPerspective, with the exception that it only loads information about a single pane.

loadPerspective(This, Perspective)

Equivalent to loadPerspective(This, Perspective, []).

loadPerspective/3

Loads a saved perspective.

new()

Equivalent to new([]).

new(Options)

Constructor.

savePaneInfo(This, Pane)

savePaneInfo/2 is similar to SavePerspective, with the exception that it only saves information about a single pane.

savePerspective(This)

Saves the entire user interface layout into an encoded wxString (not implemented in wx), which can then be stored by the application (probably using wxConfig).

setArtProvider(This, Art_provider)

Instructs wxAuiManager to use art provider specified by parameter art\_provider for all drawing calls.

setDockSizeConstraint(This, Widthpct, Heightpct)

When a user creates a new dock by dragging a window into a docked position, often times the large size of the window will create a dock that is unwieldy large.

setFlags(This, Flags)

This method is used to specify ?wxAuiManagerOption's flags.

setManagedWindow(This, Managed_wnd)

Called to specify the frame or window which is to be managed by wxAuiManager.

showHint(This, Rect)

This function is used by controls to explicitly show a hint window at the specified rectangle.

unInit(This)

Dissociate the managed window from the manager.

update(This)

This method is called after any number of changes are made to any of the managed panes.

Types

wxAuiManager()

-type wxAuiManager() :: wx:wx_object().

Functions

addPane(This, Window)

-spec addPane(This, Window) -> boolean() when This :: wxAuiManager(), Window :: wxWindow:wxWindow().

Equivalent to addPane(This, Window, []).

addPane/3

-spec addPane(This, Window, [Option]) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Option :: {direction, integer()} | {caption, unicode:chardata()};
             (This, Window, Pane_info) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo().

addPane/4 tells the frame manager to start managing a child window.

There are several versions of this function. The first version allows the full spectrum of pane parameter possibilities. The second version is used for simpler user interfaces which do not require as much configuration. The last version allows a drop position to be specified, which will determine where the pane will be added.

addPane(This, Window, Pane_info, Drop_pos)

-spec addPane(This, Window, Pane_info, Drop_pos) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo(),
                     Drop_pos :: {X :: integer(), Y :: integer()}.

destroy(This)

-spec destroy(This :: wxAuiManager()) -> ok.

Destroys the object

detachPane(This, Window)

-spec detachPane(This, Window) -> boolean() when This :: wxAuiManager(), Window :: wxWindow:wxWindow().

Tells the wxAuiManager to stop managing the pane specified by window.

The window, if in a floated frame, is reparented to the frame managed by wxAuiManager.

getAllPanes(This)

-spec getAllPanes(This) -> [wxAuiPaneInfo:wxAuiPaneInfo()] when This :: wxAuiManager().

Returns an array of all panes managed by the frame manager.

getArtProvider(This)

-spec getArtProvider(This) -> wxAuiDockArt:wxAuiDockArt() when This :: wxAuiManager().

Returns the current art provider being used.

See: wxAuiDockArt

getDockSizeConstraint(This)

-spec getDockSizeConstraint(This) -> {Widthpct :: number(), Heightpct :: number()}
                               when This :: wxAuiManager().

Returns the current dock constraint values.

See setDockSizeConstraint/3 for more information.

getFlags(This)

-spec getFlags(This) -> integer() when This :: wxAuiManager().

Returns the current ?wxAuiManagerOption's flags.

getManagedWindow(This)

-spec getManagedWindow(This) -> wxWindow:wxWindow() when This :: wxAuiManager().

Returns the frame currently being managed by wxAuiManager.

getManager(Window)

-spec getManager(Window) -> wxAuiManager() when Window :: wxWindow:wxWindow().

Calling this method will return the wxAuiManager for a given window.

The window parameter should specify any child window or sub-child window of the frame or window managed by wxAuiManager.

The window parameter need not be managed by the manager itself, nor does it even need to be a child or sub-child of a managed window. It must however be inside the window hierarchy underneath the managed window.

getPane/2

-spec getPane(This, Name) -> wxAuiPaneInfo:wxAuiPaneInfo()
                 when This :: wxAuiManager(), Name :: unicode:chardata();
             (This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo()
                 when This :: wxAuiManager(), Window :: wxWindow:wxWindow().

getPane/2 is used to lookup a wxAuiPaneInfo object either by window pointer or by pane name, which acts as a unique id for a window pane.

The returned wxAuiPaneInfo object may then be modified to change a pane's look, state or position. After one or more modifications to wxAuiPaneInfo, update/1 should be called to commit the changes to the user interface. If the lookup failed (meaning the pane could not be found in the manager), a call to the returned wxAuiPaneInfo's IsOk() method will return false.

hideHint(This)

-spec hideHint(This) -> ok when This :: wxAuiManager().

hideHint/1 hides any docking hint that may be visible.

insertPane(This, Window, Insert_location)

-spec insertPane(This, Window, Insert_location) -> boolean()
                    when
                        This :: wxAuiManager(),
                        Window :: wxWindow:wxWindow(),
                        Insert_location :: wxAuiPaneInfo:wxAuiPaneInfo().

Equivalent to insertPane(This, Window, Insert_location, []).

insertPane/4

-spec insertPane(This, Window, Insert_location, [Option]) -> boolean()
                    when
                        This :: wxAuiManager(),
                        Window :: wxWindow:wxWindow(),
                        Insert_location :: wxAuiPaneInfo:wxAuiPaneInfo(),
                        Option :: {insert_level, integer()}.

This method is used to insert either a previously unmanaged pane window into the frame manager, or to insert a currently managed pane somewhere else.

insertPane/4 will push all panes, rows, or docks aside and insert the window into the position specified by insert_location.

Because insert_location can specify either a pane, dock row, or dock layer, the insert_level parameter is used to disambiguate this. The parameter insert_level can take a value of wxAUI_INSERT_PANE, wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK.

loadPaneInfo(This, Pane_part, Pane)

-spec loadPaneInfo(This, Pane_part, Pane) -> ok
                      when
                          This :: wxAuiManager(),
                          Pane_part :: unicode:chardata(),
                          Pane :: wxAuiPaneInfo:wxAuiPaneInfo().

loadPaneInfo/3 is similar to LoadPerspective, with the exception that it only loads information about a single pane.

This method writes the serialized data into the passed pane. Pointers to UI elements are not modified.

Note: This operation also changes the name in the pane information!

See: loadPerspective/3

See: savePaneInfo/2

See: savePerspective/1

loadPerspective(This, Perspective)

-spec loadPerspective(This, Perspective) -> boolean()
                         when This :: wxAuiManager(), Perspective :: unicode:chardata().

Equivalent to loadPerspective(This, Perspective, []).

loadPerspective/3

-spec loadPerspective(This, Perspective, [Option]) -> boolean()
                         when
                             This :: wxAuiManager(),
                             Perspective :: unicode:chardata(),
                             Option :: {update, boolean()}.

Loads a saved perspective.

A perspective is the layout state of an AUI managed window.

All currently existing panes that have an object in "perspective" with the same name ("equivalent") will receive the layout parameters of the object in "perspective". Existing panes that do not have an equivalent in "perspective" remain unchanged, objects in "perspective" having no equivalent in the manager are ignored.

See: loadPaneInfo/3

See: loadPerspective/3

See: savePerspective/1

new()

-spec new() -> wxAuiManager().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxAuiManager()
             when Option :: {managed_wnd, wxWindow:wxWindow()} | {flags, integer()}.

Constructor.

savePaneInfo(This, Pane)

-spec savePaneInfo(This, Pane) -> unicode:charlist()
                      when This :: wxAuiManager(), Pane :: wxAuiPaneInfo:wxAuiPaneInfo().

savePaneInfo/2 is similar to SavePerspective, with the exception that it only saves information about a single pane.

Return: The serialized layout parameters of the pane are returned within the string. Information about the pointers to UI elements stored in the pane are not serialized.

See: loadPaneInfo/3

See: loadPerspective/3

See: savePerspective/1

savePerspective(This)

-spec savePerspective(This) -> unicode:charlist() when This :: wxAuiManager().

Saves the entire user interface layout into an encoded wxString (not implemented in wx), which can then be stored by the application (probably using wxConfig).

See: loadPerspective/3

See: loadPaneInfo/3

See: savePaneInfo/2

setArtProvider(This, Art_provider)

-spec setArtProvider(This, Art_provider) -> ok
                        when This :: wxAuiManager(), Art_provider :: wxAuiDockArt:wxAuiDockArt().

Instructs wxAuiManager to use art provider specified by parameter art\_provider for all drawing calls.

This allows pluggable look-and-feel features. The previous art provider object, if any, will be deleted by wxAuiManager.

See: wxAuiDockArt

setDockSizeConstraint(This, Widthpct, Heightpct)

-spec setDockSizeConstraint(This, Widthpct, Heightpct) -> ok
                               when This :: wxAuiManager(), Widthpct :: number(), Heightpct :: number().

When a user creates a new dock by dragging a window into a docked position, often times the large size of the window will create a dock that is unwieldy large.

wxAuiManager by default limits the size of any new dock to 1/3 of the window size. For horizontal docks, this would be 1/3 of the window height. For vertical docks, 1/3 of the width.

Calling this function will adjust this constraint value. The numbers must be between 0.0 and 1.0. For instance, calling SetDockSizeContraint with 0.5, 0.5 will cause new docks to be limited to half of the size of the entire managed window.

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxAuiManager(), Flags :: integer().

This method is used to specify ?wxAuiManagerOption's flags.

flags specifies options which allow the frame management behaviour to be modified.

setManagedWindow(This, Managed_wnd)

-spec setManagedWindow(This, Managed_wnd) -> ok
                          when This :: wxAuiManager(), Managed_wnd :: wxWindow:wxWindow().

Called to specify the frame or window which is to be managed by wxAuiManager.

Frame management is not restricted to just frames. Child windows or custom controls are also allowed.

showHint(This, Rect)

-spec showHint(This, Rect) -> ok
                  when
                      This :: wxAuiManager(),
                      Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This function is used by controls to explicitly show a hint window at the specified rectangle.

It is rarely called, and is mostly used by controls implementing custom pane drag/drop behaviour. The specified rectangle should be in screen coordinates.

unInit(This)

-spec unInit(This) -> ok when This :: wxAuiManager().

Dissociate the managed window from the manager.

This function may be called before the managed frame or window is destroyed, but, since wxWidgets 3.1.4, it's unnecessary to call it explicitly, as it will be called automatically when this window is destroyed, as well as when the manager itself is.

update(This)

-spec update(This) -> ok when This :: wxAuiManager().

This method is called after any number of changes are made to any of the managed panes.

update/1 must be invoked after addPane/4 or insertPane/4 are called in order to "realize" or "commit" the changes. In addition, any number of changes may be made to wxAuiPaneInfo structures (retrieved with getPane/2), but to realize the changes, update/1 must be called. This construction allows pane flicker to be avoided by updating the whole layout at one time.

wxAuiManagerEvent

Event used to indicate various actions taken with wxAuiManager.

See wxAuiManager for available event types.

See:

wxAuiManager

wxAuiPaneInfo

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxAuiManagerEvent

Events

Use wxEvtHandler:connect/3 with wxAuiManagerEventType to subscribe to events of this type.

Summary

Types

wxAuiManager()

wxAuiManagerEvent()

wxAuiManagerEventType()

Functions

canVeto(This)

Return: true if this event can be vetoed.

getButton(This)

Return: The ID of the button that was clicked.

getDC(This)

getManager(This)

Return: The wxAuiManager this event is associated with.

getPane(This)

Return: The pane this event is associated with.

getVeto(This)

Return: true if this event was vetoed.

setButton(This, Button)

Sets the ID of the button clicked that triggered this event.

setCanVeto(This, Can_veto)

Sets whether or not this event can be vetoed.

setDC(This, Pdc)

setManager(This, Manager)

Sets the wxAuiManager this event is associated with.

setPane(This, Pane)

Sets the pane this event is associated with.

veto(This)

Equivalent to veto(This, []).

veto/2

Cancels the action indicated by this event if canVeto/1 is true.

Types

wxAuiManager()

-type wxAuiManager() ::
          #wxAuiManager{type :: wxAuiManagerEvent:wxAuiManagerEventType(),
                        manager :: wxAuiManager:wxAuiManager(),
                        pane :: wxAuiPaneInfo:wxAuiPaneInfo(),
                        button :: integer(),
                        veto_flag :: boolean(),
                        canveto_flag :: boolean(),
                        dc :: wxDC:wxDC()}.

wxAuiManagerEvent()

-type wxAuiManagerEvent() :: wx:wx_object().

wxAuiManagerEventType()

-type wxAuiManagerEventType() ::
          aui_pane_button | aui_pane_close | aui_pane_maximize | aui_pane_restore | aui_pane_activated |
          aui_render | aui_find_manager.

Functions

canVeto(This)

-spec canVeto(This) -> boolean() when This :: wxAuiManagerEvent().

Return: true if this event can be vetoed.

See: veto/2

getButton(This)

-spec getButton(This) -> integer() when This :: wxAuiManagerEvent().

Return: The ID of the button that was clicked.

getDC(This)

-spec getDC(This) -> wxDC:wxDC() when This :: wxAuiManagerEvent().

getManager(This)

-spec getManager(This) -> wxAuiManager:wxAuiManager() when This :: wxAuiManagerEvent().

Return: The wxAuiManager this event is associated with.

getPane(This)

-spec getPane(This) -> wxAuiPaneInfo:wxAuiPaneInfo() when This :: wxAuiManagerEvent().

Return: The pane this event is associated with.

getVeto(This)

-spec getVeto(This) -> boolean() when This :: wxAuiManagerEvent().

Return: true if this event was vetoed.

See: veto/2

setButton(This, Button)

-spec setButton(This, Button) -> ok when This :: wxAuiManagerEvent(), Button :: integer().

Sets the ID of the button clicked that triggered this event.

setCanVeto(This, Can_veto)

-spec setCanVeto(This, Can_veto) -> ok when This :: wxAuiManagerEvent(), Can_veto :: boolean().

Sets whether or not this event can be vetoed.

setDC(This, Pdc)

-spec setDC(This, Pdc) -> ok when This :: wxAuiManagerEvent(), Pdc :: wxDC:wxDC().

setManager(This, Manager)

-spec setManager(This, Manager) -> ok
                    when This :: wxAuiManagerEvent(), Manager :: wxAuiManager:wxAuiManager().

Sets the wxAuiManager this event is associated with.

setPane(This, Pane)

-spec setPane(This, Pane) -> ok when This :: wxAuiManagerEvent(), Pane :: wxAuiPaneInfo:wxAuiPaneInfo().

Sets the pane this event is associated with.

veto(This)

-spec veto(This) -> ok when This :: wxAuiManagerEvent().

Equivalent to veto(This, []).

veto/2

-spec veto(This, [Option]) -> ok when This :: wxAuiManagerEvent(), Option :: {veto, boolean()}.

Cancels the action indicated by this event if canVeto/1 is true.

wxAuiNotebook

wxAuiNotebook is part of the wxAUI class framework, which represents a notebook control, managing multiple windows with associated tabs.

See also overview_aui.

wxAuiNotebook is a notebook control which implements many features common in applications with dockable panes. Specifically, wxAuiNotebook implements functionality which allows the user to rearrange tab order via drag-and-drop, split the tab window into many different splitter configurations, and toggle through different themes to customize the control's look and feel.

The default theme that is used is wxAuiDefaultTabArt (not implemented in wx), which provides a modern, glossy look and feel. The theme can be changed by calling setArtProvider/2.

Styles

This class supports the following styles:

wxAUI_NB_DEFAULT_STYLE: Defined as wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_MIDDLE_CLICK_CLOSE.

wxAUI_NB_TAB_SPLIT: Allows the tab control to be split by dragging a tab.

wxAUI_NB_TAB_MOVE: Allows a tab to be moved horizontally by dragging.

wxAUI_NB_TAB_EXTERNAL_MOVE: Allows a tab to be moved to another tab control.

wxAUI_NB_TAB_FIXED_WIDTH: With this style, all tabs have the same width.

wxAUI_NB_SCROLL_BUTTONS: With this style, left and right scroll buttons are displayed.

wxAUI_NB_WINDOWLIST_BUTTON: With this style, a drop-down list of windows is available.

wxAUI_NB_CLOSE_BUTTON: With this style, a close button is available on the tab bar.

wxAUI_NB_CLOSE_ON_ACTIVE_TAB: With this style, the close button is visible on the active tab.

wxAUI_NB_CLOSE_ON_ALL_TABS: With this style, the close button is visible on all tabs.

wxAUI_NB_MIDDLE_CLICK_CLOSE: With this style, middle click on a tab closes the tab.

wxAUI_NB_TOP: With this style, tabs are drawn along the top of the notebook.

wxAUI_NB_BOTTOM: With this style, tabs are drawn along the bottom of the notebook.

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxAuiNotebook

Events

Event types emitted from this class:

command_auinotebook_page_close

command_auinotebook_page_closed

command_auinotebook_page_changed

command_auinotebook_page_changing

command_auinotebook_button

command_auinotebook_begin_drag

command_auinotebook_end_drag

command_auinotebook_drag_motion

command_auinotebook_allow_dnd

command_auinotebook_drag_done

command_auinotebook_tab_middle_down

command_auinotebook_tab_middle_up

command_auinotebook_tab_right_down

command_auinotebook_tab_right_up

command_auinotebook_bg_dclick

Summary

Types

wxAuiNotebook()

Functions

addPage(This, Page, Caption)

Equivalent to addPage(This, Page, Caption, []).

addPage/4

Adds a page.

addPage(This, Page, Text, Select, ImageId)

Adds a new page.

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creates the notebook window.

create/4

Constructs the book control with the given parameters.

deletePage(This, Page)

Deletes a page at the given index.

destroy(This)

Destroys the object

getArtProvider(This)

Returns the associated art provider.

getPage(This, Page_idx)

Returns the page specified by the given index.

getPageBitmap(This, Page)

Returns the tab bitmap for the page.

getPageCount(This)

Returns the number of pages in the notebook.

getPageIndex(This, Page_wnd)

Returns the page index for the specified window.

getPageText(This, Page)

Returns the tab label for the page.

getSelection(This)

Returns the currently selected page.

insertPage(This, Page_idx, Page, Caption)

Equivalent to insertPage(This, Page_idx, Page, Caption, []).

insertPage/5

insertPage/6 is similar to AddPage, but allows the ability to specify the insert location.

insertPage(This, Index, Page, Text, Select, ImageId)

Inserts a new page at the specified position.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

removePage(This, Page)

Removes a page, without deleting the window pointer.

setArtProvider(This, Art)

Sets the art provider to be used by the notebook.

setFont(This, Font)

Sets the font for drawing the tab labels, using a bold version of the font for selected tab labels.

setPageBitmap(This, Page, Bitmap)

Sets the bitmap for the page.

setPageText(This, Page, Text)

Sets the tab label for the page.

setSelection(This, New_page)

Sets the page selection.

setTabCtrlHeight(This, Height)

Sets the tab height.

setUniformBitmapSize(This, Size)

Ensure that all tabs have the same height, even if some of them don't have bitmaps.

Types

wxAuiNotebook()

-type wxAuiNotebook() :: wx:wx_object().

Functions

addPage(This, Page, Caption)

-spec addPage(This, Page, Caption) -> boolean()
                 when
                     This :: wxAuiNotebook(), Page :: wxWindow:wxWindow(), Caption :: unicode:chardata().

Equivalent to addPage(This, Page, Caption, []).

addPage/4

-spec addPage(This, Page, Caption, [Option]) -> boolean()
                 when
                     This :: wxAuiNotebook(),
                     Page :: wxWindow:wxWindow(),
                     Caption :: unicode:chardata(),
                     Option :: {select, boolean()} | {bitmap, wxBitmap:wxBitmap()}.

Adds a page.

If the select parameter is true, calling this will generate a page change event.

addPage(This, Page, Text, Select, ImageId)

-spec addPage(This, Page, Text, Select, ImageId) -> boolean()
                 when
                     This :: wxAuiNotebook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Select :: boolean(),
                     ImageId :: integer().

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function may generate the page changing events.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: insertPage/6

Since: 2.9.3

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxAuiNotebook(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, Winid) -> boolean()
                when This :: wxAuiNotebook(), Parent :: wxWindow:wxWindow(), Winid :: integer();
            (This, Parent, [Option]) -> boolean()
                when
                    This :: wxAuiNotebook(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates the notebook window.

create/4

-spec create(This, Parent, Winid, [Option]) -> boolean()
                when
                    This :: wxAuiNotebook(),
                    Parent :: wxWindow:wxWindow(),
                    Winid :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Constructs the book control with the given parameters.

deletePage(This, Page)

-spec deletePage(This, Page) -> boolean() when This :: wxAuiNotebook(), Page :: integer().

Deletes a page at the given index.

Calling this method will generate a page change event.

destroy(This)

-spec destroy(This :: wxAuiNotebook()) -> ok.

Destroys the object

getArtProvider(This)

-spec getArtProvider(This) -> wxAuiTabArt:wxAuiTabArt() when This :: wxAuiNotebook().

Returns the associated art provider.

getPage(This, Page_idx)

-spec getPage(This, Page_idx) -> wxWindow:wxWindow() when This :: wxAuiNotebook(), Page_idx :: integer().

Returns the page specified by the given index.

getPageBitmap(This, Page)

-spec getPageBitmap(This, Page) -> wxBitmap:wxBitmap() when This :: wxAuiNotebook(), Page :: integer().

Returns the tab bitmap for the page.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxAuiNotebook().

Returns the number of pages in the notebook.

getPageIndex(This, Page_wnd)

-spec getPageIndex(This, Page_wnd) -> integer()
                      when This :: wxAuiNotebook(), Page_wnd :: wxWindow:wxWindow().

Returns the page index for the specified window.

If the window is not found in the notebook, wxNOT_FOUND is returned.

getPageText(This, Page)

-spec getPageText(This, Page) -> unicode:charlist() when This :: wxAuiNotebook(), Page :: integer().

Returns the tab label for the page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxAuiNotebook().

Returns the currently selected page.

insertPage(This, Page_idx, Page, Caption)

-spec insertPage(This, Page_idx, Page, Caption) -> boolean()
                    when
                        This :: wxAuiNotebook(),
                        Page_idx :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Caption :: unicode:chardata().

Equivalent to insertPage(This, Page_idx, Page, Caption, []).

insertPage/5

-spec insertPage(This, Page_idx, Page, Caption, [Option]) -> boolean()
                    when
                        This :: wxAuiNotebook(),
                        Page_idx :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Caption :: unicode:chardata(),
                        Option :: {select, boolean()} | {bitmap, wxBitmap:wxBitmap()}.

insertPage/6 is similar to AddPage, but allows the ability to specify the insert location.

If the select parameter is true, calling this will generate a page change event.

insertPage(This, Index, Page, Text, Select, ImageId)

-spec insertPage(This, Index, Page, Text, Select, ImageId) -> boolean()
                    when
                        This :: wxAuiNotebook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Select :: boolean(),
                        ImageId :: integer().

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: addPage/5

Since: 2.9.3

new()

-spec new() -> wxAuiNotebook().

Default ctor.

new(Parent)

-spec new(Parent) -> wxAuiNotebook() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxAuiNotebook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

Creates a wxAuiNotebok control.

removePage(This, Page)

-spec removePage(This, Page) -> boolean() when This :: wxAuiNotebook(), Page :: integer().

Removes a page, without deleting the window pointer.

setArtProvider(This, Art)

-spec setArtProvider(This, Art) -> ok when This :: wxAuiNotebook(), Art :: wxAuiTabArt:wxAuiTabArt().

Sets the art provider to be used by the notebook.

setFont(This, Font)

-spec setFont(This, Font) -> boolean() when This :: wxAuiNotebook(), Font :: wxFont:wxFont().

Sets the font for drawing the tab labels, using a bold version of the font for selected tab labels.

setPageBitmap(This, Page, Bitmap)

-spec setPageBitmap(This, Page, Bitmap) -> boolean()
                       when This :: wxAuiNotebook(), Page :: integer(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap for the page.

To remove a bitmap from the tab caption, pass wxNullBitmap.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxAuiNotebook(), Page :: integer(), Text :: unicode:chardata().

Sets the tab label for the page.

setSelection(This, New_page)

-spec setSelection(This, New_page) -> integer() when This :: wxAuiNotebook(), New_page :: integer().

Sets the page selection.

Calling this method will generate a page change event.

setTabCtrlHeight(This, Height)

-spec setTabCtrlHeight(This, Height) -> ok when This :: wxAuiNotebook(), Height :: integer().

Sets the tab height.

By default, the tab control height is calculated by measuring the text height and bitmap sizes on the tab captions. Calling this method will override that calculation and set the tab control to the specified height parameter. A call to this method will override any call to setUniformBitmapSize/2.

Specifying -1 as the height will return the control to its default auto-sizing behaviour.

setUniformBitmapSize(This, Size)

-spec setUniformBitmapSize(This, Size) -> ok
                              when This :: wxAuiNotebook(), Size :: {W :: integer(), H :: integer()}.

Ensure that all tabs have the same height, even if some of them don't have bitmaps.

Passing ?wxDefaultSize as size undoes the effect of a previous call to this function and instructs the control to use dynamic tab height.

wxAuiNotebookEvent

This class is used by the events generated by wxAuiNotebook.

See:

wxAuiNotebook

wxBookCtrlEvent

This class is derived, and can use functions, from:

wxBookCtrlEvent

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxAuiNotebookEvent

Events

Use wxEvtHandler:connect/3 with wxAuiNotebookEventType to subscribe to events of this type.

Summary

Types

wxAuiNotebook()

wxAuiNotebookEvent()

wxAuiNotebookEventType()

Functions

getDragSource(This)

getOldSelection(This)

Returns the page that was selected before the change, wxNOT\_FOUND if none was selected.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

setDragSource(This, S)

setOldSelection(This, Page)

Sets the id of the page selected before the change.

setSelection(This, Page)

Sets the selection member variable.

Types

wxAuiNotebook()

-type wxAuiNotebook() ::
          #wxAuiNotebook{type :: wxAuiNotebookEvent:wxAuiNotebookEventType(),
                         old_selection :: integer(),
                         selection :: integer(),
                         drag_source :: wxAuiNotebook:wxAuiNotebook()}.

wxAuiNotebookEvent()

-type wxAuiNotebookEvent() :: wx:wx_object().

wxAuiNotebookEventType()

-type wxAuiNotebookEventType() ::
          command_auinotebook_page_close | command_auinotebook_page_changed |
          command_auinotebook_page_changing | command_auinotebook_button |
          command_auinotebook_begin_drag | command_auinotebook_end_drag |
          command_auinotebook_drag_motion | command_auinotebook_allow_dnd |
          command_auinotebook_tab_middle_down | command_auinotebook_tab_middle_up |
          command_auinotebook_tab_right_down | command_auinotebook_tab_right_up |
          command_auinotebook_page_closed | command_auinotebook_drag_done |
          command_auinotebook_bg_dclick.

Functions

getDragSource(This)

-spec getDragSource(This) -> wxAuiNotebook:wxAuiNotebook() when This :: wxAuiNotebookEvent().

getOldSelection(This)

-spec getOldSelection(This) -> integer() when This :: wxAuiNotebookEvent().

Returns the page that was selected before the change, wxNOT\_FOUND if none was selected.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxAuiNotebookEvent().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note: under Windows, getSelection/1 will return the same value as getOldSelection/1 when called from the EVT_BOOKCTRL_PAGE_CHANGING handler and not the page which is going to be selected.

setDragSource(This, S)

-spec setDragSource(This, S) -> ok when This :: wxAuiNotebookEvent(), S :: wxAuiNotebook:wxAuiNotebook().

setOldSelection(This, Page)

-spec setOldSelection(This, Page) -> ok when This :: wxAuiNotebookEvent(), Page :: integer().

Sets the id of the page selected before the change.

setSelection(This, Page)

-spec setSelection(This, Page) -> ok when This :: wxAuiNotebookEvent(), Page :: integer().

Sets the selection member variable.

wxAuiPaneInfo

wxAuiPaneInfo is part of the wxAUI class framework.

See also overview_aui.

wxAuiPaneInfo specifies all the parameters for a pane. These parameters specify where the pane is on the screen, whether it is docked or floating, or hidden. In addition, these parameters specify the pane's docked position, floating position, preferred size, minimum size, caption text among many other parameters.

See:

wxAuiManager

wxAuiDockArt

wxWidgets docs: wxAuiPaneInfo

Summary

Types

wxAuiPaneInfo()

Functions

bestSize(This, Size)

bestSize/3 sets the ideal size for the pane.

bestSize(This, X, Y)

bottom(This)

bottom/1 sets the pane dock position to the bottom side of the frame.

bottomDockable(This)

Equivalent to bottomDockable(This, []).

bottomDockable/2

bottomDockable/2 indicates whether a pane can be docked at the bottom of the frame.

caption(This, C)

caption/2 sets the caption of the pane.

captionVisible(This)

Equivalent to captionVisible(This, []).

captionVisible/2

CaptionVisible indicates that a pane caption should be visible.

centre(This)

Center() (not implemented in wx) sets the pane dock position to the left side of the frame.

centrePane(This)

centrePane/1 specifies that the pane should adopt the default center pane settings.

closeButton(This)

Equivalent to closeButton(This, []).

closeButton/2

closeButton/2 indicates that a close button should be drawn for the pane.

defaultPane(This)

defaultPane/1 specifies that the pane should adopt the default pane settings.

destroy(This)

Destroys the object

destroyOnClose(This)

Equivalent to destroyOnClose(This, []).

destroyOnClose/2

destroyOnClose/2 indicates whether a pane should be destroyed when it is closed.

direction(This, Direction)

direction/2 determines the direction of the docked pane.

dock(This)

dock/1 indicates that a pane should be docked.

dockable(This)

Equivalent to dockable(This, []).

dockable/2

dockable/2 specifies whether a frame can be docked or not.

fixed(This)

fixed/1 forces a pane to be fixed size so that it cannot be resized.

float(This)

float/1 indicates that a pane should be floated.

floatable(This)

Equivalent to floatable(This, []).

floatable/2

floatable/2 sets whether the user will be able to undock a pane and turn it into a floating window.

floatingPosition(This, Pos)

floatingPosition/3 sets the position of the floating pane.

floatingPosition(This, X, Y)

floatingSize(This, Size)

floatingSize/3 sets the size of the floating pane.

floatingSize(This, X, Y)

getDirection(This)

getFloatingPosition(This)

getFloatingSize(This)

getFrame(This)

getLayer(This)

getPosition(This)

getRow(This)

getWindow(This)

gripper(This)

Equivalent to gripper(This, []).

gripper/2

gripper/2 indicates that a gripper should be drawn for the pane.

gripperTop(This)

Equivalent to gripperTop(This, []).

gripperTop/2

gripperTop/2 indicates that a gripper should be drawn at the top of the pane.

hasBorder(This)

hasBorder/1 returns true if the pane displays a border.

hasCaption(This)

hasCaption/1 returns true if the pane displays a caption.

hasCloseButton(This)

hasCloseButton/1 returns true if the pane displays a button to close the pane.

hasFlag(This, Flag)

hasFlag/2 returns true if the property specified by flag is active for the pane.

hasGripper(This)

hasGripper/1 returns true if the pane displays a gripper.

hasGripperTop(This)

hasGripper/1 returns true if the pane displays a gripper at the top.

hasMaximizeButton(This)

hasMaximizeButton/1 returns true if the pane displays a button to maximize the pane.

hasMinimizeButton(This)

hasMinimizeButton/1 returns true if the pane displays a button to minimize the pane.

hasPinButton(This)

hasPinButton/1 returns true if the pane displays a button to float the pane.

hide(This)

hide/1 indicates that a pane should be hidden.

isBottomDockable(This)

isBottomDockable/1 returns true if the pane can be docked at the bottom of the managed frame.

isDocked(This)

isDocked/1 returns true if the pane is currently docked.

isFixed(This)

isFixed/1 returns true if the pane cannot be resized.

isFloatable(This)

isFloatable/1 returns true if the pane can be undocked and displayed as a floating window.

isFloating(This)

isFloating/1 returns true if the pane is floating.

isLeftDockable(This)

isLeftDockable/1 returns true if the pane can be docked on the left of the managed frame.

isMovable(This)

IsMoveable() returns true if the docked frame can be undocked or moved to another dock position.

isOk(This)

isOk/1 returns true if the wxAuiPaneInfo structure is valid.

isResizable(This)

isResizable/1 returns true if the pane can be resized.

isRightDockable(This)

isRightDockable/1 returns true if the pane can be docked on the right of the managed frame.

isShown(This)

isShown/1 returns true if the pane is currently shown.

isToolbar(This)

isToolbar/1 returns true if the pane contains a toolbar.

isTopDockable(This)

isTopDockable/1 returns true if the pane can be docked at the top of the managed frame.

layer(This, Layer)

layer/2 determines the layer of the docked pane.

left(This)

left/1 sets the pane dock position to the left side of the frame.

leftDockable(This)

Equivalent to leftDockable(This, []).

leftDockable/2

leftDockable/2 indicates whether a pane can be docked on the left of the frame.

maximizeButton(This)

Equivalent to maximizeButton(This, []).

maximizeButton/2

maximizeButton/2 indicates that a maximize button should be drawn for the pane.

maxSize(This, Size)

maxSize/3 sets the maximum size of the pane.

maxSize(This, X, Y)

minimizeButton(This)

Equivalent to minimizeButton(This, []).

minimizeButton/2

minimizeButton/2 indicates that a minimize button should be drawn for the pane.

minSize(This, Size)

minSize/3 sets the minimum size of the pane.

minSize(This, X, Y)

movable(This)

Equivalent to movable(This, []).

movable/2

Movable indicates whether a frame can be moved.

name(This, N)

name/2 sets the name of the pane so it can be referenced in lookup functions.

new()

new(C)

Copy constructor.

paneBorder(This)

Equivalent to paneBorder(This, []).

paneBorder/2

PaneBorder indicates that a border should be drawn for the pane.

pinButton(This)

Equivalent to pinButton(This, []).

pinButton/2

pinButton/2 indicates that a pin button should be drawn for the pane.

position(This, Pos)

position/2 determines the position of the docked pane.

resizable(This)

Equivalent to resizable(This, []).

resizable/2

resizable/2 allows a pane to be resized if the parameter is true, and forces it to be a fixed size if the parameter is false.

right(This)

right/1 sets the pane dock position to the right side of the frame.

rightDockable(This)

Equivalent to rightDockable(This, []).

rightDockable/2

rightDockable/2 indicates whether a pane can be docked on the right of the frame.

row(This, Row)

row/2 determines the row of the docked pane.

safeSet(This, Source)

Write the safe parts of a PaneInfo object "source" into "this".

setFlag(This, Flag, Option_state)

setFlag/3 turns the property given by flag on or off with the option_state parameter.

show(This)

Equivalent to show(This, []).

show/2

show/2 indicates that a pane should be shown.

toolbarPane(This)

toolbarPane/1 specifies that the pane should adopt the default toolbar pane settings.

top(This)

top/1 sets the pane dock position to the top of the frame.

topDockable(This)

Equivalent to topDockable(This, []).

topDockable/2

topDockable/2 indicates whether a pane can be docked at the top of the frame.

window(This, W)

window/2 assigns the window pointer that the wxAuiPaneInfo should use.

Types

wxAuiPaneInfo()

-type wxAuiPaneInfo() :: wx:wx_object().

Functions

bestSize(This, Size)

-spec bestSize(This, Size) -> wxAuiPaneInfo()
                  when This :: wxAuiPaneInfo(), Size :: {W :: integer(), H :: integer()}.

bestSize/3 sets the ideal size for the pane.

The docking manager will attempt to use this size as much as possible when docking or floating the pane.

bestSize(This, X, Y)

-spec bestSize(This, X, Y) -> wxAuiPaneInfo()
                  when This :: wxAuiPaneInfo(), X :: integer(), Y :: integer().

bottom(This)

-spec bottom(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

bottom/1 sets the pane dock position to the bottom side of the frame.

This is the same thing as calling Direction(wxAUI_DOCK_BOTTOM).

bottomDockable(This)

-spec bottomDockable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to bottomDockable(This, []).

bottomDockable/2

-spec bottomDockable(This, [Option]) -> wxAuiPaneInfo()
                        when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

bottomDockable/2 indicates whether a pane can be docked at the bottom of the frame.

caption(This, C)

-spec caption(This, C) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), C :: unicode:chardata().

caption/2 sets the caption of the pane.

captionVisible(This)

-spec captionVisible(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to captionVisible(This, []).

captionVisible/2

-spec captionVisible(This, [Option]) -> wxAuiPaneInfo()
                        when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

CaptionVisible indicates that a pane caption should be visible.

If false, no pane caption is drawn.

centre(This)

-spec centre(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Center() (not implemented in wx) sets the pane dock position to the left side of the frame.

The centre pane is the space in the middle after all border panes (left, top, right, bottom) are subtracted from the layout. This is the same thing as calling Direction(wxAUI_DOCK_CENTRE).

centrePane(This)

-spec centrePane(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

centrePane/1 specifies that the pane should adopt the default center pane settings.

Centre panes usually do not have caption bars. This function provides an easy way of preparing a pane to be displayed in the center dock position.

closeButton(This)

-spec closeButton(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to closeButton(This, []).

closeButton/2

-spec closeButton(This, [Option]) -> wxAuiPaneInfo()
                     when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

closeButton/2 indicates that a close button should be drawn for the pane.

defaultPane(This)

-spec defaultPane(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

defaultPane/1 specifies that the pane should adopt the default pane settings.

destroy(This)

-spec destroy(This :: wxAuiPaneInfo()) -> ok.

Destroys the object

destroyOnClose(This)

-spec destroyOnClose(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to destroyOnClose(This, []).

destroyOnClose/2

-spec destroyOnClose(This, [Option]) -> wxAuiPaneInfo()
                        when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

destroyOnClose/2 indicates whether a pane should be destroyed when it is closed.

Normally a pane is simply hidden when the close button is clicked. Setting DestroyOnClose to true will cause the window to be destroyed when the user clicks the pane's close button.

direction(This, Direction)

-spec direction(This, Direction) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Direction :: integer().

direction/2 determines the direction of the docked pane.

It is functionally the same as calling left/1, right/1, top/1 or bottom/1, except that docking direction may be specified programmatically via the parameter.

dock(This)

-spec dock(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

dock/1 indicates that a pane should be docked.

It is the opposite of float/1.

dockable(This)

-spec dockable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to dockable(This, []).

dockable/2

-spec dockable(This, [Option]) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

dockable/2 specifies whether a frame can be docked or not.

It is the same as specifying TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b).

fixed(This)

-spec fixed(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

fixed/1 forces a pane to be fixed size so that it cannot be resized.

After calling fixed/1, isFixed/1 will return true.

float(This)

-spec float(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

float/1 indicates that a pane should be floated.

It is the opposite of dock/1.

floatable(This)

-spec floatable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to floatable(This, []).

floatable/2

-spec floatable(This, [Option]) -> wxAuiPaneInfo()
                   when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

floatable/2 sets whether the user will be able to undock a pane and turn it into a floating window.

floatingPosition(This, Pos)

-spec floatingPosition(This, Pos) -> wxAuiPaneInfo()
                          when This :: wxAuiPaneInfo(), Pos :: {X :: integer(), Y :: integer()}.

floatingPosition/3 sets the position of the floating pane.

floatingPosition(This, X, Y)

-spec floatingPosition(This, X, Y) -> wxAuiPaneInfo()
                          when This :: wxAuiPaneInfo(), X :: integer(), Y :: integer().

floatingSize(This, Size)

-spec floatingSize(This, Size) -> wxAuiPaneInfo()
                      when This :: wxAuiPaneInfo(), Size :: {W :: integer(), H :: integer()}.

floatingSize/3 sets the size of the floating pane.

floatingSize(This, X, Y)

-spec floatingSize(This, X, Y) -> wxAuiPaneInfo()
                      when This :: wxAuiPaneInfo(), X :: integer(), Y :: integer().

getDirection(This)

-spec getDirection(This) -> integer() when This :: wxAuiPaneInfo().

getFloatingPosition(This)

-spec getFloatingPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxAuiPaneInfo().

getFloatingSize(This)

-spec getFloatingSize(This) -> {W :: integer(), H :: integer()} when This :: wxAuiPaneInfo().

getFrame(This)

-spec getFrame(This) -> wxFrame:wxFrame() when This :: wxAuiPaneInfo().

getLayer(This)

-spec getLayer(This) -> integer() when This :: wxAuiPaneInfo().

getPosition(This)

-spec getPosition(This) -> integer() when This :: wxAuiPaneInfo().

getRow(This)

-spec getRow(This) -> integer() when This :: wxAuiPaneInfo().

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxAuiPaneInfo().

gripper(This)

-spec gripper(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to gripper(This, []).

gripper/2

-spec gripper(This, [Option]) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

gripper/2 indicates that a gripper should be drawn for the pane.

gripperTop(This)

-spec gripperTop(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to gripperTop(This, []).

gripperTop/2

-spec gripperTop(This, [Option]) -> wxAuiPaneInfo()
                    when This :: wxAuiPaneInfo(), Option :: {attop, boolean()}.

gripperTop/2 indicates that a gripper should be drawn at the top of the pane.

hasBorder(This)

-spec hasBorder(This) -> boolean() when This :: wxAuiPaneInfo().

hasBorder/1 returns true if the pane displays a border.

hasCaption(This)

-spec hasCaption(This) -> boolean() when This :: wxAuiPaneInfo().

hasCaption/1 returns true if the pane displays a caption.

hasCloseButton(This)

-spec hasCloseButton(This) -> boolean() when This :: wxAuiPaneInfo().

hasCloseButton/1 returns true if the pane displays a button to close the pane.

hasFlag(This, Flag)

-spec hasFlag(This, Flag) -> boolean() when This :: wxAuiPaneInfo(), Flag :: integer().

hasFlag/2 returns true if the property specified by flag is active for the pane.

hasGripper(This)

-spec hasGripper(This) -> boolean() when This :: wxAuiPaneInfo().

hasGripper/1 returns true if the pane displays a gripper.

hasGripperTop(This)

-spec hasGripperTop(This) -> boolean() when This :: wxAuiPaneInfo().

hasGripper/1 returns true if the pane displays a gripper at the top.

hasMaximizeButton(This)

-spec hasMaximizeButton(This) -> boolean() when This :: wxAuiPaneInfo().

hasMaximizeButton/1 returns true if the pane displays a button to maximize the pane.

hasMinimizeButton(This)

-spec hasMinimizeButton(This) -> boolean() when This :: wxAuiPaneInfo().

hasMinimizeButton/1 returns true if the pane displays a button to minimize the pane.

hasPinButton(This)

-spec hasPinButton(This) -> boolean() when This :: wxAuiPaneInfo().

hasPinButton/1 returns true if the pane displays a button to float the pane.

hide(This)

-spec hide(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

hide/1 indicates that a pane should be hidden.

isBottomDockable(This)

-spec isBottomDockable(This) -> boolean() when This :: wxAuiPaneInfo().

isBottomDockable/1 returns true if the pane can be docked at the bottom of the managed frame.

isDocked(This)

-spec isDocked(This) -> boolean() when This :: wxAuiPaneInfo().

isDocked/1 returns true if the pane is currently docked.

isFixed(This)

-spec isFixed(This) -> boolean() when This :: wxAuiPaneInfo().

isFixed/1 returns true if the pane cannot be resized.

isFloatable(This)

-spec isFloatable(This) -> boolean() when This :: wxAuiPaneInfo().

isFloatable/1 returns true if the pane can be undocked and displayed as a floating window.

isFloating(This)

-spec isFloating(This) -> boolean() when This :: wxAuiPaneInfo().

isFloating/1 returns true if the pane is floating.

isLeftDockable(This)

-spec isLeftDockable(This) -> boolean() when This :: wxAuiPaneInfo().

isLeftDockable/1 returns true if the pane can be docked on the left of the managed frame.

isMovable(This)

-spec isMovable(This) -> boolean() when This :: wxAuiPaneInfo().

IsMoveable() returns true if the docked frame can be undocked or moved to another dock position.

isOk(This)

-spec isOk(This) -> boolean() when This :: wxAuiPaneInfo().

isOk/1 returns true if the wxAuiPaneInfo structure is valid.

A pane structure is valid if it has an associated window.

isResizable(This)

-spec isResizable(This) -> boolean() when This :: wxAuiPaneInfo().

isResizable/1 returns true if the pane can be resized.

isRightDockable(This)

-spec isRightDockable(This) -> boolean() when This :: wxAuiPaneInfo().

isRightDockable/1 returns true if the pane can be docked on the right of the managed frame.

isShown(This)

-spec isShown(This) -> boolean() when This :: wxAuiPaneInfo().

isShown/1 returns true if the pane is currently shown.

isToolbar(This)

-spec isToolbar(This) -> boolean() when This :: wxAuiPaneInfo().

isToolbar/1 returns true if the pane contains a toolbar.

isTopDockable(This)

-spec isTopDockable(This) -> boolean() when This :: wxAuiPaneInfo().

isTopDockable/1 returns true if the pane can be docked at the top of the managed frame.

layer(This, Layer)

-spec layer(This, Layer) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Layer :: integer().

layer/2 determines the layer of the docked pane.

The dock layer is similar to an onion, the inner-most layer being layer 0. Each shell moving in the outward direction has a higher layer number. This allows for more complex docking layout formation.

left(This)

-spec left(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

left/1 sets the pane dock position to the left side of the frame.

This is the same thing as calling Direction(wxAUI_DOCK_LEFT).

leftDockable(This)

-spec leftDockable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to leftDockable(This, []).

leftDockable/2

-spec leftDockable(This, [Option]) -> wxAuiPaneInfo()
                      when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

leftDockable/2 indicates whether a pane can be docked on the left of the frame.

maximizeButton(This)

-spec maximizeButton(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to maximizeButton(This, []).

maximizeButton/2

-spec maximizeButton(This, [Option]) -> wxAuiPaneInfo()
                        when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

maximizeButton/2 indicates that a maximize button should be drawn for the pane.

maxSize(This, Size)

-spec maxSize(This, Size) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), Size :: {W :: integer(), H :: integer()}.

maxSize/3 sets the maximum size of the pane.

maxSize(This, X, Y)

-spec maxSize(This, X, Y) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), X :: integer(), Y :: integer().

minimizeButton(This)

-spec minimizeButton(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to minimizeButton(This, []).

minimizeButton/2

-spec minimizeButton(This, [Option]) -> wxAuiPaneInfo()
                        when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

minimizeButton/2 indicates that a minimize button should be drawn for the pane.

minSize(This, Size)

-spec minSize(This, Size) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), Size :: {W :: integer(), H :: integer()}.

minSize/3 sets the minimum size of the pane.

Please note that this is only partially supported as of this writing.

minSize(This, X, Y)

-spec minSize(This, X, Y) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), X :: integer(), Y :: integer().

movable(This)

-spec movable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to movable(This, []).

movable/2

-spec movable(This, [Option]) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

Movable indicates whether a frame can be moved.

name(This, N)

-spec name(This, N) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), N :: unicode:chardata().

name/2 sets the name of the pane so it can be referenced in lookup functions.

If a name is not specified by the user, a random name is assigned to the pane when it is added to the manager.

new()

-spec new() -> wxAuiPaneInfo().

new(C)

-spec new(C) -> wxAuiPaneInfo() when C :: wxAuiPaneInfo().

Copy constructor.

paneBorder(This)

-spec paneBorder(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to paneBorder(This, []).

paneBorder/2

-spec paneBorder(This, [Option]) -> wxAuiPaneInfo()
                    when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

PaneBorder indicates that a border should be drawn for the pane.

pinButton(This)

-spec pinButton(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to pinButton(This, []).

pinButton/2

-spec pinButton(This, [Option]) -> wxAuiPaneInfo()
                   when This :: wxAuiPaneInfo(), Option :: {visible, boolean()}.

pinButton/2 indicates that a pin button should be drawn for the pane.

position(This, Pos)

-spec position(This, Pos) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Pos :: integer().

position/2 determines the position of the docked pane.

resizable(This)

-spec resizable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to resizable(This, []).

resizable/2

-spec resizable(This, [Option]) -> wxAuiPaneInfo()
                   when This :: wxAuiPaneInfo(), Option :: {resizable, boolean()}.

resizable/2 allows a pane to be resized if the parameter is true, and forces it to be a fixed size if the parameter is false.

This is simply an antonym for fixed/1.

right(This)

-spec right(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

right/1 sets the pane dock position to the right side of the frame.

This is the same thing as calling Direction(wxAUI_DOCK_RIGHT).

rightDockable(This)

-spec rightDockable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to rightDockable(This, []).

rightDockable/2

-spec rightDockable(This, [Option]) -> wxAuiPaneInfo()
                       when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

rightDockable/2 indicates whether a pane can be docked on the right of the frame.

row(This, Row)

-spec row(This, Row) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Row :: integer().

row/2 determines the row of the docked pane.

safeSet(This, Source)

-spec safeSet(This, Source) -> ok when This :: wxAuiPaneInfo(), Source :: wxAuiPaneInfo().

Write the safe parts of a PaneInfo object "source" into "this".

"Safe parts" are all non-UI elements (e.g. all layout determining parameters like the size, position etc.). "Unsafe parts" (pointers to button, frame and window) are not modified by this write operation.

Remark: This method is used when loading perspectives.

setFlag(This, Flag, Option_state)

-spec setFlag(This, Flag, Option_state) -> wxAuiPaneInfo()
                 when This :: wxAuiPaneInfo(), Flag :: integer(), Option_state :: boolean().

setFlag/3 turns the property given by flag on or off with the option_state parameter.

show(This)

-spec show(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to show(This, []).

show/2

-spec show(This, [Option]) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), Option :: {show, boolean()}.

show/2 indicates that a pane should be shown.

toolbarPane(This)

-spec toolbarPane(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

toolbarPane/1 specifies that the pane should adopt the default toolbar pane settings.

top(This)

-spec top(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

top/1 sets the pane dock position to the top of the frame.

This is the same thing as calling Direction(wxAUI_DOCK_TOP).

topDockable(This)

-spec topDockable(This) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo().

Equivalent to topDockable(This, []).

topDockable/2

-spec topDockable(This, [Option]) -> wxAuiPaneInfo()
                     when This :: wxAuiPaneInfo(), Option :: {b, boolean()}.

topDockable/2 indicates whether a pane can be docked at the top of the frame.

window(This, W)

-spec window(This, W) -> wxAuiPaneInfo() when This :: wxAuiPaneInfo(), W :: wxWindow:wxWindow().

window/2 assigns the window pointer that the wxAuiPaneInfo should use.

This normally does not need to be specified, as the window pointer is automatically assigned to the wxAuiPaneInfo structure as soon as it is added to the manager.

wxAuiSimpleTabArt

Another standard tab art provider for wxAuiNotebook.

wxAuiSimpleTabArt is derived from wxAuiTabArt demonstrating how to write a completely new tab art class. It can also be used as alternative to wxAuiDefaultTabArt (not implemented in wx).

This class is derived, and can use functions, from:

wxAuiTabArt

wxWidgets docs: wxAuiSimpleTabArt

Summary

Types

wxAuiSimpleTabArt()

Functions

destroy(This)

Destroys the object

new()

Types

wxAuiSimpleTabArt()

-type wxAuiSimpleTabArt() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxAuiSimpleTabArt()) -> ok.

Destroys the object

new()

-spec new() -> wxAuiSimpleTabArt().

wxAuiTabArt

Tab art provider defines all the drawing functions used by wxAuiNotebook.

This allows the wxAuiNotebook to have a pluggable look-and-feel.

By default, a wxAuiNotebook uses an instance of this class called wxAuiDefaultTabArt (not implemented in wx) which provides bitmap art and a colour scheme that is adapted to the major platforms' look. You can either derive from that class to alter its behaviour or write a completely new tab art class.

Another example of creating a new wxAuiNotebook tab bar is wxAuiSimpleTabArt.

Call wxAuiNotebook:setArtProvider/2 to make use of this new tab art.

wxWidgets docs: wxAuiTabArt

Summary

Types

wxAuiTabArt()

Functions

setActiveColour(This, Colour)

Sets the colour of the selected tab.

setColour(This, Colour)

Sets the colour of the inactive tabs.

setFlags(This, Flags)

Sets flags.

setMeasuringFont(This, Font)

Sets the font used for calculating measurements.

setNormalFont(This, Font)

Sets the normal font for drawing labels.

setSelectedFont(This, Font)

Sets the font for drawing text for selected UI elements.

Types

wxAuiTabArt()

-type wxAuiTabArt() :: wx:wx_object().

Functions

setActiveColour(This, Colour)

-spec setActiveColour(This, Colour) -> ok when This :: wxAuiTabArt(), Colour :: wx:wx_colour().

Sets the colour of the selected tab.

Since: 2.9.2

setColour(This, Colour)

-spec setColour(This, Colour) -> ok when This :: wxAuiTabArt(), Colour :: wx:wx_colour().

Sets the colour of the inactive tabs.

Since: 2.9.2

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxAuiTabArt(), Flags :: integer().

Sets flags.

setMeasuringFont(This, Font)

-spec setMeasuringFont(This, Font) -> ok when This :: wxAuiTabArt(), Font :: wxFont:wxFont().

Sets the font used for calculating measurements.

setNormalFont(This, Font)

-spec setNormalFont(This, Font) -> ok when This :: wxAuiTabArt(), Font :: wxFont:wxFont().

Sets the normal font for drawing labels.

setSelectedFont(This, Font)

-spec setSelectedFont(This, Font) -> ok when This :: wxAuiTabArt(), Font :: wxFont:wxFont().

Sets the font for drawing text for selected UI elements.

wxBitmap

This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or colour with alpha channel support.

If you need direct access the bitmap data instead going through drawing to it using wxMemoryDC you need to use the wxPixelData (not implemented in wx) class (either wxNativePixelData for RGB bitmaps or wxAlphaPixelData for bitmaps with an additionally alpha channel).

Note that many wxBitmap functions take a type parameter, which is a value of the ?wxBitmapType enumeration. The validity of those values depends however on the platform where your program is running and from the wxWidgets configuration. If all possible wxWidgets settings are used:

wxMSW supports BMP and ICO files, BMP and ICO resources;

wxGTK supports any file supported by gdk-pixbuf;

wxMac supports PICT resources;

wxX11 supports XPM files, XPM data, XBM data;

In addition, wxBitmap can load and save all formats that wxImage can; see wxImage for more info. Of course, you must have loaded the wxImage handlers (see ?wxInitAllImageHandlers() and wxImage::AddHandler (not implemented in wx)). Note that all available wxBitmapHandlers for a given wxWidgets port are automatically loaded at startup so you won't need to use wxBitmap::AddHandler (not implemented in wx).

More on the difference between wxImage and wxBitmap: wxImage is just a buffer of RGB bytes with an optional buffer for the alpha bytes. It is all generic, platform independent and image file format independent code. It includes generic code for scaling, resizing, clipping, and other manipulations of the image data. OTOH, wxBitmap is intended to be a wrapper of whatever is the native image format that is quickest/easiest to draw to a DC or to be the target of the drawing operations performed on a wxMemoryDC. By splitting the responsibilities between wxImage/wxBitmap like this then it's easier to use generic code shared by all platforms and image types for generic operations and platform specific code where performance or compatibility is needed.

Predefined objects (include wx.hrl): ?wxNullBitmap

See:

Overview bitmap

Overview bitmap

wxDC:blit/6

wxIcon

wxCursor

wxMemoryDC

wxImage

wxWidgets docs: wxBitmap

Summary

Types

wxBitmap()

Functions

convertToImage(This)

Creates an image from a platform-dependent bitmap.

copyFromIcon(This, Icon)

Creates the bitmap from an icon.

create(This, Sz)

Equivalent to create(This, Sz, []).

create/3

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create/4

Create a bitmap compatible with the given DC, inheriting its magnification factor.

destroy(This)

Destroys the object

getDepth(This)

Gets the colour depth of the bitmap.

getHeight(This)

Gets the height of the bitmap in pixels.

getMask(This)

Gets the associated mask (if any) which may have been loaded from a file or set for the bitmap.

getPalette(This)

Gets the associated palette (if any) which may have been loaded from a file or set for the bitmap.

getSubBitmap(This, Rect)

Returns a sub bitmap of the current one as long as the rect belongs entirely to the bitmap.

getWidth(This)

Gets the width of the bitmap in pixels.

isOk(This)

Returns true if bitmap data is present.

loadFile(This, Name)

Equivalent to loadFile(This, Name, []).

loadFile/3

Loads a bitmap from a file or resource.

new()

Default constructor.

new/1

new/2

Creates this bitmap object from the given image.

new/3

Creates a new bitmap.

new(Bits, Width, Height, Options)

Creates a bitmap from the given array bits.

ok(This)

Equivalent to: isOk/1

saveFile(This, Name, Type)

Equivalent to saveFile(This, Name, Type, []).

saveFile/4

Saves a bitmap in the named file.

setDepth(This, Depth)

Deprecated

setHeight(This, Height)

Deprecated

setMask(This, Mask)

Sets the mask for this bitmap.

setPalette(This, Palette)

Sets the associated palette.

setWidth(This, Width)

Deprecated

Types

wxBitmap()

-type wxBitmap() :: wx:wx_object().

Functions

convertToImage(This)

-spec convertToImage(This) -> wxImage:wxImage() when This :: wxBitmap().

Creates an image from a platform-dependent bitmap.

This preserves mask information so that bitmaps and images can be converted back and forth without loss in that respect.

copyFromIcon(This, Icon)

-spec copyFromIcon(This, Icon) -> boolean() when This :: wxBitmap(), Icon :: wxIcon:wxIcon().

Creates the bitmap from an icon.

create(This, Sz)

-spec create(This, Sz) -> boolean() when This :: wxBitmap(), Sz :: {W :: integer(), H :: integer()}.

Equivalent to create(This, Sz, []).

create/3

-spec create(This, Width, Height) -> boolean()
                when This :: wxBitmap(), Width :: integer(), Height :: integer();
            (This, Sz, [Option]) -> boolean()
                when
                    This :: wxBitmap(),
                    Sz :: {W :: integer(), H :: integer()},
                    Option :: {depth, integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create/4

-spec create(This, Width, Height, [Option]) -> boolean()
                when
                    This :: wxBitmap(),
                    Width :: integer(),
                    Height :: integer(),
                    Option :: {depth, integer()};
            (This, Width, Height, Dc) -> boolean()
                when This :: wxBitmap(), Width :: integer(), Height :: integer(), Dc :: wxDC:wxDC().

Create a bitmap compatible with the given DC, inheriting its magnification factor.

Return: true if the creation was successful.

Since: 3.1.0

destroy(This)

-spec destroy(This :: wxBitmap()) -> ok.

Destroys the object

getDepth(This)

-spec getDepth(This) -> integer() when This :: wxBitmap().

Gets the colour depth of the bitmap.

A value of 1 indicates a monochrome bitmap.

getHeight(This)

-spec getHeight(This) -> integer() when This :: wxBitmap().

Gets the height of the bitmap in pixels.

See: getWidth/1

getMask(This)

-spec getMask(This) -> wxMask:wxMask() when This :: wxBitmap().

Gets the associated mask (if any) which may have been loaded from a file or set for the bitmap.

See:

setMask/2

wxMask

getPalette(This)

-spec getPalette(This) -> wxPalette:wxPalette() when This :: wxBitmap().

Gets the associated palette (if any) which may have been loaded from a file or set for the bitmap.

See: wxPalette

getSubBitmap(This, Rect)

-spec getSubBitmap(This, Rect) -> wxBitmap()
                      when
                          This :: wxBitmap(),
                          Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Returns a sub bitmap of the current one as long as the rect belongs entirely to the bitmap.

This function preserves bit depth and mask information.

getWidth(This)

-spec getWidth(This) -> integer() when This :: wxBitmap().

Gets the width of the bitmap in pixels.

See: getHeight/1

isOk(This)

-spec isOk(This) -> boolean() when This :: wxBitmap().

Returns true if bitmap data is present.

loadFile(This, Name)

-spec loadFile(This, Name) -> boolean() when This :: wxBitmap(), Name :: unicode:chardata().

Equivalent to loadFile(This, Name, []).

loadFile/3

-spec loadFile(This, Name, [Option]) -> boolean()
                  when This :: wxBitmap(), Name :: unicode:chardata(), Option :: {type, wx:wx_enum()}.

Loads a bitmap from a file or resource.

Return: true if the operation succeeded, false otherwise.

Remark: A palette may be associated with the bitmap if one exists (especially for colour Windows bitmaps), and if the code supports it. You can check if one has been created by using the getPalette/1 member.

See: saveFile/4

new()

-spec new() -> wxBitmap().

Default constructor.

Constructs a bitmap object with no data; an assignment or another member function such as create/4 or loadFile/3 must be called subsequently.

new/1

-spec new(Name) -> wxBitmap() when Name :: unicode:chardata();
         (Sz) -> wxBitmap() when Sz :: {W :: integer(), H :: integer()};
         (Img) -> wxBitmap() when Img :: wxImage:wxImage() | wxBitmap:wxBitmap().

new/2

-spec new(Width, Height) -> wxBitmap() when Width :: integer(), Height :: integer();
         (Name, [Option]) -> wxBitmap() when Name :: unicode:chardata(), Option :: {type, wx:wx_enum()};
         (Sz, [Option]) -> wxBitmap()
             when Sz :: {W :: integer(), H :: integer()}, Option :: {depth, integer()};
         (Img, [Option]) -> wxBitmap() when Img :: wxImage:wxImage(), Option :: {depth, integer()}.

Creates this bitmap object from the given image.

This has to be done to actually display an image as you cannot draw an image directly on a window.

The resulting bitmap will use the provided colour depth (or that of the current system if depth is ?wxBITMAP_SCREEN_DEPTH) which entails that a colour reduction may take place.

On Windows, if there is a palette present (set with SetPalette), it will be used when creating the wxBitmap (most useful in 8-bit display mode). On other platforms, the palette is currently ignored.

new/3

-spec new(Bits, Width, Height) -> wxBitmap()
             when Bits :: binary(), Width :: integer(), Height :: integer();
         (Width, Height, [Option]) -> wxBitmap()
             when Width :: integer(), Height :: integer(), Option :: {depth, integer()}.

Creates a new bitmap.

A depth of ?wxBITMAP_SCREEN_DEPTH indicates the depth of the current screen or visual.

Some platforms only support 1 for monochrome and ?wxBITMAP_SCREEN_DEPTH for the current colour setting.

A depth of 32 including an alpha channel is supported under MSW, Mac and GTK+.

new(Bits, Width, Height, Options)

-spec new(Bits, Width, Height, [Option]) -> wxBitmap()
             when
                 Bits :: binary(), Width :: integer(), Height :: integer(), Option :: {depth, integer()}.

Creates a bitmap from the given array bits.

You should only use this function for monochrome bitmaps (depth 1) in portable programs: in this case the bits parameter should contain an XBM image.

For other bit depths, the behaviour is platform dependent: under Windows, the data is passed without any changes to the underlying CreateBitmap() API. Under other platforms, only monochrome bitmaps may be created using this constructor and wxImage should be used for creating colour bitmaps from static data.

ok(This)

-spec ok(This) -> boolean() when This :: wxBitmap().

Equivalent to: isOk/1

saveFile(This, Name, Type)

-spec saveFile(This, Name, Type) -> boolean()
                  when This :: wxBitmap(), Name :: unicode:chardata(), Type :: wx:wx_enum().

Equivalent to saveFile(This, Name, Type, []).

saveFile/4

-spec saveFile(This, Name, Type, [Option]) -> boolean()
                  when
                      This :: wxBitmap(),
                      Name :: unicode:chardata(),
                      Type :: wx:wx_enum(),
                      Option :: {palette, wxPalette:wxPalette()}.

Saves a bitmap in the named file.

Return: true if the operation succeeded, false otherwise.

Remark: Depending on how wxWidgets has been configured, not all formats may be available.

See: loadFile/3

setDepth(This, Depth)

-spec setDepth(This, Depth) -> ok when This :: wxBitmap(), Depth :: integer().

Deprecated:

This function is deprecated since version 3.1.2, dimensions and depth can only be set at construction time.

Sets the depth member (does not affect the bitmap data).

setHeight(This, Height)

-spec setHeight(This, Height) -> ok when This :: wxBitmap(), Height :: integer().

Deprecated:

This function is deprecated since version 3.1.2, dimensions and depth can only be set at construction time.

Sets the height member (does not affect the bitmap data).

setMask(This, Mask)

-spec setMask(This, Mask) -> ok when This :: wxBitmap(), Mask :: wxMask:wxMask().

Sets the mask for this bitmap.

Remark: The bitmap object owns the mask once this has been called.

Note: A mask can be set also for bitmap with an alpha channel but doing so under wxMSW is not recommended because performance of drawing such bitmap is not very good.

See:

getMask/1

wxMask

setPalette(This, Palette)

-spec setPalette(This, Palette) -> ok when This :: wxBitmap(), Palette :: wxPalette:wxPalette().

Sets the associated palette.

(Not implemented under GTK+).

See: wxPalette

setWidth(This, Width)

-spec setWidth(This, Width) -> ok when This :: wxBitmap(), Width :: integer().

Deprecated:

This function is deprecated since version 3.1.2, dimensions and depth can only be set at construction time.

Sets the width member (does not affect the bitmap data).

wxBitmapButton

A bitmap button is a control that contains a bitmap.

Notice that since wxWidgets 2.9.1 bitmap display is supported by the base wxButton class itself and the only tiny advantage of using this class is that it allows specifying the bitmap in its constructor, unlike wxButton. Please see the base class documentation for more information about images support in wxButton.

Styles

This class supports the following styles:

wxBU_LEFT: Left-justifies the bitmap label.

wxBU_TOP: Aligns the bitmap label to the top of the button.

wxBU_RIGHT: Right-justifies the bitmap label.

wxBU_BOTTOM: Aligns the bitmap label to the bottom of the button. Note that the wxBU_EXACTFIT style supported by wxButton is not used by this class as bitmap buttons don't have any minimal standard size by default.

See: wxButton

This class is derived, and can use functions, from:

wxButton

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxBitmapButton

Events

Event types emitted from this class:

command_button_clicked

Summary

Types

wxBitmapButton()

Functions

create(This, Parent, Id, Bitmap)

Equivalent to create(This, Parent, Id, Bitmap, []).

create/5

Button creation function for two-step creation.

destroy(This)

Destroys the object

new()

Default ctor.

new(Parent, Id, Bitmap)

Equivalent to new(Parent, Id, Bitmap, []).

new/4

Constructor, creating and showing a button.

newCloseButton(Parent, Winid)

Helper function creating a standard-looking "Close" button.

Types

wxBitmapButton()

-type wxBitmapButton() :: wx:wx_object().

Functions

create(This, Parent, Id, Bitmap)

-spec create(This, Parent, Id, Bitmap) -> boolean()
                when
                    This :: wxBitmapButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Bitmap :: wxBitmap:wxBitmap().

Equivalent to create(This, Parent, Id, Bitmap, []).

create/5

-spec create(This, Parent, Id, Bitmap, [Option]) -> boolean()
                when
                    This :: wxBitmapButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Bitmap :: wxBitmap:wxBitmap(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Button creation function for two-step creation.

For more details, see new/4.

destroy(This)

-spec destroy(This :: wxBitmapButton()) -> ok.

Destroys the object

new()

-spec new() -> wxBitmapButton().

Default ctor.

new(Parent, Id, Bitmap)

-spec new(Parent, Id, Bitmap) -> wxBitmapButton()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Bitmap :: wxBitmap:wxBitmap().

Equivalent to new(Parent, Id, Bitmap, []).

new/4

-spec new(Parent, Id, Bitmap, [Option]) -> wxBitmapButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Bitmap :: wxBitmap:wxBitmap(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a button.

Remark: The bitmap parameter is normally the only bitmap you need to provide, and wxWidgets will draw the button correctly in its different states. If you want more control, call any of the functions SetBitmapPressed() (not implemented in wx), wxButton:setBitmapFocus/2, wxButton:setBitmapDisabled/2.

See: create/5

newCloseButton(Parent, Winid)

-spec newCloseButton(Parent, Winid) -> wxBitmapButton()
                        when Parent :: wxWindow:wxWindow(), Winid :: integer().

Helper function creating a standard-looking "Close" button.

To get the best results, platform-specific code may need to be used to create a small, title bar-like "Close" button. This function is provided to avoid the need to test for the current platform and creates the button with as native look as possible.

Return: The new button.

Since: 2.9.5

wxBitmapDataObject

wxBitmapDataObject is a specialization of wxDataObject for bitmap data.

It can be used without change to paste data into the wxClipboard or a wxDropSource (not implemented in wx). A user may wish to derive a new class from this class for providing a bitmap on-demand in order to minimize memory consumption when offering data in several formats, such as a bitmap and GIF.

This class may be used as is, but getBitmap/1 may be overridden to increase efficiency.

See:

Overview dnd

wxDataObject

wxFileDataObject

wxTextDataObject

wxDataObject

This class is derived, and can use functions, from:

wxDataObject

wxWidgets docs: wxBitmapDataObject

Summary

Types

wxBitmapDataObject()

Functions

destroy(This)

Destroys the object

getBitmap(This)

Returns the bitmap associated with the data object.

new()

Equivalent to new([]).

new/1

Constructor, optionally passing a bitmap (otherwise use setBitmap/2 later).

setBitmap(This, Bitmap)

Sets the bitmap associated with the data object.

Types

wxBitmapDataObject()

-type wxBitmapDataObject() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxBitmapDataObject()) -> ok.

Destroys the object

getBitmap(This)

-spec getBitmap(This) -> wxBitmap:wxBitmap() when This :: wxBitmapDataObject().

Returns the bitmap associated with the data object.

You may wish to override this method when offering data on-demand, but this is not required by wxWidgets' internals. Use this method to get data in bitmap form from the wxClipboard.

new()

-spec new() -> wxBitmapDataObject().

Equivalent to new([]).

new/1

-spec new([Option]) -> wxBitmapDataObject() when Option :: {bitmap, wxBitmap:wxBitmap()};
         (Bitmap) -> wxBitmapDataObject() when Bitmap :: wxBitmap:wxBitmap().

Constructor, optionally passing a bitmap (otherwise use setBitmap/2 later).

setBitmap(This, Bitmap)

-spec setBitmap(This, Bitmap) -> ok when This :: wxBitmapDataObject(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap associated with the data object.

This method is called when the data object receives data. Usually there will be no reason to override this function.

wxBookCtrlBase

A book control is a convenient way of displaying multiple pages of information, displayed one page at a time.

wxWidgets has five variants of this control:

wxChoicebook: controlled by a wxChoice

wxListbook: controlled by a wxListCtrl

wxNotebook: uses a row of tabs

wxTreebook: controlled by a wxTreeCtrl

wxToolbook: controlled by a wxToolBar

This abstract class is the parent of all these book controls, and provides their basic interface. This is a pure virtual class so you cannot allocate it directly.

See: Overview bookctrl

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxBookCtrlBase

Summary

Types

wxBookCtrlBase()

Functions

addPage(This, Page, Text)

Equivalent to addPage(This, Page, Text, []).

addPage/4

Adds a new page.

advanceSelection(This)

Equivalent to advanceSelection(This, []).

advanceSelection/2

Cycles through the tabs.

changeSelection(This, Page)

Changes the selection to the given page, returning the previous selection.

deleteAllPages(This)

Deletes all pages.

deletePage(This, Page)

Deletes the specified page, and the associated window.

getCurrentPage(This)

Returns the currently selected page or NULL.

getPage(This, Page)

Returns the window at the given page position.

getPageCount(This)

Returns the number of pages in the control.

getPageText(This, NPage)

Returns the string for the given page.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

hitTest(This, Pt)

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

insertPage(This, Index, Page, Text)

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

Inserts a new page at the specified position.

removePage(This, Page)

Deletes the specified page, without deleting the associated window.

setPageText(This, Page, Text)

Sets the text for the given page.

setSelection(This, Page)

Sets the selection to the given page, returning the previous selection.

Types

wxBookCtrlBase()

-type wxBookCtrlBase() :: wx:wx_object().

Functions

addPage(This, Page, Text)

-spec addPage(This, Page, Text) -> boolean()
                 when This :: wxBookCtrlBase(), Page :: wxWindow:wxWindow(), Text :: unicode:chardata().

Equivalent to addPage(This, Page, Text, []).

addPage/4

-spec addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxBookCtrlBase(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option :: {bSelect, boolean()} | {imageId, integer()}.

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function will generate the page changing and page changed events if select is true, but not when inserting the very first page (as there is no previous page selection to switch from in this case and so it wouldn't make sense to e.g. veto such event).

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: insertPage/5

advanceSelection(This)

-spec advanceSelection(This) -> ok when This :: wxBookCtrlBase().

Equivalent to advanceSelection(This, []).

advanceSelection/2

-spec advanceSelection(This, [Option]) -> ok
                          when This :: wxBookCtrlBase(), Option :: {forward, boolean()}.

Cycles through the tabs.

The call to this function generates the page changing events.

changeSelection(This, Page)

-spec changeSelection(This, Page) -> integer() when This :: wxBookCtrlBase(), Page :: integer().

Changes the selection to the given page, returning the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events.

See overview_events_prog for more information.

deleteAllPages(This)

-spec deleteAllPages(This) -> boolean() when This :: wxBookCtrlBase().

Deletes all pages.

deletePage(This, Page)

-spec deletePage(This, Page) -> boolean() when This :: wxBookCtrlBase(), Page :: integer().

Deletes the specified page, and the associated window.

The call to this function generates the page changing events when deleting the currently selected page or a page preceding it in the index order, but it does not send any events when deleting the last page: while in this case the selection also changes, it becomes invalid and for compatibility reasons the control never generates events with the invalid selection index.

getCurrentPage(This)

-spec getCurrentPage(This) -> wxWindow:wxWindow() when This :: wxBookCtrlBase().

Returns the currently selected page or NULL.

getPage(This, Page)

-spec getPage(This, Page) -> wxWindow:wxWindow() when This :: wxBookCtrlBase(), Page :: integer().

Returns the window at the given page position.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxBookCtrlBase().

Returns the number of pages in the control.

getPageText(This, NPage)

-spec getPageText(This, NPage) -> unicode:charlist() when This :: wxBookCtrlBase(), NPage :: integer().

Returns the string for the given page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxBookCtrlBase().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent:getSelection/1 should be used instead in this case.

hitTest(This, Pt)

-spec hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxBookCtrlBase(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage(This, Index, Page, Text)

-spec insertPage(This, Index, Page, Text) -> boolean()
                    when
                        This :: wxBookCtrlBase(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata().

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

-spec insertPage(This, Index, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxBookCtrlBase(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: addPage/4

removePage(This, Page)

-spec removePage(This, Page) -> boolean() when This :: wxBookCtrlBase(), Page :: integer().

Deletes the specified page, without deleting the associated window.

See deletePage/2 for a note about the events generated by this function.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxBookCtrlBase(), Page :: integer(), Text :: unicode:chardata().

Sets the text for the given page.

setSelection(This, Page)

-spec setSelection(This, Page) -> integer() when This :: wxBookCtrlBase(), Page :: integer().

Sets the selection to the given page, returning the previous selection.

Notice that the call to this function generates the page changing events, use the changeSelection/2 function if you don't want these events to be generated.

See: getSelection/1

wxBookCtrlEvent

This class represents the events generated by book controls (wxNotebook, wxListbook, wxChoicebook, wxTreebook, wxAuiNotebook).

The PAGE_CHANGING events are sent before the current page is changed. It allows the program to examine the current page (which can be retrieved with getOldSelection/1) and to veto the page change by calling wxNotifyEvent:veto/1 if, for example, the current values in the controls of the old page are invalid.

The PAGE_CHANGED events are sent after the page has been changed and the program cannot veto it any more, it just informs it about the page change.

To summarize, if the program is interested in validating the page values before allowing the user to change it, it should process the PAGE_CHANGING event, otherwise PAGE_CHANGED is probably enough. In any case, it is probably unnecessary to process both events at once.

See:

wxNotebook

wxListbook

wxChoicebook

wxTreebook

wxToolbook

wxAuiNotebook

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxBookCtrlEvent

Summary

Types

wxBookCtrl()

wxBookCtrlEvent()

wxBookCtrlEventType()

Functions

getOldSelection(This)

Returns the page that was selected before the change, wxNOT\_FOUND if none was selected.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

setOldSelection(This, Page)

Sets the id of the page selected before the change.

setSelection(This, Page)

Sets the selection member variable.

Types

wxBookCtrl()

-type wxBookCtrl() ::
          #wxBookCtrl{type :: wxBookCtrlEvent:wxBookCtrlEventType(),
                      nSel :: integer(),
                      nOldSel :: integer()}.

wxBookCtrlEvent()

-type wxBookCtrlEvent() :: wx:wx_object().

wxBookCtrlEventType()

-type wxBookCtrlEventType() ::
          command_notebook_page_changed | command_notebook_page_changing | choicebook_page_changed |
          choicebook_page_changing | treebook_page_changed | treebook_page_changing |
          toolbook_page_changed | toolbook_page_changing | listbook_page_changed |
          listbook_page_changing.

Functions

getOldSelection(This)

-spec getOldSelection(This) -> integer() when This :: wxBookCtrlEvent().

Returns the page that was selected before the change, wxNOT\_FOUND if none was selected.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxBookCtrlEvent().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note: under Windows, getSelection/1 will return the same value as getOldSelection/1 when called from the EVT_BOOKCTRL_PAGE_CHANGING handler and not the page which is going to be selected.

setOldSelection(This, Page)

-spec setOldSelection(This, Page) -> ok when This :: wxBookCtrlEvent(), Page :: integer().

Sets the id of the page selected before the change.

setSelection(This, Page)

-spec setSelection(This, Page) -> ok when This :: wxBookCtrlEvent(), Page :: integer().

Sets the selection member variable.

wxBoxSizer

The basic idea behind a box sizer is that windows will most often be laid out in rather simple basic geometry, typically in a row or a column or several hierarchies of either.

For more information, please see overview_sizer_box.

See:

wxSizer

Overview sizer

This class is derived, and can use functions, from:

wxSizer

wxWidgets docs: wxBoxSizer

Summary

Types

wxBoxSizer()

Functions

destroy(This)

Destroys the object

getOrientation(This)

Returns the orientation of the box sizer, either wxVERTICAL or wxHORIZONTAL.

new(Orient)

Constructor for a wxBoxSizer.

Types

wxBoxSizer()

-type wxBoxSizer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxBoxSizer()) -> ok.

Destroys the object

getOrientation(This)

-spec getOrientation(This) -> integer() when This :: wxBoxSizer().

Returns the orientation of the box sizer, either wxVERTICAL or wxHORIZONTAL.

new(Orient)

-spec new(Orient) -> wxBoxSizer() when Orient :: integer().

Constructor for a wxBoxSizer.

orient may be either of wxVERTICAL or wxHORIZONTAL for creating either a column sizer or a row sizer.

wxBrush

A brush is a drawing tool for filling in areas.

It is used for painting the background of rectangles, ellipses, etc. It has a colour and a style.

On a monochrome display, wxWidgets shows all brushes as white unless the colour is really black.

Do not initialize objects on the stack before the program commences, since other required structures may not have been set up yet. Instead, define global pointers to objects and create them in wxApp::OnInit (not implemented in wx) or when required.

An application may wish to create brushes with different characteristics dynamically, and there is the consequent danger that a large number of duplicate brushes will be created. Therefore an application may wish to get a pointer to a brush by using the global list of brushes ?wxTheBrushList, and calling the member function wxBrushList::FindOrCreateBrush() (not implemented in wx).

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

Predefined objects (include wx.hrl):

?wxNullBrush

?wxBLACK_BRUSH

?wxBLUE_BRUSH

?wxCYAN_BRUSH

?wxGREEN_BRUSH

?wxYELLOW_BRUSH

?wxGREY_BRUSH

?wxLIGHT_GREY_BRUSH

?wxMEDIUM_GREY_BRUSH

?wxRED_BRUSH

?wxTRANSPARENT_BRUSH

?wxWHITE_BRUSH

See:

wxDC

wxDC:setBrush/2

wxWidgets docs: wxBrush

Summary

Types

wxBrush()

Functions

destroy(This)

Destroys the object

getColour(This)

Returns a reference to the brush colour.

getStipple(This)

Gets a pointer to the stipple bitmap.

getStyle(This)

Returns the brush style, one of the ?wxBrushStyle values.

isHatch(This)

Returns true if the style of the brush is any of hatched fills.

isOk(This)

Returns true if the brush is initialised.

new()

Default constructor.

new/1

Copy constructor, uses reference counting.

new(Colour, Options)

Constructs a brush from a colour object and style.

setColour(This, Colour)

Sets the brush colour using red, green and blue values.

setColour(This, Red, Green, Blue)

setStipple(This, Bitmap)

Sets the stipple bitmap.

setStyle(This, Style)

Sets the brush style.

Types

wxBrush()

-type wxBrush() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxBrush()) -> ok.

Destroys the object

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxBrush().

Returns a reference to the brush colour.

See: setColour/4

getStipple(This)

-spec getStipple(This) -> wxBitmap:wxBitmap() when This :: wxBrush().

Gets a pointer to the stipple bitmap.

If the brush does not have a wxBRUSHSTYLE_STIPPLE style, this bitmap may be non-NULL but uninitialised (i.e. wxBitmap:isOk/1 returns false).

See: setStipple/2

getStyle(This)

-spec getStyle(This) -> wx:wx_enum() when This :: wxBrush().

Returns the brush style, one of the ?wxBrushStyle values.

See:

setStyle/2

setColour/4

setStipple/2

isHatch(This)

-spec isHatch(This) -> boolean() when This :: wxBrush().

Returns true if the style of the brush is any of hatched fills.

See: getStyle/1

isOk(This)

-spec isOk(This) -> boolean() when This :: wxBrush().

Returns true if the brush is initialised.

Notice that an uninitialized brush object can't be queried for any brush properties and all calls to the accessor methods on it will result in an assert failure.

new()

-spec new() -> wxBrush().

Default constructor.

The brush will be uninitialised, and wxBrush:isOk/1 will return false.

new/1

-spec new(Colour) -> wxBrush() when Colour :: wx:wx_colour();
         (Brush) -> wxBrush() when Brush :: wxBrush:wxBrush() | wxBitmap:wxBitmap().

Copy constructor, uses reference counting.

new(Colour, Options)

-spec new(Colour, [Option]) -> wxBrush() when Colour :: wx:wx_colour(), Option :: {style, wx:wx_enum()}.

Constructs a brush from a colour object and style.

setColour(This, Colour)

-spec setColour(This, Colour) -> ok when This :: wxBrush(), Colour :: wx:wx_colour().

Sets the brush colour using red, green and blue values.

See: getColour/1

setColour(This, Red, Green, Blue)

-spec setColour(This, Red, Green, Blue) -> ok
                   when This :: wxBrush(), Red :: integer(), Green :: integer(), Blue :: integer().

setStipple(This, Bitmap)

-spec setStipple(This, Bitmap) -> ok when This :: wxBrush(), Bitmap :: wxBitmap:wxBitmap().

Sets the stipple bitmap.

Remark: The style will be set to wxBRUSHSTYLE_STIPPLE, unless the bitmap has a mask associated to it, in which case the style will be set to wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE.

See: wxBitmap

setStyle(This, Style)

-spec setStyle(This, Style) -> ok when This :: wxBrush(), Style :: wx:wx_enum().

Sets the brush style.

See: getStyle/1

wxBufferedDC

This class provides a simple way to avoid flicker: when drawing on it, everything is in fact first drawn on an in-memory buffer (a wxBitmap) and then copied to the screen, using the associated wxDC, only once, when this object is destroyed.

wxBufferedDC itself is typically associated with wxClientDC, if you want to use it in your EVT_PAINT handler, you should look at wxBufferedPaintDC instead.

When used like this, a valid DC must be specified in the constructor while the buffer bitmap doesn't have to be explicitly provided, by default this class will allocate the bitmap of required size itself. However using a dedicated bitmap can speed up the redrawing process by eliminating the repeated creation and destruction of a possibly big bitmap. Otherwise, wxBufferedDC can be used in the same way as any other device context.

Another possible use for wxBufferedDC is to use it to maintain a backing store for the window contents. In this case, the associated DC may be NULL but a valid backing store bitmap should be specified.

Finally, please note that GTK+ 2.0 as well as macOS provide double buffering themselves natively. You can either use wxWindow:isDoubleBuffered/1 to determine whether you need to use buffering or not, or use wxAutoBufferedPaintDC (not implemented in wx) to avoid needless double buffering on the systems which already do it automatically.

See:

wxDC

wxMemoryDC

wxBufferedPaintDC

This class is derived, and can use functions, from:

wxMemoryDC

wxDC

wxWidgets docs: wxBufferedDC

Summary

Types

wxBufferedDC()

Functions

destroy(This)

Destroys the object

init(This, Dc)

Equivalent to init(This, Dc, []).

init/3

init/4

Initializes the object created using the default constructor.

new()

Default constructor.

new(Dc)

Equivalent to new(Dc, []).

new/2

Creates a buffer for the provided dc.

new/3

Creates a buffer for the provided dc.

Types

wxBufferedDC()

-type wxBufferedDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxBufferedDC()) -> ok.

Destroys the object

init(This, Dc)

-spec init(This, Dc) -> ok when This :: wxBufferedDC(), Dc :: wxDC:wxDC().

Equivalent to init(This, Dc, []).

init/3

-spec init(This, Dc, Area) -> ok
              when This :: wxBufferedDC(), Dc :: wxDC:wxDC(), Area :: {W :: integer(), H :: integer()};
          (This, Dc, [Option]) -> ok
              when
                  This :: wxBufferedDC(),
                  Dc :: wxDC:wxDC(),
                  Option :: {buffer, wxBitmap:wxBitmap()} | {style, integer()}.

init/4

-spec init(This, Dc, Area, [Option]) -> ok
              when
                  This :: wxBufferedDC(),
                  Dc :: wxDC:wxDC(),
                  Area :: {W :: integer(), H :: integer()},
                  Option :: {style, integer()}.

Initializes the object created using the default constructor.

Please see the constructors for parameter details.

new()

-spec new() -> wxBufferedDC().

Default constructor.

You must call one of the init/4 methods later in order to use the device context.

new(Dc)

-spec new(Dc) -> wxBufferedDC() when Dc :: wxDC:wxDC().

Equivalent to new(Dc, []).

new/2

-spec new(Dc, Area) -> wxBufferedDC() when Dc :: wxDC:wxDC(), Area :: {W :: integer(), H :: integer()};
         (Dc, [Option]) -> wxBufferedDC()
             when Dc :: wxDC:wxDC(), Option :: {buffer, wxBitmap:wxBitmap()} | {style, integer()}.

Creates a buffer for the provided dc.

init/4 must not be called when using this constructor.

new/3

-spec new(Dc, Area, [Option]) -> wxBufferedDC()
             when
                 Dc :: wxDC:wxDC(),
                 Area :: {W :: integer(), H :: integer()},
                 Option :: {style, integer()}.

Creates a buffer for the provided dc.

init/4 must not be called when using this constructor.

wxBufferedPaintDC

This is a subclass of wxBufferedDC which can be used inside of an EVT\_PAINT() event handler to achieve double-buffered drawing.

Just use this class instead of wxPaintDC and make sure wxWindow:setBackgroundStyle/2 is called with wxBG_STYLE_PAINT somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with wxScrolled (not implemented in wx), you probably do not want to call wxScrolledWindow:prepareDC/2 on it as it already does this internally for the real underlying wxPaintDC.

See:

wxDC

wxBufferedDC

wxPaintDC

This class is derived, and can use functions, from:

wxBufferedDC

wxMemoryDC

wxDC

wxWidgets docs: wxBufferedPaintDC

Summary

Types

wxBufferedPaintDC()

Functions

destroy(This)

Destroys the object

new(Window)

Equivalent to new(Window, []).

new/2

new/3

As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).

Types

wxBufferedPaintDC()

-type wxBufferedPaintDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxBufferedPaintDC()) -> ok.

Destroys the object

new(Window)

-spec new(Window) -> wxBufferedPaintDC() when Window :: wxWindow:wxWindow().

Equivalent to new(Window, []).

new/2

-spec new(Window, Buffer) -> wxBufferedPaintDC()
             when Window :: wxWindow:wxWindow(), Buffer :: wxBitmap:wxBitmap();
         (Window, [Option]) -> wxBufferedPaintDC()
             when Window :: wxWindow:wxWindow(), Option :: {style, integer()}.

new/3

-spec new(Window, Buffer, [Option]) -> wxBufferedPaintDC()
             when
                 Window :: wxWindow:wxWindow(),
                 Buffer :: wxBitmap:wxBitmap(),
                 Option :: {style, integer()}.

As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).

Pass wxBUFFER_CLIENT_AREA for the style parameter to indicate that just the client area of the window is buffered, or wxBUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.

wxButton

A button is a control that contains a text string, and is one of the most common elements of a GUI.

It may be placed on a wxDialog or on a wxPanel panel, or indeed on almost any other window.

By default, i.e. if none of the alignment styles are specified, the label is centered both horizontally and vertically. If the button has both a label and a bitmap, the alignment styles above specify the location of the rectangle combining both the label and the bitmap and the bitmap position set with wxButton::SetBitmapPosition() (not implemented in wx) defines the relative position of the bitmap with respect to the label (however currently non-default alignment combinations are not implemented on all platforms).

Since version 2.9.1 wxButton supports showing both text and an image (currently only when using wxMSW, wxGTK or wxOSX/Cocoa ports), see SetBitmap() (not implemented in wx) and setBitmapLabel/2, setBitmapDisabled/2 &c methods. In the previous wxWidgets versions this functionality was only available in (the now trivial) wxBitmapButton class which was only capable of showing an image without text.

A button may have either a single image for all states or different images for the following states (different images are not currently supported under macOS where the normal image is used for all states):

normal: the default state

disabled: bitmap shown when the button is disabled.

pressed: bitmap shown when the button is pushed (e.g. while the user keeps the mouse button pressed on it)

focus: bitmap shown when the button has keyboard focus (but is not pressed as in this case the button is in the pressed state)

current: bitmap shown when the mouse is over the button (but it is not pressed although it may have focus). Notice that if current bitmap is not specified but the current platform UI uses hover images for the buttons (such as Windows or GTK+), then the focus bitmap is used for hover state as well. This makes it possible to set focus bitmap only to get reasonably good behaviour on all platforms.

All of the bitmaps must be of the same size and the normal bitmap must be set first (to a valid bitmap), before setting any other ones. Also, if the size of the bitmaps is changed later, you need to change the size of the normal bitmap before setting any other bitmaps with the new size (and you do need to reset all of them as their original values can be lost when the normal bitmap size changes).

The position of the image inside the button be configured using SetBitmapPosition() (not implemented in wx). By default the image is on the left of the text.

Please also notice that GTK+ uses a global setting called gtk-button-images to determine if the images should be shown in the buttons at all. If it is off (which is the case in e.g. Gnome 2.28 by default), no images will be shown, consistently with the native behaviour.

Styles

This class supports the following styles:

wxBU_LEFT: Left-justifies the label. Windows and GTK+ only.

wxBU_TOP: Aligns the label to the top of the button. Windows and GTK+ only.

wxBU_RIGHT: Right-justifies the bitmap label. Windows and GTK+ only.

wxBU_BOTTOM: Aligns the label to the bottom of the button. Windows and GTK+ only.

wxBU_EXACTFIT: By default, all buttons are made of at least the standard button size, even if their contents is small enough to fit into a smaller size. This is done for consistency as most platforms use buttons of the same size in the native dialogs, but can be overridden by specifying this flag. If it is given, the button will be made just big enough for its contents. Notice that under MSW the button will still have at least the standard height, even with this style, if it has a non-empty label.

wxBU_NOTEXT: Disables the display of the text label in the button even if it has one or its id is one of the standard stock ids with an associated label: without using this style a button which is only supposed to show a bitmap but uses a standard id would display a label too.

wxBORDER_NONE: Creates a button without border. This is currently implemented in MSW, GTK2 and OSX/Cocoa.

See: wxBitmapButton

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxButton

Events

Event types emitted from this class:

command_button_clicked

Summary

Types

wxButton()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Button creation function for two-step creation.

destroy(This)

Destroys the object

getBitmapDisabled(This)

Returns the bitmap for the disabled state, which may be invalid.

getBitmapFocus(This)

Returns the bitmap for the focused state, which may be invalid.

getBitmapLabel(This)

Returns the bitmap for the normal state.

getDefaultSize()

Returns the default size for the buttons.

getDefaultSize(Win)

new()

Default ctor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a button.

setBitmapDisabled(This, Bitmap)

Sets the bitmap for the disabled button appearance.

setBitmapFocus(This, Bitmap)

Sets the bitmap for the button appearance when it has the keyboard focus.

setBitmapLabel(This, Bitmap)

Sets the bitmap label for the button.

setDefault(This)

This sets the button to be the default item in its top-level window (e.g.

setLabel(This, Label)

Sets the string label for the button.

Types

wxButton()

-type wxButton() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxButton(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {label, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Button creation function for two-step creation.

For more details, see new/3.

destroy(This)

-spec destroy(This :: wxButton()) -> ok.

Destroys the object

getBitmapDisabled(This)

-spec getBitmapDisabled(This) -> wxBitmap:wxBitmap() when This :: wxButton().

Returns the bitmap for the disabled state, which may be invalid.

See: setBitmapDisabled/2

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

getBitmapFocus(This)

-spec getBitmapFocus(This) -> wxBitmap:wxBitmap() when This :: wxButton().

Returns the bitmap for the focused state, which may be invalid.

See: setBitmapFocus/2

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

getBitmapLabel(This)

-spec getBitmapLabel(This) -> wxBitmap:wxBitmap() when This :: wxButton().

Returns the bitmap for the normal state.

This is exactly the same as GetBitmap() (not implemented in wx) but uses a name backwards-compatible with wxBitmapButton.

See: setBitmapLabel/2

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

getDefaultSize()

-spec getDefaultSize() -> {W :: integer(), H :: integer()}.

Returns the default size for the buttons.

It is advised to make all the dialog buttons of the same size and this function allows retrieving the (platform, and current font dependent) size which should be the best suited for this.

The optional win argument is new since wxWidgets 3.1.3 and allows to get a per-monitor DPI specific size.

getDefaultSize(Win)

-spec getDefaultSize(Win) -> {W :: integer(), H :: integer()} when Win :: wxWindow:wxWindow().

new()

-spec new() -> wxButton().

Default ctor.

new(Parent, Id)

-spec new(Parent, Id) -> wxButton() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {label, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a button.

The preferred way to create standard buttons is to use default value of label. If no label is supplied and id is one of standard IDs from this list, a standard label will be used. In other words, if you use a predefined wxID_XXX constant, just omit the label completely rather than specifying it. In particular, help buttons (the ones with id of wxID_HELP) under macOS can't display any label at all and while wxButton will detect if the standard "Help" label is used and ignore it, using any other label will prevent the button from correctly appearing as a help button and so should be avoided.

In addition to that, the button will be decorated with stock icons under GTK+ 2.

See: create/4

setBitmapDisabled(This, Bitmap)

-spec setBitmapDisabled(This, Bitmap) -> ok when This :: wxButton(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap for the disabled button appearance.

If bitmap is invalid, the disabled bitmap is set to the automatically generated greyed out version of the normal bitmap, i.e. the same bitmap as is used by default if this method is not called at all. Use SetBitmap() (not implemented in wx) with an invalid bitmap to remove the bitmap completely (for all states).

See:

getBitmapDisabled/1

setBitmapLabel/2

setBitmapFocus/2

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

setBitmapFocus(This, Bitmap)

-spec setBitmapFocus(This, Bitmap) -> ok when This :: wxButton(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap for the button appearance when it has the keyboard focus.

If bitmap is invalid, the normal bitmap will be used in the focused state.

See:

getBitmapFocus/1

setBitmapLabel/2

setBitmapDisabled/2

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

setBitmapLabel(This, Bitmap)

-spec setBitmapLabel(This, Bitmap) -> ok when This :: wxButton(), Bitmap :: wxBitmap:wxBitmap().

Sets the bitmap label for the button.

Remark: This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided.

See: getBitmapLabel/1

Since: 2.9.1 (available in wxBitmapButton only in previous versions)

setDefault(This)

-spec setDefault(This) -> wxWindow:wxWindow() when This :: wxButton().

This sets the button to be the default item in its top-level window (e.g.

the panel or the dialog box containing it).

As normal, pressing return causes the default button to be depressed when the return key is pressed.

See also wxWindow:setFocus/1 which sets the keyboard focus for windows and text panel items, and wxTopLevelWindow::SetDefaultItem() (not implemented in wx).

Remark: Under Windows, only dialog box buttons respond to this function.

Return: the old default item (possibly NULL)

setLabel(This, Label)

-spec setLabel(This, Label) -> ok when This :: wxButton(), Label :: unicode:chardata().

Sets the string label for the button.

wxCalendarCtrl

The calendar control allows the user to pick a date.

The user can move the current selection using the keyboard and select the date (generating EVT_CALENDAR event) by pressing <Return> or double clicking it.

Generic calendar has advanced possibilities for the customization of its display, described below. If you want to use these possibilities on every platform, use wxGenericCalendarCtrl instead of wxCalendarCtrl.

All global settings (such as colours and fonts used) can, of course, be changed. But also, the display style for each day in the month can be set independently using wxCalendarDateAttr class.

An item without custom attributes is drawn with the default colours and font and without border, but setting custom attributes with setAttr/3 allows modifying its appearance. Just create a custom attribute object and set it for the day you want to be displayed specially (note that the control will take ownership of the pointer, i.e. it will delete it itself). A day may be marked as being a holiday, even if it is not recognized as one by wx_datetime() using the wxCalendarDateAttr:setHoliday/2 method.

As the attributes are specified for each day, they may change when the month is changed, so you will often want to update them in EVT_CALENDAR_PAGE_CHANGED event handler.

If neither the wxCAL_SUNDAY_FIRST or wxCAL_MONDAY_FIRST style is given, the first day of the week is determined from operating system's settings, if possible. The native wxGTK calendar chooses the first weekday based on locale, and these styles have no effect on it.

Styles

This class supports the following styles:

wxCAL_SUNDAY_FIRST: Show Sunday as the first day in the week (not in wxGTK)

wxCAL_MONDAY_FIRST: Show Monday as the first day in the week (not in wxGTK)

wxCAL_SHOW_HOLIDAYS: Highlight holidays in the calendar (only generic)

wxCAL_NO_YEAR_CHANGE: Disable the year changing (deprecated, only generic)

wxCAL_NO_MONTH_CHANGE: Disable the month (and, implicitly, the year) changing

wxCAL_SHOW_SURROUNDING_WEEKS: Show the neighbouring weeks in the previous and next months (only generic, always on for the native controls)

wxCAL_SEQUENTIAL_MONTH_SELECTION: Use alternative, more compact, style for the month and year selection controls. (only generic)

wxCAL_SHOW_WEEK_NUMBERS: Show week numbers on the left side of the calendar. (not in generic)

See:

Examples

wxCalendarDateAttr

wxCalendarEvent

wxDatePickerCtrl

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxCalendarCtrl

Events

Event types emitted from this class:

calendar_sel_changed

calendar_weekday_clicked

Summary

Types

wxCalendarCtrl()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates the control.

destroy(This)

Destroys the object

enableHolidayDisplay(This)

Equivalent to enableHolidayDisplay(This, []).

enableHolidayDisplay/2

This function should be used instead of changing wxCAL\_SHOW\_HOLIDAYS style bit directly.

enableMonthChange(This)

Equivalent to enableMonthChange(This, []).

enableMonthChange/2

This function should be used instead of changing wxCAL\_NO\_MONTH\_CHANGE style bit.

enableYearChange(This) deprecated

Equivalent to enableYearChange(This, []).

enableYearChange/2 deprecated

Deprecated

getAttr(This, Day)

Returns the attribute for the given date (should be in the range 1...31).

getDate(This)

Gets the currently selected date.

getHeaderColourBg(This)

Gets the background colour of the header part of the calendar window.

getHeaderColourFg(This)

Gets the foreground colour of the header part of the calendar window.

getHighlightColourBg(This)

Gets the background highlight colour.

getHighlightColourFg(This)

Gets the foreground highlight colour.

getHolidayColourBg(This)

Return the background colour currently used for holiday highlighting.

getHolidayColourFg(This)

Return the foreground colour currently used for holiday highlighting.

hitTest(This, Pos)

Returns one of wxCalendarHitTestResult constants and fills either date or wd pointer with the corresponding value depending on the hit test code.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Does the same as create/4 method.

resetAttr(This, Day)

Clears any attributes associated with the given day (in the range 1...31).

setAttr(This, Day, Attr)

Associates the attribute with the specified date (in the range 1...31).

setDate(This, Date)

Sets the current date.

setHeaderColours(This, ColFg, ColBg)

Set the colours used for painting the weekdays at the top of the control.

setHighlightColours(This, ColFg, ColBg)

Set the colours to be used for highlighting the currently selected date.

setHoliday(This, Day)

Marks the specified day as being a holiday in the current month.

setHolidayColours(This, ColFg, ColBg)

Sets the colours to be used for the holidays highlighting.

Types

wxCalendarCtrl()

-type wxCalendarCtrl() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxCalendarCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxCalendarCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {date, wx:wx_datetime()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates the control.

See wxWindow:new/3 for the meaning of the parameters and the control overview for the possible styles.

destroy(This)

-spec destroy(This :: wxCalendarCtrl()) -> ok.

Destroys the object

enableHolidayDisplay(This)

-spec enableHolidayDisplay(This) -> ok when This :: wxCalendarCtrl().

Equivalent to enableHolidayDisplay(This, []).

enableHolidayDisplay/2

-spec enableHolidayDisplay(This, [Option]) -> ok
                              when This :: wxCalendarCtrl(), Option :: {display, boolean()}.

This function should be used instead of changing wxCAL\_SHOW\_HOLIDAYS style bit directly.

It enables or disables the special highlighting of the holidays.

enableMonthChange(This)

-spec enableMonthChange(This) -> boolean() when This :: wxCalendarCtrl().

Equivalent to enableMonthChange(This, []).

enableMonthChange/2

-spec enableMonthChange(This, [Option]) -> boolean()
                           when This :: wxCalendarCtrl(), Option :: {enable, boolean()}.

This function should be used instead of changing wxCAL\_NO\_MONTH\_CHANGE style bit.

It allows or disallows the user to change the month interactively. Note that if the month cannot be changed, the year cannot be changed neither.

Return: true if the value of this option really changed or false if it was already set to the requested value.

enableYearChange(This)

This function is deprecated. wxCalendarCtrl:enableYearChange/1 is deprecated; not available in wxWidgets-2.9 and later.

-spec enableYearChange(This) -> ok when This :: wxCalendarCtrl().

Equivalent to enableYearChange(This, []).

enableYearChange/2

This function is deprecated. wxCalendarCtrl:enableYearChange/2 is deprecated; not available in wxWidgets-2.9 and later.

-spec enableYearChange(This, [Option]) -> ok
                          when This :: wxCalendarCtrl(), Option :: {enable, boolean()}.

Deprecated:

This function should be used instead of changing wxCAL_NO_YEAR_CHANGE style bit directly. It allows or disallows the user to change the year interactively. Only in generic wxCalendarCtrl.

getAttr(This, Day)

-spec getAttr(This, Day) -> wxCalendarDateAttr:wxCalendarDateAttr()
                 when This :: wxCalendarCtrl(), Day :: integer().

Returns the attribute for the given date (should be in the range 1...31).

The returned pointer may be NULL. Only in generic wxCalendarCtrl.

getDate(This)

-spec getDate(This) -> wx:wx_datetime() when This :: wxCalendarCtrl().

Gets the currently selected date.

getHeaderColourBg(This)

-spec getHeaderColourBg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Gets the background colour of the header part of the calendar window.

This method is currently only implemented in generic wxCalendarCtrl and always returns wxNullColour in the native versions.

See: setHeaderColours/3

getHeaderColourFg(This)

-spec getHeaderColourFg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Gets the foreground colour of the header part of the calendar window.

This method is currently only implemented in generic wxCalendarCtrl and always returns wxNullColour in the native versions.

See: setHeaderColours/3

getHighlightColourBg(This)

-spec getHighlightColourBg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Gets the background highlight colour.

Only in generic wxCalendarCtrl.

This method is currently only implemented in generic wxCalendarCtrl and always returns wxNullColour in the native versions.

See: setHighlightColours/3

getHighlightColourFg(This)

-spec getHighlightColourFg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Gets the foreground highlight colour.

Only in generic wxCalendarCtrl.

This method is currently only implemented in generic wxCalendarCtrl and always returns wxNullColour in the native versions.

See: setHighlightColours/3

getHolidayColourBg(This)

-spec getHolidayColourBg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Return the background colour currently used for holiday highlighting.

Only useful with generic wxCalendarCtrl as native versions currently don't support holidays display at all and always return wxNullColour.

See: setHolidayColours/3

getHolidayColourFg(This)

-spec getHolidayColourFg(This) -> wx:wx_colour4() when This :: wxCalendarCtrl().

Return the foreground colour currently used for holiday highlighting.

Only useful with generic wxCalendarCtrl as native versions currently don't support holidays display at all and always return wxNullColour.

See: setHolidayColours/3

hitTest(This, Pos)

-spec hitTest(This, Pos) -> Result
                 when
                     Result :: {Res :: wx:wx_enum(), Date :: wx:wx_datetime(), Wd :: wx:wx_enum()},
                     This :: wxCalendarCtrl(),
                     Pos :: {X :: integer(), Y :: integer()}.

Returns one of wxCalendarHitTestResult constants and fills either date or wd pointer with the corresponding value depending on the hit test code.

Not implemented in wxGTK currently.

new()

-spec new() -> wxCalendarCtrl().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxCalendarCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxCalendarCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {date, wx:wx_datetime()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Does the same as create/4 method.

resetAttr(This, Day)

-spec resetAttr(This, Day) -> ok when This :: wxCalendarCtrl(), Day :: integer().

Clears any attributes associated with the given day (in the range 1...31).

Only in generic wxCalendarCtrl.

setAttr(This, Day, Attr)

-spec setAttr(This, Day, Attr) -> ok
                 when
                     This :: wxCalendarCtrl(),
                     Day :: integer(),
                     Attr :: wxCalendarDateAttr:wxCalendarDateAttr().

Associates the attribute with the specified date (in the range 1...31).

If the pointer is NULL, the items attribute is cleared. Only in generic wxCalendarCtrl.

setDate(This, Date)

-spec setDate(This, Date) -> boolean() when This :: wxCalendarCtrl(), Date :: wx:wx_datetime().

Sets the current date.

The date parameter must be valid and in the currently valid range as set by SetDateRange() (not implemented in wx), otherwise the current date is not changed and the function returns false and, additionally, triggers an assertion failure if the date is invalid.

setHeaderColours(This, ColFg, ColBg)

-spec setHeaderColours(This, ColFg, ColBg) -> ok
                          when
                              This :: wxCalendarCtrl(), ColFg :: wx:wx_colour(), ColBg :: wx:wx_colour().

Set the colours used for painting the weekdays at the top of the control.

This method is currently only implemented in generic wxCalendarCtrl and does nothing in the native versions.

setHighlightColours(This, ColFg, ColBg)

-spec setHighlightColours(This, ColFg, ColBg) -> ok
                             when
                                 This :: wxCalendarCtrl(),
                                 ColFg :: wx:wx_colour(),
                                 ColBg :: wx:wx_colour().

Set the colours to be used for highlighting the currently selected date.

This method is currently only implemented in generic wxCalendarCtrl and does nothing in the native versions.

setHoliday(This, Day)

-spec setHoliday(This, Day) -> ok when This :: wxCalendarCtrl(), Day :: integer().

Marks the specified day as being a holiday in the current month.

This method is only implemented in the generic version of the control and does nothing in the native ones.

setHolidayColours(This, ColFg, ColBg)

-spec setHolidayColours(This, ColFg, ColBg) -> ok
                           when
                               This :: wxCalendarCtrl(),
                               ColFg :: wx:wx_colour(),
                               ColBg :: wx:wx_colour().

Sets the colours to be used for the holidays highlighting.

This method is only implemented in the generic version of the control and does nothing in the native ones. It should also only be called if the window style includes wxCAL_SHOW_HOLIDAYS flag or enableHolidayDisplay/2 had been called.

wxCalendarDateAttr

wxCalendarDateAttr is a custom attributes for a calendar date.

The objects of this class are used with wxCalendarCtrl.

See: wxCalendarCtrl

wxWidgets docs: wxCalendarDateAttr

Summary

Types

wxCalendarDateAttr()

Functions

destroy(This)

Destroys the object

getBackgroundColour(This)

Returns the background colour set for the calendar date.

getBorder(This)

Returns the border set for the calendar date.

getBorderColour(This)

Returns the border colour set for the calendar date.

getFont(This)

Returns the font set for the calendar date.

getTextColour(This)

Returns the text colour set for the calendar date.

hasBackgroundColour(This)

Returns true if a non-default text background colour is set.

hasBorder(This)

Returns true if a non-default (i.e. any) border is set.

hasBorderColour(This)

Returns true if a non-default border colour is set.

hasFont(This)

Returns true if a non-default font is set.

hasTextColour(This)

Returns true if a non-default text foreground colour is set.

isHoliday(This)

Returns true if this calendar day is displayed as a holiday.

new()

Equivalent to new([]).

new/1

Constructor for specifying all wxCalendarDateAttr properties.

new(Border, Options)

Constructor using default properties except the given border.

setBackgroundColour(This, ColBack)

Sets the text background colour to use.

setBorder(This, Border)

Sets the border to use.

setBorderColour(This, Col)

Sets the border colour to use.

setFont(This, Font)

Sets the font to use.

setHoliday(This, Holiday)

If holiday is true, this calendar day will be displayed as a holiday.

setTextColour(This, ColText)

Sets the text (foreground) colour to use.

Types

wxCalendarDateAttr()

-type wxCalendarDateAttr() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxCalendarDateAttr()) -> ok.

Destroys the object

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxCalendarDateAttr().

Returns the background colour set for the calendar date.

getBorder(This)

-spec getBorder(This) -> wx:wx_enum() when This :: wxCalendarDateAttr().

Returns the border set for the calendar date.

getBorderColour(This)

-spec getBorderColour(This) -> wx:wx_colour4() when This :: wxCalendarDateAttr().

Returns the border colour set for the calendar date.

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxCalendarDateAttr().

Returns the font set for the calendar date.

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxCalendarDateAttr().

Returns the text colour set for the calendar date.

hasBackgroundColour(This)

-spec hasBackgroundColour(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if a non-default text background colour is set.

hasBorder(This)

-spec hasBorder(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if a non-default (i.e. any) border is set.

hasBorderColour(This)

-spec hasBorderColour(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if a non-default border colour is set.

hasFont(This)

-spec hasFont(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if a non-default font is set.

hasTextColour(This)

-spec hasTextColour(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if a non-default text foreground colour is set.

isHoliday(This)

-spec isHoliday(This) -> boolean() when This :: wxCalendarDateAttr().

Returns true if this calendar day is displayed as a holiday.

new()

-spec new() -> wxCalendarDateAttr().

Equivalent to new([]).

new/1

-spec new(Border) -> wxCalendarDateAttr() when Border :: wx:wx_enum();
         ([Option]) -> wxCalendarDateAttr()
             when
                 Option ::
                     {colText, wx:wx_colour()} |
                     {colBack, wx:wx_colour()} |
                     {colBorder, wx:wx_colour()} |
                     {font, wxFont:wxFont()} |
                     {border, wx:wx_enum()}.

Constructor for specifying all wxCalendarDateAttr properties.

new(Border, Options)

-spec new(Border, [Option]) -> wxCalendarDateAttr()
             when Border :: wx:wx_enum(), Option :: {colBorder, wx:wx_colour()}.

Constructor using default properties except the given border.

setBackgroundColour(This, ColBack)

-spec setBackgroundColour(This, ColBack) -> ok
                             when This :: wxCalendarDateAttr(), ColBack :: wx:wx_colour().

Sets the text background colour to use.

setBorder(This, Border)

-spec setBorder(This, Border) -> ok when This :: wxCalendarDateAttr(), Border :: wx:wx_enum().

Sets the border to use.

setBorderColour(This, Col)

-spec setBorderColour(This, Col) -> ok when This :: wxCalendarDateAttr(), Col :: wx:wx_colour().

Sets the border colour to use.

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxCalendarDateAttr(), Font :: wxFont:wxFont().

Sets the font to use.

setHoliday(This, Holiday)

-spec setHoliday(This, Holiday) -> ok when This :: wxCalendarDateAttr(), Holiday :: boolean().

If holiday is true, this calendar day will be displayed as a holiday.

setTextColour(This, ColText)

-spec setTextColour(This, ColText) -> ok when This :: wxCalendarDateAttr(), ColText :: wx:wx_colour().

Sets the text (foreground) colour to use.

wxCalendarEvent

The wxCalendarEvent class is used together with wxCalendarCtrl.

See: wxCalendarCtrl

This class is derived, and can use functions, from:

wxDateEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxCalendarEvent

Summary

Types

wxCalendar()

wxCalendarEvent()

wxCalendarEventType()

Functions

getDate(This)

Returns the date.

getWeekDay(This)

Returns the week day on which the user clicked in EVT\_CALENDAR\_WEEKDAY\_CLICKED handler.

Types

wxCalendar()

-type wxCalendar() ::
          #wxCalendar{type :: wxCalendarEvent:wxCalendarEventType(),
                      wday :: wx:wx_enum(),
                      date :: wx:wx_datetime()}.

wxCalendarEvent()

-type wxCalendarEvent() :: wx:wx_object().

wxCalendarEventType()

-type wxCalendarEventType() ::
          calendar_sel_changed | calendar_day_changed | calendar_month_changed | calendar_year_changed |
          calendar_doubleclicked | calendar_weekday_clicked.

Functions

getDate(This)

-spec getDate(This) -> wx:wx_datetime() when This :: wxCalendarEvent().

Returns the date.

getWeekDay(This)

-spec getWeekDay(This) -> wx:wx_enum() when This :: wxCalendarEvent().

Returns the week day on which the user clicked in EVT\_CALENDAR\_WEEKDAY\_CLICKED handler.

It doesn't make sense to call this function in other handlers.

wxCaret

A caret is a blinking cursor showing the position where the typed text will appear.

Text controls usually have their own caret but wxCaret provides a way to use a caret in other windows.

Currently, the caret appears as a rectangle of the given size. In the future, it will be possible to specify a bitmap to be used for the caret shape.

A caret is always associated with a window and the current caret can be retrieved using wxWindow:getCaret/1. The same caret can't be reused in two different windows.

wxWidgets docs: wxCaret

Summary

Types

wxCaret()

Functions

create(This, Window, Size)

create(This, Window, Width, Height)

Creates a caret with the given size (in pixels) and associates it with the window (same as the equivalent constructors).

destroy(This)

Destroys the object

getBlinkTime()

Returns the blink time which is measured in milliseconds and is the time elapsed between 2 inversions of the caret (blink time of the caret is the same for all carets, so this functions is static).

getPosition(This)

getSize(This)

getWindow(This)

Get the window the caret is associated with.

hide(This)

Hides the caret, same as Show(false).

isOk(This)

Returns true if the caret was created successfully.

isVisible(This)

Returns true if the caret is visible and false if it is permanently hidden (if it is blinking and not shown currently but will be after the next blink, this method still returns true).

move(This, Pt)

move(This, X, Y)

Move the caret to given position (in logical coordinates).

new(Window, Size)

new(Window, Width, Height)

Creates a caret with the given size (in pixels) and associates it with the window.

setBlinkTime(Milliseconds)

Sets the blink time for all the carets.

setSize(This, Size)

setSize(This, Width, Height)

Changes the size of the caret.

show(This)

Equivalent to show(This, []).

show/2

Shows or hides the caret.

Types

wxCaret()

-type wxCaret() :: wx:wx_object().

Functions

create(This, Window, Size)

-spec create(This, Window, Size) -> boolean()
                when
                    This :: wxCaret(),
                    Window :: wxWindow:wxWindow(),
                    Size :: {W :: integer(), H :: integer()}.

create(This, Window, Width, Height)

-spec create(This, Window, Width, Height) -> boolean()
                when
                    This :: wxCaret(),
                    Window :: wxWindow:wxWindow(),
                    Width :: integer(),
                    Height :: integer().

Creates a caret with the given size (in pixels) and associates it with the window (same as the equivalent constructors).

destroy(This)

-spec destroy(This :: wxCaret()) -> ok.

Destroys the object

getBlinkTime()

-spec getBlinkTime() -> integer().

Returns the blink time which is measured in milliseconds and is the time elapsed between 2 inversions of the caret (blink time of the caret is the same for all carets, so this functions is static).

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxCaret().

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxCaret().

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxCaret().

Get the window the caret is associated with.

hide(This)

-spec hide(This) -> ok when This :: wxCaret().

Hides the caret, same as Show(false).

isOk(This)

-spec isOk(This) -> boolean() when This :: wxCaret().

Returns true if the caret was created successfully.

isVisible(This)

-spec isVisible(This) -> boolean() when This :: wxCaret().

Returns true if the caret is visible and false if it is permanently hidden (if it is blinking and not shown currently but will be after the next blink, this method still returns true).

move(This, Pt)

-spec move(This, Pt) -> ok when This :: wxCaret(), Pt :: {X :: integer(), Y :: integer()}.

move(This, X, Y)

-spec move(This, X, Y) -> ok when This :: wxCaret(), X :: integer(), Y :: integer().

Move the caret to given position (in logical coordinates).

new(Window, Size)

-spec new(Window, Size) -> wxCaret()
             when Window :: wxWindow:wxWindow(), Size :: {W :: integer(), H :: integer()}.

new(Window, Width, Height)

-spec new(Window, Width, Height) -> wxCaret()
             when Window :: wxWindow:wxWindow(), Width :: integer(), Height :: integer().

Creates a caret with the given size (in pixels) and associates it with the window.

setBlinkTime(Milliseconds)

-spec setBlinkTime(Milliseconds) -> ok when Milliseconds :: integer().

Sets the blink time for all the carets.

Warning:

Under Windows, this function will change the blink time for all carets permanently (until the next time it is called), even for carets in other applications.

See: getBlinkTime/0

setSize(This, Size)

-spec setSize(This, Size) -> ok when This :: wxCaret(), Size :: {W :: integer(), H :: integer()}.

setSize(This, Width, Height)

-spec setSize(This, Width, Height) -> ok when This :: wxCaret(), Width :: integer(), Height :: integer().

Changes the size of the caret.

show(This)

-spec show(This) -> ok when This :: wxCaret().

Equivalent to show(This, []).

show/2

-spec show(This, [Option]) -> ok when This :: wxCaret(), Option :: {show, boolean()}.

Shows or hides the caret.

Notice that if the caret was hidden N times, it must be shown N times as well to reappear on the screen.

wxCheckBox

A checkbox is a labelled box which by default is either on (checkmark is visible) or off (no checkmark).

Optionally (when the wxCHK_3STATE style flag is set) it can have a third state, called the mixed or undetermined state. Often this is used as a "Does Not Apply" state.

Styles

This class supports the following styles:

wxCHK_2STATE: Create a 2-state checkbox. This is the default.

wxCHK_3STATE: Create a 3-state checkbox. Not implemented in wxGTK1.

wxCHK_ALLOW_3RD_STATE_FOR_USER: By default a user can't set a 3-state checkbox to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking.

wxALIGN_RIGHT: Makes the text appear on the left of the checkbox.

See:

wxRadioButton

wxCommandEvent

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxCheckBox

Events

Event types emitted from this class:

command_checkbox_clicked

Summary

Types

wxCheckBox()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creates the checkbox for two-step construction.

destroy(This)

Destroys the object

get3StateValue(This)

Gets the state of a 3-state checkbox.

getValue(This)

Gets the state of a 2-state checkbox.

is3rdStateAllowedForUser(This)

Returns whether or not the user can set the checkbox to the third state.

is3State(This)

Returns whether or not the checkbox is a 3-state checkbox.

isChecked(This)

This is just a maybe more readable synonym for getValue/1: just as the latter, it returns true if the checkbox is checked and false otherwise.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a checkbox.

set3StateValue(This, State)

Sets the checkbox to the given state.

setValue(This, State)

Sets the checkbox to the given state.

Types

wxCheckBox()

-type wxCheckBox() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxCheckBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxCheckBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the checkbox for two-step construction.

See new/4 for details.

destroy(This)

-spec destroy(This :: wxCheckBox()) -> ok.

Destroys the object

get3StateValue(This)

-spec get3StateValue(This) -> wx:wx_enum() when This :: wxCheckBox().

Gets the state of a 3-state checkbox.

Asserts when the function is used with a 2-state checkbox.

getValue(This)

-spec getValue(This) -> boolean() when This :: wxCheckBox().

Gets the state of a 2-state checkbox.

Return: Returns true if it is checked, false otherwise.

is3rdStateAllowedForUser(This)

-spec is3rdStateAllowedForUser(This) -> boolean() when This :: wxCheckBox().

Returns whether or not the user can set the checkbox to the third state.

Return: true if the user can set the third state of this checkbox, false if it can only be set programmatically or if it's a 2-state checkbox.

is3State(This)

-spec is3State(This) -> boolean() when This :: wxCheckBox().

Returns whether or not the checkbox is a 3-state checkbox.

Return: true if this checkbox is a 3-state checkbox, false if it's a 2-state checkbox.

isChecked(This)

-spec isChecked(This) -> boolean() when This :: wxCheckBox().

This is just a maybe more readable synonym for getValue/1: just as the latter, it returns true if the checkbox is checked and false otherwise.

new()

-spec new() -> wxCheckBox().

Default constructor.

See: create/5

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxCheckBox()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxCheckBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a checkbox.

See: create/5

set3StateValue(This, State)

-spec set3StateValue(This, State) -> ok when This :: wxCheckBox(), State :: wx:wx_enum().

Sets the checkbox to the given state.

This does not cause a wxEVT_CHECKBOX event to get emitted.

Asserts when the checkbox is a 2-state checkbox and setting the state to wxCHK_UNDETERMINED.

setValue(This, State)

-spec setValue(This, State) -> ok when This :: wxCheckBox(), State :: boolean().

Sets the checkbox to the given state.

This does not cause a wxEVT_CHECKBOX event to get emitted.

wxCheckListBox

A wxCheckListBox is like a wxListBox, but allows items to be checked or unchecked.

When using this class under Windows wxWidgets must be compiled with wxUSE_OWNER_DRAWN set to 1.

See:

wxListBox

wxChoice

wxComboBox

wxListCtrl

wxCommandEvent

This class is derived, and can use functions, from:

wxListBox

wxControlWithItems

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxCheckListBox

Events

Event types emitted from this class:

command_checklistbox_toggled

Summary

Types

wxCheckListBox()

Functions

check(This, Item)

Equivalent to check(This, Item, []).

check/3

Checks the given item.

destroy(This)

Destroys the object

isChecked(This, Item)

Returns true if the given item is checked, false otherwise.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a list box.

Types

wxCheckListBox()

-type wxCheckListBox() :: wx:wx_object().

Functions

check(This, Item)

-spec check(This, Item) -> ok when This :: wxCheckListBox(), Item :: integer().

Equivalent to check(This, Item, []).

check/3

-spec check(This, Item, [Option]) -> ok
               when This :: wxCheckListBox(), Item :: integer(), Option :: {check, boolean()}.

Checks the given item.

Note that calling this method does not result in a wxEVT_CHECKLISTBOX event being emitted.

destroy(This)

-spec destroy(This :: wxCheckListBox()) -> ok.

Destroys the object

isChecked(This, Item)

-spec isChecked(This, Item) -> boolean() when This :: wxCheckListBox(), Item :: integer().

Returns true if the given item is checked, false otherwise.

new()

-spec new() -> wxCheckListBox().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxCheckListBox() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxCheckListBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {choices, [unicode:chardata()]} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a list box.

wxChildFocusEvent

A child focus event is sent to a (parent-)window when one of its child windows gains focus, so that the window could restore the focus back to its corresponding child if it loses it now and regains later.

Notice that child window is the direct child of the window receiving event. Use wxWindow:findFocus/0 to retrieve the window which is actually getting focus.

See: Overview events

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxChildFocusEvent

Events

Use wxEvtHandler:connect/3 with wxChildFocusEventType to subscribe to events of this type.

Summary

Types

wxChildFocus()

wxChildFocusEvent()

wxChildFocusEventType()

Functions

getWindow(This)

Returns the direct child which receives the focus, or a (grand-)parent of the control receiving the focus.

Types

wxChildFocus()

-type wxChildFocus() :: #wxChildFocus{type :: wxChildFocusEvent:wxChildFocusEventType()}.

wxChildFocusEvent()

-type wxChildFocusEvent() :: wx:wx_object().

wxChildFocusEventType()

-type wxChildFocusEventType() :: child_focus.

Functions

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxChildFocusEvent().

Returns the direct child which receives the focus, or a (grand-)parent of the control receiving the focus.

To get the actually focused control use wxWindow:findFocus/0.

wxChoice

A choice item is used to select one of a list of strings.

Unlike a wxListBox, only the selection is visible until the user pulls down the menu of choices.

Styles

This class supports the following styles:

wxCB_SORT: Sorts the entries alphabetically.

See:

wxListBox

wxComboBox

wxCommandEvent

This class is derived, and can use functions, from:

wxControlWithItems

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxChoice

Events

Event types emitted from this class:

command_choice_selected

Summary

Types

wxChoice()

Functions

create(This, Parent, Id, Pos, Size, Choices)

Equivalent to create(This, Parent, Id, Pos, Size, Choices, []).

create/7

delete(This, N)

Deletes an item from the control.

destroy(This)

Destroys the object

getColumns(This)

Gets the number of columns in this choice item.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a choice.

setColumns(This)

Equivalent to setColumns(This, []).

setColumns/2

Sets the number of columns in this choice item.

Types

wxChoice()

-type wxChoice() :: wx:wx_object().

Functions

create(This, Parent, Id, Pos, Size, Choices)

-spec create(This, Parent, Id, Pos, Size, Choices) -> boolean()
                when
                    This :: wxChoice(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()].

Equivalent to create(This, Parent, Id, Pos, Size, Choices, []).

create/7

-spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean()
                when
                    This :: wxChoice(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()],
                    Option :: {style, integer()} | {validator, wx:wx_object()}.

delete(This, N)

-spec delete(This, N) -> ok when This :: wxChoice(), N :: integer().

Deletes an item from the control.

The client data associated with the item will be also deleted if it is owned by the control. Note that it is an error (signalled by an assert failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control.

If there is a currently selected item below the item being deleted, i.e. if wxControlWithItems:getSelection/1 returns a valid index greater than or equal to n, the selection is invalidated when this function is called. However if the selected item appears before the item being deleted, the selection is preserved unchanged.

See: wxControlWithItems:clear/1

destroy(This)

-spec destroy(This :: wxChoice()) -> ok.

Destroys the object

getColumns(This)

-spec getColumns(This) -> integer() when This :: wxChoice().

Gets the number of columns in this choice item.

Remark: This is implemented for GTK and Motif only and always returns 1 for the other platforms.

new()

-spec new() -> wxChoice().

Default constructor.

See: create/7

new(Parent, Id)

-spec new(Parent, Id) -> wxChoice() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxChoice()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {choices, [unicode:chardata()]} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a choice.

See: create/7

setColumns(This)

-spec setColumns(This) -> ok when This :: wxChoice().

Equivalent to setColumns(This, []).

setColumns/2

-spec setColumns(This, [Option]) -> ok when This :: wxChoice(), Option :: {n, integer()}.

Sets the number of columns in this choice item.

Remark: This is implemented for GTK and Motif only and doesn’t do anything under other platforms.

wxChoicebook

wxChoicebook is a class similar to wxNotebook, but uses a wxChoice control to show the labels instead of the tabs.

For usage documentation of this class, please refer to the base abstract class wxBookCtrl. You can also use the page_samples_notebook to see wxChoicebook in action.

wxChoicebook allows the use of wxBookCtrlBase::GetControlSizer(), allowing a program to add other controls next to the choice control. This is particularly useful when screen space is restricted, as it often is when wxChoicebook is being employed.

Styles

This class supports the following styles:

wxCHB_DEFAULT: Choose the default location for the labels depending on the current platform (but currently it's the same everywhere, namely wxCHB_TOP).

wxCHB_TOP: Place labels above the page area.

wxCHB_LEFT: Place labels on the left side.

wxCHB_RIGHT: Place labels on the right side.

wxCHB_BOTTOM: Place labels below the page area.

See:

Overview bookctrl

wxNotebook

Examples

This class is derived, and can use functions, from:

wxBookCtrlBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxChoicebook

Events

Event types emitted from this class:

choicebook_page_changed

choicebook_page_changing

Summary

Types

wxChoicebook()

Functions

addPage(This, Page, Text)

Equivalent to addPage(This, Page, Text, []).

addPage/4

Adds a new page.

advanceSelection(This)

Equivalent to advanceSelection(This, []).

advanceSelection/2

Cycles through the tabs.

assignImageList(This, ImageList)

Sets the image list for the page control and takes ownership of the list.

changeSelection(This, Page)

Changes the selection to the given page, returning the previous selection.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Create the choicebook control that has already been constructed with the default constructor.

deleteAllPages(This)

Deletes all pages.

destroy(This)

Destroys the object

getCurrentPage(This)

Returns the currently selected page or NULL.

getImageList(This)

Returns the associated image list, may be NULL.

getPage(This, Page)

Returns the window at the given page position.

getPageCount(This)

Returns the number of pages in the control.

getPageImage(This, NPage)

Returns the image index for the given page.

getPageText(This, NPage)

Returns the string for the given page.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

hitTest(This, Pt)

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

insertPage(This, Index, Page, Text)

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

Inserts a new page at the specified position.

new()

Constructs a choicebook control.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

setImageList(This, ImageList)

Sets the image list to use.

setPageImage(This, Page, Image)

Sets the image index for the given page.

setPageSize(This, Size)

Sets the width and height of the pages.

setPageText(This, Page, Text)

Sets the text for the given page.

setSelection(This, Page)

Sets the selection to the given page, returning the previous selection.

Types

wxChoicebook()

-type wxChoicebook() :: wx:wx_object().

Functions

addPage(This, Page, Text)

-spec addPage(This, Page, Text) -> boolean()
                 when This :: wxChoicebook(), Page :: wxWindow:wxWindow(), Text :: unicode:chardata().

Equivalent to addPage(This, Page, Text, []).

addPage/4

-spec addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxChoicebook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option :: {bSelect, boolean()} | {imageId, integer()}.

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function will generate the page changing and page changed events if select is true, but not when inserting the very first page (as there is no previous page selection to switch from in this case and so it wouldn't make sense to e.g. veto such event).

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: insertPage/5

advanceSelection(This)

-spec advanceSelection(This) -> ok when This :: wxChoicebook().

Equivalent to advanceSelection(This, []).

advanceSelection/2

-spec advanceSelection(This, [Option]) -> ok when This :: wxChoicebook(), Option :: {forward, boolean()}.

Cycles through the tabs.

The call to this function generates the page changing events.

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxChoicebook(), ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list.

See:

wxImageList

setImageList/2

changeSelection(This, Page)

-spec changeSelection(This, Page) -> integer() when This :: wxChoicebook(), Page :: integer().

Changes the selection to the given page, returning the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events.

See overview_events_prog for more information.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxChoicebook(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxChoicebook(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Create the choicebook control that has already been constructed with the default constructor.

deleteAllPages(This)

-spec deleteAllPages(This) -> boolean() when This :: wxChoicebook().

Deletes all pages.

destroy(This)

-spec destroy(This :: wxChoicebook()) -> ok.

Destroys the object

getCurrentPage(This)

-spec getCurrentPage(This) -> wxWindow:wxWindow() when This :: wxChoicebook().

Returns the currently selected page or NULL.

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxChoicebook().

Returns the associated image list, may be NULL.

See:

wxImageList

setImageList/2

getPage(This, Page)

-spec getPage(This, Page) -> wxWindow:wxWindow() when This :: wxChoicebook(), Page :: integer().

Returns the window at the given page position.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxChoicebook().

Returns the number of pages in the control.

getPageImage(This, NPage)

-spec getPageImage(This, NPage) -> integer() when This :: wxChoicebook(), NPage :: integer().

Returns the image index for the given page.

getPageText(This, NPage)

-spec getPageText(This, NPage) -> unicode:charlist() when This :: wxChoicebook(), NPage :: integer().

Returns the string for the given page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxChoicebook().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent:getSelection/1 should be used instead in this case.

hitTest(This, Pt)

-spec hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxChoicebook(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage(This, Index, Page, Text)

-spec insertPage(This, Index, Page, Text) -> boolean()
                    when
                        This :: wxChoicebook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata().

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

-spec insertPage(This, Index, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxChoicebook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: addPage/4

new()

-spec new() -> wxChoicebook().

Constructs a choicebook control.

new(Parent, Id)

-spec new(Parent, Id) -> wxChoicebook() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxChoicebook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxChoicebook(), ImageList :: wxImageList:wxImageList().

Sets the image list to use.

It does not take ownership of the image list, you must delete it yourself.

See:

wxImageList

assignImageList/2

setPageImage(This, Page, Image)

-spec setPageImage(This, Page, Image) -> boolean()
                      when This :: wxChoicebook(), Page :: integer(), Image :: integer().

Sets the image index for the given page.

image is an index into the image list which was set with setImageList/2.

setPageSize(This, Size)

-spec setPageSize(This, Size) -> ok
                     when This :: wxChoicebook(), Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxChoicebook(), Page :: integer(), Text :: unicode:chardata().

Sets the text for the given page.

setSelection(This, Page)

-spec setSelection(This, Page) -> integer() when This :: wxChoicebook(), Page :: integer().

Sets the selection to the given page, returning the previous selection.

Notice that the call to this function generates the page changing events, use the changeSelection/2 function if you don't want these events to be generated.

See: getSelection/1

wxClientDC

wxClientDC is primarily useful for obtaining information about the window from outside EVT_PAINT() handler.

Typical use of this class is to obtain the extent of some text string in order to allocate enough size for a window, e.g.

Note: While wxClientDC may also be used for drawing on the client area of a window from outside an EVT_PAINT() handler in some ports, this does not work on all platforms (neither wxOSX nor wxGTK with GTK 3 Wayland backend support this, so drawing using wxClientDC simply doesn't have any effect there) and the only portable way of drawing is via wxPaintDC. To redraw a small part of the window, use wxWindow:refreshRect/3 to invalidate just this part and check wxWindow:getUpdateRegion/1 in the paint event handler to redraw this part only.

wxClientDC objects should normally be constructed as temporary stack objects, i.e. don't store a wxClientDC object.

A wxClientDC object is initialized to use the same font and colours as the window it is associated with.

See:

wxDC

wxMemoryDC

wxPaintDC

wxWindowDC

wxScreenDC

This class is derived, and can use functions, from:

wxWindowDC

wxDC

wxWidgets docs: wxClientDC

Summary

Types

wxClientDC()

Functions

destroy(This)

Destroys the object

new(Window)

Constructor.

Types

wxClientDC()

-type wxClientDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxClientDC()) -> ok.

Destroys the object

new(Window)

-spec new(Window) -> wxClientDC() when Window :: wxWindow:wxWindow().

Constructor.

Pass a pointer to the window on which you wish to paint.

wxClipboard

A class for manipulating the clipboard.

To use the clipboard, you call member functions of the global ?wxTheClipboard object.

See the overview_dataobject for further information.

Call open/1 to get ownership of the clipboard. If this operation returns true, you now own the clipboard. Call setData/2 to put data on the clipboard, or getData/2 to retrieve data from the clipboard. Call close/1 to close the clipboard and relinquish ownership. You should keep the clipboard open only momentarily.

For example:

Note: On GTK, the clipboard behavior can vary depending on the configuration of the end-user's machine. In order for the clipboard data to persist after the window closes, a clipboard manager must be installed. Some clipboard managers will automatically flush the clipboard after each new piece of data is added, while others will not. The @Flush() function will force the clipboard manager to flush the data.

See:

Overview dnd

Overview dataobject

wxDataObject

wxWidgets docs: wxClipboard

Summary

Types

wxClipboard()

Functions

addData(This, Data)

Call this function to add the data object to the clipboard.

clear(This)

Clears the global clipboard object and the system's clipboard if possible.

close(This)

Call this function to close the clipboard, having opened it with open/1.

destroy(This)

Destroys the object

flush(This)

Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits (possibly eating memory), otherwise the clipboard will be emptied on exit.

get()

Returns the global instance (wxTheClipboard) of the clipboard object.

getData(This, Data)

Call this function to fill data with data on the clipboard, if available in the required format.

isOpened(This)

Returns true if the clipboard has been opened.

isSupported(This, Format)

Returns true if there is data which matches the data format of the given data object currently available on the clipboard.

new()

Default constructor.

open(This)

Call this function to open the clipboard before calling setData/2 and getData/2.

setData(This, Data)

Call this function to set the data object to the clipboard.

usePrimarySelection(This)

Equivalent to usePrimarySelection(This, []).

usePrimarySelection/2

On platforms supporting it (all X11-based ports), wxClipboard uses the CLIPBOARD X11 selection by default.

Types

wxClipboard()

-type wxClipboard() :: wx:wx_object().

Functions

addData(This, Data)

-spec addData(This, Data) -> boolean() when This :: wxClipboard(), Data :: wxDataObject:wxDataObject().

Call this function to add the data object to the clipboard.

This is an obsolete synonym for setData/2.

clear(This)

-spec clear(This) -> ok when This :: wxClipboard().

Clears the global clipboard object and the system's clipboard if possible.

close(This)

-spec close(This) -> ok when This :: wxClipboard().

Call this function to close the clipboard, having opened it with open/1.

destroy(This)

-spec destroy(This :: wxClipboard()) -> ok.

Destroys the object

flush(This)

-spec flush(This) -> boolean() when This :: wxClipboard().

Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits (possibly eating memory), otherwise the clipboard will be emptied on exit.

Currently this method is implemented in MSW and GTK and always returns false otherwise.

Note: On GTK, only the non-primary selection can be flushed. Calling this function when the clipboard is using the primary selection will return false and not make any data available after the program exits.

Return: false if the operation is unsuccessful for any reason.

get()

-spec get() -> wxClipboard().

Returns the global instance (wxTheClipboard) of the clipboard object.

getData(This, Data)

-spec getData(This, Data) -> boolean() when This :: wxClipboard(), Data :: wxDataObject:wxDataObject().

Call this function to fill data with data on the clipboard, if available in the required format.

Returns true on success.

isOpened(This)

-spec isOpened(This) -> boolean() when This :: wxClipboard().

Returns true if the clipboard has been opened.

isSupported(This, Format)

-spec isSupported(This, Format) -> boolean() when This :: wxClipboard(), Format :: wx:wx_enum().

Returns true if there is data which matches the data format of the given data object currently available on the clipboard.

new()

-spec new() -> wxClipboard().

Default constructor.

open(This)

-spec open(This) -> boolean() when This :: wxClipboard().

Call this function to open the clipboard before calling setData/2 and getData/2.

Call close/1 when you have finished with the clipboard. You should keep the clipboard open for only a very short time.

Return: true on success. This should be tested (as in the sample shown above).

setData(This, Data)

-spec setData(This, Data) -> boolean() when This :: wxClipboard(), Data :: wxDataObject:wxDataObject().

Call this function to set the data object to the clipboard.

The new data object replaces any previously set one, so if the application wants to provide clipboard data in several different formats, it must use a composite data object supporting all of the formats instead of calling this function several times with different data objects as this would only leave data from the last one in the clipboard.

After this function has been called, the clipboard owns the data, so do not delete the data explicitly.

usePrimarySelection(This)

-spec usePrimarySelection(This) -> ok when This :: wxClipboard().

Equivalent to usePrimarySelection(This, []).

usePrimarySelection/2

-spec usePrimarySelection(This, [Option]) -> ok
                             when This :: wxClipboard(), Option :: {primary, boolean()}.

On platforms supporting it (all X11-based ports), wxClipboard uses the CLIPBOARD X11 selection by default.

When this function is called with true, all subsequent clipboard operations will use PRIMARY selection until this function is called again with false.

On the other platforms, there is no PRIMARY selection and so all clipboard operations will fail. This allows implementing the standard X11 handling of the clipboard which consists in copying data to the CLIPBOARD selection only when the user explicitly requests it (i.e. by selecting the "Copy" menu command) but putting the currently selected text into the PRIMARY selection automatically, without overwriting the normal clipboard contents with the currently selected text on the other platforms.

wxClipboardTextEvent

This class represents the events generated by a control (typically a wxTextCtrl but other windows can generate these events as well) when its content gets copied or cut to, or pasted from the clipboard.

There are three types of corresponding events wxEVT_TEXT_COPY, wxEVT_TEXT_CUT and wxEVT_TEXT_PASTE.

If any of these events is processed (without being skipped) by an event handler, the corresponding operation doesn't take place which allows preventing the text from being copied from or pasted to a control. It is also possible to examine the clipboard contents in the PASTE event handler and transform it in some way before inserting in a control - for example, changing its case or removing invalid characters.

Finally notice that a CUT event is always preceded by the COPY event which makes it possible to only process the latter if it doesn't matter if the text was copied or cut.

Note: These events are currently only generated by wxTextCtrl in wxGTK and wxOSX but are also generated by wxComboBox without wxCB_READONLY style in wxMSW.

See: wxClipboard

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxClipboardTextEvent

Events

Use wxEvtHandler:connect/3 with wxClipboardTextEventType to subscribe to events of this type.

Summary

Types

wxClipboardText()

wxClipboardTextEvent()

wxClipboardTextEventType()

Types

wxClipboardText()

-type wxClipboardText() :: #wxClipboardText{type :: wxClipboardTextEvent:wxClipboardTextEventType()}.

wxClipboardTextEvent()

-type wxClipboardTextEvent() :: wx:wx_object().

wxClipboardTextEventType()

-type wxClipboardTextEventType() :: command_text_copy | command_text_cut | command_text_paste.

wxCloseEvent

This event class contains information about window and session close events.

The handler function for EVT_CLOSE is called when the user has tried to close a a frame or dialog box using the window manager (X) or system menu (Windows). It can also be invoked by the application itself programmatically, for example by calling the wxWindow:close/2 function.

You should check whether the application is forcing the deletion of the window using canVeto/1. If this is false, you must destroy the window using wxWindow:'Destroy'/1.

If the return value is true, it is up to you whether you respond by destroying the window.

If you don't destroy the window, you should call veto/2 to let the calling code know that you did not destroy the window. This allows the wxWindow:close/2 function to return true or false depending on whether the close instruction was honoured or not.

Example of a wxCloseEvent handler:

The EVT_END_SESSION event is slightly different as it is sent by the system when the user session is ending (e.g. because of log out or shutdown) and so all windows are being forcefully closed. At least under MSW, after the handler for this event is executed the program is simply killed by the system. Because of this, the default handler for this event provided by wxWidgets calls all the usual cleanup code (including wxApp::OnExit() (not implemented in wx)) so that it could still be executed and exit()s the process itself, without waiting for being killed. If this behaviour is for some reason undesirable, make sure that you define a handler for this event in your wxApp-derived class and do not call event.Skip() in it (but be aware that the system will still kill your application).

See:

wxWindow:close/2

Overview windowdeletion

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxCloseEvent

Events

Use wxEvtHandler:connect/3 with wxCloseEventType to subscribe to events of this type.

Summary

Types

wxClose()

wxCloseEvent()

wxCloseEventType()

Functions

canVeto(This)

Returns true if you can veto a system shutdown or a window close event.

getLoggingOff(This)

Returns true if the user is just logging off or false if the system is shutting down.

setCanVeto(This, CanVeto)

Sets the 'can veto' flag.

setLoggingOff(This, LoggingOff)

Sets the 'logging off' flag.

veto(This)

Equivalent to veto(This, []).

veto/2

Call this from your event handler to veto a system shutdown or to signal to the calling application that a window close did not happen.

Types

wxClose()

-type wxClose() :: #wxClose{type :: wxCloseEvent:wxCloseEventType()}.

wxCloseEvent()

-type wxCloseEvent() :: wx:wx_object().

wxCloseEventType()

-type wxCloseEventType() :: close_window | end_session | query_end_session.

Functions

canVeto(This)

-spec canVeto(This) -> boolean() when This :: wxCloseEvent().

Returns true if you can veto a system shutdown or a window close event.

Vetoing a window close event is not possible if the calling code wishes to force the application to exit, and so this function must be called to check this.

getLoggingOff(This)

-spec getLoggingOff(This) -> boolean() when This :: wxCloseEvent().

Returns true if the user is just logging off or false if the system is shutting down.

This method can only be called for end session and query end session events, it doesn't make sense for close window event.

setCanVeto(This, CanVeto)

-spec setCanVeto(This, CanVeto) -> ok when This :: wxCloseEvent(), CanVeto :: boolean().

Sets the 'can veto' flag.

setLoggingOff(This, LoggingOff)

-spec setLoggingOff(This, LoggingOff) -> ok when This :: wxCloseEvent(), LoggingOff :: boolean().

Sets the 'logging off' flag.

veto(This)

-spec veto(This) -> ok when This :: wxCloseEvent().

Equivalent to veto(This, []).

veto/2

-spec veto(This, [Option]) -> ok when This :: wxCloseEvent(), Option :: {veto, boolean()}.

Call this from your event handler to veto a system shutdown or to signal to the calling application that a window close did not happen.

You can only veto a shutdown if canVeto/1 returns true.

wxColourData

This class holds a variety of information related to colour dialogs.

See:

wx_color()

wxColourDialog

Overview cmndlg

wxWidgets docs: wxColourData

Summary

Types

wxColourData()

Functions

destroy(This)

Destroys the object

getChooseFull(This)

Under Windows, determines whether the Windows colour dialog will display the full dialog with custom colour selection controls.

getColour(This)

Gets the current colour associated with the colour dialog.

getCustomColour(This, I)

Returns custom colours associated with the colour dialog.

new()

Constructor.

setChooseFull(This, Flag)

Under Windows, tells the Windows colour dialog to display the full dialog with custom colour selection controls.

setColour(This, Colour)

Sets the default colour for the colour dialog.

setCustomColour(This, I, Colour)

Sets custom colours for the colour dialog.

Types

wxColourData()

-type wxColourData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxColourData()) -> ok.

Destroys the object

getChooseFull(This)

-spec getChooseFull(This) -> boolean() when This :: wxColourData().

Under Windows, determines whether the Windows colour dialog will display the full dialog with custom colour selection controls.

Has no meaning under other platforms.

The default value is true.

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxColourData().

Gets the current colour associated with the colour dialog.

The default colour is black.

getCustomColour(This, I)

-spec getCustomColour(This, I) -> wx:wx_colour4() when This :: wxColourData(), I :: integer().

Returns custom colours associated with the colour dialog.

new()

-spec new() -> wxColourData().

Constructor.

Initializes the custom colours to wxNullColour, the data colour setting to black, and the choose full setting to true.

setChooseFull(This, Flag)

-spec setChooseFull(This, Flag) -> ok when This :: wxColourData(), Flag :: boolean().

Under Windows, tells the Windows colour dialog to display the full dialog with custom colour selection controls.

Under other platforms, has no effect.

The default value is true.

setColour(This, Colour)

-spec setColour(This, Colour) -> ok when This :: wxColourData(), Colour :: wx:wx_colour().

Sets the default colour for the colour dialog.

The default colour is black.

setCustomColour(This, I, Colour)

-spec setCustomColour(This, I, Colour) -> ok
                         when This :: wxColourData(), I :: integer(), Colour :: wx:wx_colour().

Sets custom colours for the colour dialog.

wxColourDialog

This class represents the colour chooser dialog.

Starting from wxWidgets 3.1.3 and currently in the MSW port only, this dialog generates wxEVT_COLOUR_CHANGED events while it is being shown, i.e. from inside its wxDialog:showModal/1 method, that notify the program about the change of the currently selected colour and allow it to e.g. preview the effect of selecting this colour. Note that if you react to this event, you should also correctly revert to the previously selected colour if the dialog is cancelled by the user.

Example of using this class with dynamic feedback for the selected colour:

See:

Overview cmndlg

wx_color()

wxColourData

?wxGetColourFromUser()

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxColourDialog

Summary

Types

wxColourDialog()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Same as new/2.

destroy(This)

Destroys the object

getColourData(This)

Returns the colour data associated with the colour dialog.

new()

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

Types

wxColourDialog()

-type wxColourDialog() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxColourDialog(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxColourDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Option :: {data, wxColourData:wxColourData()}.

Same as new/2.

destroy(This)

-spec destroy(This :: wxColourDialog()) -> ok.

Destroys the object

getColourData(This)

-spec getColourData(This) -> wxColourData:wxColourData() when This :: wxColourDialog().

Returns the colour data associated with the colour dialog.

new()

-spec new() -> wxColourDialog().

new(Parent)

-spec new(Parent) -> wxColourDialog() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxColourDialog()
             when Parent :: wxWindow:wxWindow(), Option :: {data, wxColourData:wxColourData()}.

Constructor.

Pass a parent window, and optionally a pointer to a block of colour data, which will be copied to the colour dialog's colour data.

Custom colours from colour data object will be used in the dialog's colour palette. Invalid entries in custom colours list will be ignored on some platforms(GTK) or replaced with white colour on platforms where custom colours palette has fixed size (MSW).

See: wxColourData

wxColourPickerCtrl

This control allows the user to select a colour.

The generic implementation is a button which brings up a wxColourDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the colour-chooser dialog. It is only available if wxUSE_COLOURPICKERCTRL is set to 1 (the default).

Styles

This class supports the following styles:

wxCLRP_DEFAULT_STYLE: The default style: 0.

wxCLRP_USE_TEXTCTRL: Creates a text control to the left of the picker button which is completely managed by the wxColourPickerCtrl and which can be used by the user to specify a colour (see SetColour). The text control is automatically synchronized with button's value. Use functions defined in wxPickerBase to modify the text control.

wxCLRP_SHOW_LABEL: Shows the colour in HTML form (AABBCC) as colour button label (instead of no label at all).

wxCLRP_SHOW_ALPHA: Allows selecting opacity in the colour-chooser (effective under wxGTK and wxOSX).

See:

wxColourDialog

wxColourPickerEvent

This class is derived, and can use functions, from:

wxPickerBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxColourPickerCtrl

Events

Event types emitted from this class:

command_colourpicker_changed

Summary

Types

wxColourPickerCtrl()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates a colour picker with the given arguments.

destroy(This)

Destroys the object

getColour(This)

Returns the currently selected colour.

new()

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Initializes the object and calls create/4 with all the parameters.

setColour/2

Sets the currently selected colour.

Types

wxColourPickerCtrl()

-type wxColourPickerCtrl() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxColourPickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxColourPickerCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {col, wx:wx_colour()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates a colour picker with the given arguments.

Return: true if the control was successfully created or false if creation failed.

destroy(This)

-spec destroy(This :: wxColourPickerCtrl()) -> ok.

Destroys the object

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxColourPickerCtrl().

Returns the currently selected colour.

new()

-spec new() -> wxColourPickerCtrl().

new(Parent, Id)

-spec new(Parent, Id) -> wxColourPickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxColourPickerCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {col, wx:wx_colour()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Initializes the object and calls create/4 with all the parameters.

setColour/2

-spec setColour(This, Colname) -> ok when This :: wxColourPickerCtrl(), Colname :: unicode:chardata();
               (This, Col) -> ok when This :: wxColourPickerCtrl(), Col :: wx:wx_colour().

Sets the currently selected colour.

See wxColour::Set() (not implemented in wx).

wxColourPickerEvent

This event class is used for the events generated by wxColourPickerCtrl.

See: wxColourPickerCtrl

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxColourPickerEvent

Events

Use wxEvtHandler:connect/3 with wxColourPickerEventType to subscribe to events of this type.

Summary

Types

wxColourPicker()

wxColourPickerEvent()

wxColourPickerEventType()

Functions

getColour(This)

Retrieve the colour the user has just selected.

Types

wxColourPicker()

-type wxColourPicker() ::
          #wxColourPicker{type :: wxColourPickerEvent:wxColourPickerEventType(),
                          colour :: wx:wx_colour()}.

wxColourPickerEvent()

-type wxColourPickerEvent() :: wx:wx_object().

wxColourPickerEventType()

-type wxColourPickerEventType() :: command_colourpicker_changed.

Functions

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxColourPickerEvent().

Retrieve the colour the user has just selected.

wxComboBox

A combobox is like a combination of an edit control and a listbox.

It can be displayed as static list with editable or read-only text field; or a drop-down list with text field; or a drop-down list without a text field depending on the platform and presence of wxCB_READONLY style.

A combobox permits a single selection only. Combobox items are numbered from zero.

If you need a customized combobox, have a look at wxComboCtrl (not implemented in wx), wxOwnerDrawnComboBox (not implemented in wx), wxComboPopup (not implemented in wx) and the ready-to-use wxBitmapComboBox (not implemented in wx).

Please refer to wxTextEntry (not implemented in wx) documentation for the description of methods operating with the text entry part of the combobox and to wxItemContainer (not implemented in wx) for the methods operating with the list of strings. Notice that at least under MSW wxComboBox doesn't behave correctly if it contains strings differing in case only so portable programs should avoid adding such strings to this control.

Styles

This class supports the following styles:

wxCB_SIMPLE: Creates a combobox with a permanently displayed list. Windows only.

wxCB_DROPDOWN: Creates a combobox with a drop-down list. MSW and Motif only.

wxCB_READONLY: A combobox with this style behaves like a wxChoice (and may look in the same way as well, although this is platform-dependent), i.e. it allows the user to choose from the list of options but doesn't allow to enter a value not present in the list.

wxCB_SORT: Sorts the entries in the list alphabetically.

wxTE_PROCESS_ENTER: The control will generate the event wxEVT_TEXT_ENTER that can be handled by the program. Otherwise, i.e. either if this style not specified at all, or it is used, but there is no event handler for this event or the event handler called wxEvent:skip/2 to avoid overriding the default handling, pressing Enter key is either processed internally by the control or used to activate the default button of the dialog, if any.

See:

wxListBox

wxTextCtrl

wxChoice

wxCommandEvent

This class is derived, and can use functions, from:

wxControlWithItems

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxComboBox

Events

Event types emitted from this class:

command_combobox_selected

command_text_updated

command_text_enter

combobox_dropdown

combobox_closeup

Summary

Types

wxComboBox()

Functions

canCopy(This)

Returns true if the selection can be copied to the clipboard.

canCut(This)

Returns true if the selection can be cut to the clipboard.

canPaste(This)

Returns true if the contents of the clipboard can be pasted into the text control.

canRedo(This)

Returns true if there is a redo facility available and the last operation can be redone.

canUndo(This)

Returns true if there is an undo facility available and the last operation can be undone.

copy(This)

Copies the selected text to the clipboard.

create(This, Parent, Id, Value, Pos, Size, Choices)

Equivalent to create(This, Parent, Id, Value, Pos, Size, Choices, []).

create/8

cut(This)

Copies the selected text to the clipboard and removes it from the control.

destroy(This)

Destroys the object

getInsertionPoint(This)

Same as wxTextCtrl:getInsertionPoint/1.

getLastPosition(This)

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

getValue(This)

Gets the contents of the control.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a combobox.

paste(This)

Pastes text from the clipboard to the text item.

redo(This)

If there is a redo facility and the last operation can be redone, redoes the last operation.

remove(This, From, To)

Removes the text starting at the first given position up to (but not including) the character at the last position.

replace(This, From, To, Value)

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

setInsertionPoint(This, Pos)

Sets the insertion point at the given position.

setInsertionPointEnd(This)

Sets the insertion point at the end of the text control.

setSelection(This, N)

Sets the selection to the given item n or removes the selection entirely if n == wxNOT\_FOUND.

setSelection(This, From, To)

Same as wxTextCtrl:setSelection/3.

setValue(This, Text)

Sets the text for the combobox text field.

undo(This)

If there is an undo facility and the last operation can be undone, undoes the last operation.

Types

wxComboBox()

-type wxComboBox() :: wx:wx_object().

Functions

canCopy(This)

-spec canCopy(This) -> boolean() when This :: wxComboBox().

Returns true if the selection can be copied to the clipboard.

canCut(This)

-spec canCut(This) -> boolean() when This :: wxComboBox().

Returns true if the selection can be cut to the clipboard.

canPaste(This)

-spec canPaste(This) -> boolean() when This :: wxComboBox().

Returns true if the contents of the clipboard can be pasted into the text control.

On some platforms (Motif, GTK) this is an approximation and returns true if the control is editable, false otherwise.

canRedo(This)

-spec canRedo(This) -> boolean() when This :: wxComboBox().

Returns true if there is a redo facility available and the last operation can be redone.

canUndo(This)

-spec canUndo(This) -> boolean() when This :: wxComboBox().

Returns true if there is an undo facility available and the last operation can be undone.

copy(This)

-spec copy(This) -> ok when This :: wxComboBox().

Copies the selected text to the clipboard.

create(This, Parent, Id, Value, Pos, Size, Choices)

-spec create(This, Parent, Id, Value, Pos, Size, Choices) -> boolean()
                when
                    This :: wxComboBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Value :: unicode:chardata(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()].

Equivalent to create(This, Parent, Id, Value, Pos, Size, Choices, []).

create/8

-spec create(This, Parent, Id, Value, Pos, Size, Choices, [Option]) -> boolean()
                when
                    This :: wxComboBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Value :: unicode:chardata(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()],
                    Option :: {style, integer()} | {validator, wx:wx_object()}.

cut(This)

-spec cut(This) -> ok when This :: wxComboBox().

Copies the selected text to the clipboard and removes it from the control.

destroy(This)

-spec destroy(This :: wxComboBox()) -> ok.

Destroys the object

getInsertionPoint(This)

-spec getInsertionPoint(This) -> integer() when This :: wxComboBox().

Same as wxTextCtrl:getInsertionPoint/1.

Note: Under wxMSW, this function always returns 0 if the combobox doesn't have the focus.

getLastPosition(This)

-spec getLastPosition(This) -> integer() when This :: wxComboBox().

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

getValue(This)

-spec getValue(This) -> unicode:charlist() when This :: wxComboBox().

Gets the contents of the control.

Notice that for a multiline text control, the lines will be separated by (Unix-style) \n characters, even under Windows where they are separated by a \r\n sequence in the native control.

new()

-spec new() -> wxComboBox().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxComboBox() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxComboBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {value, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {choices, [unicode:chardata()]} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a combobox.

See: create/8

paste(This)

-spec paste(This) -> ok when This :: wxComboBox().

Pastes text from the clipboard to the text item.

redo(This)

-spec redo(This) -> ok when This :: wxComboBox().

If there is a redo facility and the last operation can be redone, redoes the last operation.

Does nothing if there is no redo facility.

remove(This, From, To)

-spec remove(This, From, To) -> ok when This :: wxComboBox(), From :: integer(), To :: integer().

Removes the text starting at the first given position up to (but not including) the character at the last position.

This function puts the current insertion point position at to as a side effect.

replace(This, From, To, Value)

-spec replace(This, From, To, Value) -> ok
                 when
                     This :: wxComboBox(),
                     From :: integer(),
                     To :: integer(),
                     Value :: unicode:chardata().

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

This function puts the current insertion point position at to as a side effect.

setInsertionPoint(This, Pos)

-spec setInsertionPoint(This, Pos) -> ok when This :: wxComboBox(), Pos :: integer().

Sets the insertion point at the given position.

setInsertionPointEnd(This)

-spec setInsertionPointEnd(This) -> ok when This :: wxComboBox().

Sets the insertion point at the end of the text control.

This is equivalent to calling setInsertionPoint/2 with getLastPosition/1 argument.

setSelection(This, N)

-spec setSelection(This, N) -> ok when This :: wxComboBox(), N :: integer().

Sets the selection to the given item n or removes the selection entirely if n == wxNOT\_FOUND.

Note that this does not cause any command events to be emitted nor does it deselect any other items in the controls which support multiple selections.

See:

wxControlWithItems:setString/3

wxControlWithItems:setStringSelection/2

setSelection(This, From, To)

-spec setSelection(This, From, To) -> ok when This :: wxComboBox(), From :: integer(), To :: integer().

Same as wxTextCtrl:setSelection/3.

setValue(This, Text)

-spec setValue(This, Text) -> ok when This :: wxComboBox(), Text :: unicode:chardata().

Sets the text for the combobox text field.

For normal, editable comboboxes with a text entry field calling this method will generate a wxEVT_TEXT event, consistently with wxTextCtrl:setValue/2 behaviour, use wxTextCtrl:changeValue/2 if this is undesirable.

For controls with wxCB_READONLY style the method behaves somewhat differently: the string must be in the combobox choices list (the check for this is case-insensitive) and wxEVT_TEXT is not generated in this case.

undo(This)

-spec undo(This) -> ok when This :: wxComboBox().

If there is an undo facility and the last operation can be undone, undoes the last operation.

Does nothing if there is no undo facility.

wxCommandEvent

This event class contains information about command events, which originate from a variety of simple controls.

Note that wxCommandEvents and wxCommandEvent-derived event classes by default and unlike other wxEvent-derived classes propagate upward from the source window (the window which emits the event) up to the first parent which processes the event. Be sure to read overview_events_propagation.

More complex controls, such as wxTreeCtrl, have separate command event classes.

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxCommandEvent

Events

Use wxEvtHandler:connect/3 with wxCommandEventType to subscribe to events of this type.

Summary

Types

wxCommand()

wxCommandEvent()

wxCommandEventType()

Functions

getClientData(This)

Returns client object pointer for a listbox or choice selection event (not valid for a deselection).

getExtraLong(This)

Returns extra information dependent on the event objects type.

getInt(This)

Returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

getSelection(This)

Returns item index for a listbox or choice selection event (not valid for a deselection).

getString(This)

Returns item string for a listbox or choice selection event.

isChecked(This)

This method can be used with checkbox and menu events: for the checkboxes, the method returns true for a selection event and false for a deselection one.

isSelection(This)

For a listbox or similar event, returns true if it is a selection, false if it is a deselection.

setInt(This, IntCommand)

Sets the m_commandInt member.

setString(This, String)

Sets the m_commandString member.

Types

wxCommand()

-type wxCommand() ::
          #wxCommand{type :: wxCommandEvent:wxCommandEventType(),
                     cmdString :: unicode:chardata(),
                     commandInt :: integer(),
                     extraLong :: integer()}.

wxCommandEvent()

-type wxCommandEvent() :: wx:wx_object().

wxCommandEventType()

-type wxCommandEventType() ::
          command_button_clicked | command_checkbox_clicked | command_choice_selected |
          command_listbox_selected | command_listbox_doubleclicked | command_text_updated |
          command_text_enter | text_maxlen | command_menu_selected | command_slider_updated |
          command_radiobox_selected | command_radiobutton_selected | command_scrollbar_updated |
          command_vlbox_selected | command_combobox_selected | combobox_dropdown | combobox_closeup |
          command_tool_rclicked | command_tool_enter | tool_dropdown | command_checklistbox_toggled |
          command_togglebutton_clicked | command_left_click | command_left_dclick |
          command_right_click | command_set_focus | command_kill_focus | command_enter |
          notification_message_click | notification_message_dismissed | notification_message_action.

Functions

getClientData(This)

-spec getClientData(This) -> term() when This :: wxCommandEvent().

Returns client object pointer for a listbox or choice selection event (not valid for a deselection).

getExtraLong(This)

-spec getExtraLong(This) -> integer() when This :: wxCommandEvent().

Returns extra information dependent on the event objects type.

If the event comes from a listbox selection, it is a boolean determining whether the event was a selection (true) or a deselection (false). A listbox deselection only occurs for multiple-selection boxes, and in this case the index and string values are indeterminate and the listbox must be examined by the application.

getInt(This)

-spec getInt(This) -> integer() when This :: wxCommandEvent().

Returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

For a menu item, this method returns -1 if the item is not checkable or a boolean value (true or false) for checkable items indicating the new state of the item.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxCommandEvent().

Returns item index for a listbox or choice selection event (not valid for a deselection).

getString(This)

-spec getString(This) -> unicode:charlist() when This :: wxCommandEvent().

Returns item string for a listbox or choice selection event.

If one or several items have been deselected, returns the index of the first deselected item. If some items have been selected and others deselected at the same time, it will return the index of the first selected item.

isChecked(This)

-spec isChecked(This) -> boolean() when This :: wxCommandEvent().

This method can be used with checkbox and menu events: for the checkboxes, the method returns true for a selection event and false for a deselection one.

For the menu events, this method indicates if the menu item just has become checked or unchecked (and thus only makes sense for checkable menu items).

Notice that this method cannot be used with wxCheckListBox currently.

isSelection(This)

-spec isSelection(This) -> boolean() when This :: wxCommandEvent().

For a listbox or similar event, returns true if it is a selection, false if it is a deselection.

If some items have been selected and others deselected at the same time, it will return true.

setInt(This, IntCommand)

-spec setInt(This, IntCommand) -> ok when This :: wxCommandEvent(), IntCommand :: integer().

Sets the m_commandInt member.

setString(This, String)

-spec setString(This, String) -> ok when This :: wxCommandEvent(), String :: unicode:chardata().

Sets the m_commandString member.

wxContextMenuEvent

This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a wxWindow.

Note that if getPosition/1 returns wxDefaultPosition, this means that the event originated from a keyboard context button event, and you should compute a suitable position yourself, for example by calling wx_misc:getMousePosition/0.

Notice that the exact sequence of mouse events is different across the platforms. For example, under MSW the context menu event is generated after EVT_RIGHT_UP event and only if it was not handled but under GTK the context menu event is generated after EVT_RIGHT_DOWN event. This is correct in the sense that it ensures that the context menu is shown according to the current platform UI conventions and also means that you must not handle (or call wxEvent:skip/2 in your handler if you do have one) neither right mouse down nor right mouse up event if you plan on handling EVT_CONTEXT_MENU event.

See:

wxCommandEvent

Overview events

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxContextMenuEvent

Events

Use wxEvtHandler:connect/3 with wxContextMenuEventType to subscribe to events of this type.

Summary

Types

wxContextMenu()

wxContextMenuEvent()

wxContextMenuEventType()

Functions

getPosition(This)

Returns the position in screen coordinates at which the menu should be shown.

setPosition(This, Point)

Sets the position at which the menu should be shown.

Types

wxContextMenu()

-type wxContextMenu() ::
          #wxContextMenu{type :: wxContextMenuEvent:wxContextMenuEventType(),
                         pos :: {X :: integer(), Y :: integer()}}.

wxContextMenuEvent()

-type wxContextMenuEvent() :: wx:wx_object().

wxContextMenuEventType()

-type wxContextMenuEventType() :: context_menu.

Functions

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxContextMenuEvent().

Returns the position in screen coordinates at which the menu should be shown.

Use wxWindow:screenToClient/2 to convert to client coordinates.

You can also omit a position from wxWindow:popupMenu/4 in order to use the current mouse pointer position.

If the event originated from a keyboard event, the value returned from this function will be wxDefaultPosition.

setPosition(This, Point)

-spec setPosition(This, Point) -> ok
                     when This :: wxContextMenuEvent(), Point :: {X :: integer(), Y :: integer()}.

Sets the position at which the menu should be shown.

wxControl

This is the base class for a control or "widget".

A control is generally a small window which processes user input and/or displays one or more item of data.

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxControl

Events

Event types emitted from this class:

command_text_copy

command_text_cut

command_text_paste

Summary

Types

wxControl()

Functions

getLabel(This)

Returns the control's label, as it was passed to setLabel/2.

setLabel(This, Label)

Sets the control's label.

Types

wxControl()

-type wxControl() :: wx:wx_object().

Functions

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxControl().

Returns the control's label, as it was passed to setLabel/2.

Note that the returned string may contains mnemonics ("&" characters) if they were passed to the setLabel/2 function; use GetLabelText() (not implemented in wx) if they are undesired.

Also note that the returned string is always the string which was passed to setLabel/2 but may be different from the string passed to SetLabelText() (not implemented in wx) (since this last one escapes mnemonic characters).

setLabel(This, Label)

-spec setLabel(This, Label) -> ok when This :: wxControl(), Label :: unicode:chardata().

Sets the control's label.

All "&" characters in the label are special and indicate that the following character is a mnemonic for this control and can be used to activate it from the keyboard (typically by using Alt key in combination with it). To insert a literal ampersand character, you need to double it, i.e. use "&&". If this behaviour is undesirable, use SetLabelText() (not implemented in wx) instead.

wxControlWithItems

This is convenience class that derives from both wxControl and wxItemContainer (not implemented in wx).

It is used as basis for some wxWidgets controls (wxChoice and wxListBox).

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxControlWithItems

Summary

Types

wxControlWithItems()

Functions

append(This, Item)

Appends item into the control.

append(This, Item, ClientData)

Appends item into the control.

appendStrings(This, Items)

Appends several items at once into the control.

appendStrings(This, Items, ClientsData)

Appends several items at once into the control.

clear(This)

Removes all items from the control.

delete(This, N)

Deletes an item from the control.

findString(This, String)

Equivalent to findString(This, String, []).

findString/3

Finds an item whose label matches the given string.

getClientData(This, N)

Returns a pointer to the client data associated with the given item (if any).

getCount(This)

Returns the number of items in the control.

getSelection(This)

Returns the index of the selected item or wxNOT\_FOUND if no item is selected.

getString(This, N)

Returns the label of the item with the given index.

getStringSelection(This)

Returns the label of the selected item or an empty string if no item is selected.

insert(This, Item, Pos)

Inserts item into the control.

insert(This, Item, Pos, ClientData)

Inserts item into the control.

insertStrings(This, Items, Pos)

Inserts several items at once into the control.

insertStrings(This, Items, Pos, ClientsData)

Inserts several items at once into the control.

isEmpty(This)

Returns true if the control is empty or false if it has some items.

select(This, N)

This is the same as setSelection/2 and exists only because it is slightly more natural for controls which support multiple selection.

setClientData(This, N, Data)

Associates the given typed client data pointer with the given item: the data object will be deleted when the item is deleted (either explicitly by using delete/2 or implicitly when the control itself is destroyed).

setSelection(This, N)

Sets the selection to the given item n or removes the selection entirely if n == wxNOT\_FOUND.

setString(This, N, String)

Sets the label for the given item.

setStringSelection(This, String)

Selects the item with the specified string in the control.

Types

wxControlWithItems()

-type wxControlWithItems() :: wx:wx_object().

Functions

append(This, Item)

-spec append(This, Item) -> integer() when This :: wxControlWithItems(), Item :: unicode:chardata().

Appends item into the control.

Return: The return value is the index of the newly inserted item. Note that this may be different from the last one if the control is sorted (e.g. has wxLB_SORT or wxCB_SORT style).

append(This, Item, ClientData)

-spec append(This, Item, ClientData) -> integer()
                when This :: wxControlWithItems(), Item :: unicode:chardata(), ClientData :: term().

Appends item into the control.

Return: The return value is the index of the newly inserted item. Note that this may be different from the last one if the control is sorted (e.g. has wxLB_SORT or wxCB_SORT style).

appendStrings(This, Items)

-spec appendStrings(This, Items) -> integer()
                       when This :: wxControlWithItems(), Items :: [unicode:chardata()].

Appends several items at once into the control.

Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.

appendStrings(This, Items, ClientsData)

-spec appendStrings(This, Items, ClientsData) -> integer()
                       when
                           This :: wxControlWithItems(),
                           Items :: [unicode:chardata()],
                           ClientsData :: [term()].

Appends several items at once into the control.

Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.

clear(This)

-spec clear(This) -> ok when This :: wxControlWithItems().

Removes all items from the control.

clear/1 also deletes the client data of the existing items if it is owned by the control.

delete(This, N)

-spec delete(This, N) -> ok when This :: wxControlWithItems(), N :: integer().

Deletes an item from the control.

The client data associated with the item will be also deleted if it is owned by the control. Note that it is an error (signalled by an assert failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control.

If there is a currently selected item below the item being deleted, i.e. if getSelection/1 returns a valid index greater than or equal to n, the selection is invalidated when this function is called. However if the selected item appears before the item being deleted, the selection is preserved unchanged.

See: clear/1

findString(This, String)

-spec findString(This, String) -> integer()
                    when This :: wxControlWithItems(), String :: unicode:chardata().

Equivalent to findString(This, String, []).

findString/3

-spec findString(This, String, [Option]) -> integer()
                    when
                        This :: wxControlWithItems(),
                        String :: unicode:chardata(),
                        Option :: {bCase, boolean()}.

Finds an item whose label matches the given string.

Return: The zero-based position of the item, or wxNOT_FOUND if the string was not found.

getClientData(This, N)

-spec getClientData(This, N) -> term() when This :: wxControlWithItems(), N :: integer().

Returns a pointer to the client data associated with the given item (if any).

It is an error to call this function for a control which doesn't have typed client data at all although it is OK to call it even if the given item doesn't have any client data associated with it (but other items do).

Notice that the returned pointer is still owned by the control and will be deleted by it, use DetachClientObject() (not implemented in wx) if you want to remove the pointer from the control.

Return: A pointer to the client data, or NULL if not present.

getCount(This)

-spec getCount(This) -> integer() when This :: wxControlWithItems().

Returns the number of items in the control.

See: isEmpty/1

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxControlWithItems().

Returns the index of the selected item or wxNOT\_FOUND if no item is selected.

Return: The position of the current selection.

Remark: This method can be used with single selection list boxes only, you should use wxListBox:getSelections/1 for the list boxes with wxLB_MULTIPLE style.

See:

setSelection/2

getStringSelection/1

getString(This, N)

-spec getString(This, N) -> unicode:charlist() when This :: wxControlWithItems(), N :: integer().

Returns the label of the item with the given index.

Return: The label of the item or an empty string if the position was invalid.

getStringSelection(This)

-spec getStringSelection(This) -> unicode:charlist() when This :: wxControlWithItems().

Returns the label of the selected item or an empty string if no item is selected.

See: getSelection/1

insert(This, Item, Pos)

-spec insert(This, Item, Pos) -> integer()
                when This :: wxControlWithItems(), Item :: unicode:chardata(), Pos :: integer().

Inserts item into the control.

Return: The return value is the index of the newly inserted item. If the insertion failed for some reason, -1 is returned.

insert(This, Item, Pos, ClientData)

-spec insert(This, Item, Pos, ClientData) -> integer()
                when
                    This :: wxControlWithItems(),
                    Item :: unicode:chardata(),
                    Pos :: integer(),
                    ClientData :: term().

Inserts item into the control.

Return: The return value is the index of the newly inserted item. If the insertion failed for some reason, -1 is returned.

insertStrings(This, Items, Pos)

-spec insertStrings(This, Items, Pos) -> integer()
                       when
                           This :: wxControlWithItems(), Items :: [unicode:chardata()], Pos :: integer().

Inserts several items at once into the control.

Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.

Return: The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.

insertStrings(This, Items, Pos, ClientsData)

-spec insertStrings(This, Items, Pos, ClientsData) -> integer()
                       when
                           This :: wxControlWithItems(),
                           Items :: [unicode:chardata()],
                           Pos :: integer(),
                           ClientsData :: [term()].

Inserts several items at once into the control.

Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items.

Return: The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned.

isEmpty(This)

-spec isEmpty(This) -> boolean() when This :: wxControlWithItems().

Returns true if the control is empty or false if it has some items.

See: getCount/1

select(This, N)

-spec select(This, N) -> ok when This :: wxControlWithItems(), N :: integer().

This is the same as setSelection/2 and exists only because it is slightly more natural for controls which support multiple selection.

setClientData(This, N, Data)

-spec setClientData(This, N, Data) -> ok
                       when This :: wxControlWithItems(), N :: integer(), Data :: term().

Associates the given typed client data pointer with the given item: the data object will be deleted when the item is deleted (either explicitly by using delete/2 or implicitly when the control itself is destroyed).

Note that it is an error to call this function if any untyped client data pointers had been associated with the control items before.

setSelection(This, N)

-spec setSelection(This, N) -> ok when This :: wxControlWithItems(), N :: integer().

Sets the selection to the given item n or removes the selection entirely if n == wxNOT\_FOUND.

Note that this does not cause any command events to be emitted nor does it deselect any other items in the controls which support multiple selections.

See:

setString/3

setStringSelection/2

setString(This, N, String)

-spec setString(This, N, String) -> ok
                   when This :: wxControlWithItems(), N :: integer(), String :: unicode:chardata().

Sets the label for the given item.

setStringSelection(This, String)

-spec setStringSelection(This, String) -> boolean()
                            when This :: wxControlWithItems(), String :: unicode:chardata().

Selects the item with the specified string in the control.

This method doesn't cause any command events to be emitted.

Notice that this method is case-insensitive, i.e. the string is compared with all the elements of the control case-insensitively and the first matching entry is selected, even if it doesn't have exactly the same case as this string and there is an exact match afterwards.

Return: true if the specified string has been selected, false if it wasn't found in the control.

wxCursor

A cursor is a small bitmap usually used for denoting where the mouse pointer is, with a picture that might indicate the interpretation of a mouse click.

As with icons, cursors in X and MS Windows are created in a different manner. Therefore, separate cursors will be created for the different environments. Platform-specific methods for creating a wxCursor object are catered for, and this is an occasion where conditional compilation will probably be required (see wxIcon for an example).

A single cursor object may be used in many windows (any subwindow type). The wxWidgets convention is to set the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global wx_misc:setCursor/1 function is also available for MS Windows use.

Creating a Custom Cursor

The following is an example of creating a cursor from 32x32 bitmap data (down_bits) and a mask (down_mask) where 1 is black and 0 is white for the bits, and 1 is opaque and 0 is transparent for the mask. It works on Windows and GTK+.

Predefined objects (include wx.hrl):

?wxNullCursor

?wxSTANDARD_CURSOR

?wxHOURGLASS_CURSOR

?wxCROSS_CURSOR

See:

wxBitmap

wxIcon

wxWindow:setCursor/2

wx_misc:setCursor/1

?wxStockCursor

This class is derived, and can use functions, from:

wxBitmap

wxWidgets docs: wxCursor

Summary

Types

wxCursor()

Functions

destroy(This)

Destroys the object

isOk(This)

Returns true if cursor data is present.

new()

Default constructor.

new/1

Constructs a cursor using a cursor identifier.

new(CursorName, Options)

Constructs a cursor by passing a string resource name or filename.

ok(This)

Equivalent to: isOk/1

Types

wxCursor()

-type wxCursor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxCursor()) -> ok.

Destroys the object

isOk(This)

-spec isOk(This) -> boolean() when This :: wxCursor().

Returns true if cursor data is present.

new()

-spec new() -> wxCursor().

Default constructor.

new/1

-spec new(CursorName) -> wxCursor() when CursorName :: unicode:chardata();
         (Image) -> wxCursor() when Image :: wxImage:wxImage() | wxCursor:wxCursor();
         (CursorId) -> wxCursor() when CursorId :: wx:wx_enum().

Constructs a cursor using a cursor identifier.

new(CursorName, Options)

-spec new(CursorName, [Option]) -> wxCursor()
             when
                 CursorName :: unicode:chardata(),
                 Option :: {type, wx:wx_enum()} | {hotSpotX, integer()} | {hotSpotY, integer()}.

Constructs a cursor by passing a string resource name or filename.

The arguments hotSpotX and hotSpotY are only used when there's no hotspot info in the resource/image-file to load (e.g. when using wxBITMAP_TYPE_ICO under wxMSW or wxBITMAP_TYPE_XPM under wxGTK).

ok(This)

-spec ok(This) -> boolean() when This :: wxCursor().

Equivalent to: isOk/1

wxDC

A wxDC is a "device context" onto which graphics and text can be drawn.

It is intended to represent different output devices and offers a common abstract API for drawing on any of them.

wxWidgets offers an alternative drawing API based on the modern drawing backends GDI+, CoreGraphics, Cairo and Direct2D. See wxGraphicsContext, wxGraphicsRenderer and related classes. There is also a wxGCDC linking the APIs by offering the wxDC API on top of a wxGraphicsContext.

wxDC is an abstract base class and cannot be created directly. Use wxPaintDC, wxClientDC, wxWindowDC, wxScreenDC, wxMemoryDC or wxPrinterDC (not implemented in wx). Notice that device contexts which are associated with windows (i.e. wxClientDC, wxWindowDC and wxPaintDC) use the window font and colours by default (starting with wxWidgets 2.9.0) but the other device context classes use system-default values so you always must set the appropriate fonts and colours before using them.

In addition to the versions of the methods documented below, there are also versions which accept single {X,Y} parameter instead of the two wxCoord ones or {X,Y} and {Width,Height} instead of the four wxCoord parameters.

Beginning with wxWidgets 2.9.0 the entire wxDC code has been reorganized. All platform dependent code (actually all drawing code) has been moved into backend classes which derive from a common wxDCImpl class. The user-visible classes such as wxClientDC and wxPaintDC merely forward all calls to the backend implementation.

Device and logical units

In the wxDC context there is a distinction between logical units and device units.

Device units are the units native to the particular device; e.g. for a screen, a device unit is a pixel. For a printer, the device unit is defined by the resolution of the printer (usually given in DPI: dot-per-inch).

All wxDC functions use instead logical units, unless where explicitly stated. Logical units are arbitrary units mapped to device units using the current mapping mode (see setMapMode/2).

This mechanism allows reusing the same code which prints on e.g. a window on the screen to print on e.g. a paper.

Support for Transparency / Alpha Channel

In general wxDC methods don't support alpha transparency and the alpha component of wx_color() is simply ignored and you need to use wxGraphicsContext for full transparency support. There are, however, a few exceptions: first, under macOS and GTK+ 3 colours with alpha channel are supported in all the normal wxDC-derived classes as they use wxGraphicsContext internally. Second, under all platforms wxSVGFileDC (not implemented in wx) also fully supports alpha channel. In both of these cases the instances of wxPen or wxBrush that are built from wx_color() use the colour's alpha values when stroking or filling.

Support for Transformation Matrix

On some platforms (currently under MSW, GTK+ 3, macOS) wxDC has support for applying an arbitrary affine transformation matrix to its coordinate system (since 3.1.1 this feature is also supported by wxGCDC in all ports). Call CanUseTransformMatrix() (not implemented in wx) to check if this support is available and then call SetTransformMatrix() (not implemented in wx) if it is. If the transformation matrix is not supported, SetTransformMatrix() (not implemented in wx) always simply returns false and doesn't do anything.

This feature is only available when wxUSE_DC_TRANSFORM_MATRIX build option is enabled.

See:

Overview dc

wxGraphicsContext

wxWidgets docs: wxDC

Summary

Types

wxDC()

Functions

blit(This, Dest, Size, Source, Src)

Equivalent to blit(This, Dest, Size, Source, Src, []).

blit/6

Copy from a source DC to this DC.

calcBoundingBox(This, X, Y)

Adds the specified point to the bounding box which can be retrieved with minX/1, maxX/1 and minY/1, maxY/1 functions.

clear(This)

Clears the device context using the current background brush.

crossHair(This, Pt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

destroyClippingRegion(This)

Destroys the current clipping region so that none of the DC is clipped.

deviceToLogicalX(This, X)

Convert device X coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

deviceToLogicalXRel(This, X)

Convert device X coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

deviceToLogicalY(This, Y)

Converts device Y coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

deviceToLogicalYRel(This, Y)

Convert device Y coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

drawArc(This, PtStart, PtEnd, Centre)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawBitmap(This, Bmp, Pt)

Equivalent to drawBitmap(This, Bmp, Pt, []).

drawBitmap/4

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawCheckMark(This, Rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawCircle(This, Pt, Radius)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipse(This, Rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipse(This, Pt, Size)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipticArc(This, Pt, Sz, Sa, Ea)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawIcon(This, Icon, Pt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLabel(This, Text, Rect)

Equivalent to drawLabel(This, Text, Rect, []).

drawLabel/4

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLine(This, Pt1, Pt2)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLines(This, Points)

Equivalent to drawLines(This, Points, []).

drawLines/3

Draws lines using an array of points of size n adding the optional offset coordinate.

drawPoint(This, Pt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawPolygon(This, Points)

Equivalent to drawPolygon(This, Points, []).

drawPolygon/3

Draws a filled polygon using an array of points of size n, adding the optional offset coordinate.

drawRectangle(This, Rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRectangle(This, Pt, Sz)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRotatedText(This, Text, Point, Angle)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRoundedRectangle(This, Rect, Radius)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRoundedRectangle(This, Pt, Sz, Radius)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawText(This, Text, Pt)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

endDoc(This)

Ends a document (only relevant when outputting to a printer).

endPage(This)

Ends a document page (only relevant when outputting to a printer).

floodFill(This, Pt, Col)

Equivalent to floodFill(This, Pt, Col, []).

floodFill/4

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getBackground(This)

Gets the brush used for painting the background.

getBackgroundMode(This)

Returns the current background mode: wxPENSTYLE\_SOLID or wxPENSTYLE\_TRANSPARENT.

getBrush(This)

Gets the current brush.

getCharHeight(This)

Gets the character height of the currently set font.

getCharWidth(This)

Gets the average character width of the currently set font.

getClippingBox(This)

Gets the rectangle surrounding the current clipping region. If no clipping region is set this function returns the extent of the device context. @remarks Clipping region is given in logical coordinates. @param x If non-<span class='literal'>NULL</span>, filled in with the logical horizontal coordinate of the top left corner of the clipping region if the function returns true or 0 otherwise. @param y If non-<span class='literal'>NULL</span>, filled in with the logical vertical coordinate of the top left corner of the clipping region if the function returns true or 0 otherwise. @param width If non-<span class='literal'>NULL</span>, filled in with the width of the clipping region if the function returns true or the device context width otherwise. @param height If non-<span class='literal'>NULL</span>, filled in with the height of the clipping region if the function returns true or the device context height otherwise.

getFont(This)

Gets the current font.

getLayoutDirection(This)

Gets the current layout direction of the device context.

getLogicalFunction(This)

Gets the current logical function.

getMapMode(This)

Gets the current mapping mode for the device context.

getMultiLineTextExtent(This, String)

Gets the dimensions of the string using the currently selected font.

getMultiLineTextExtent/3

Gets the dimensions of the string using the currently selected font.

getPartialTextExtents(This, Text)

Fills the widths array with the widths from the beginning of text to the corresponding character of text.

getPen(This)

Gets the current pen.

getPixel(This, Pos)

Gets in colour the colour at the specified location.

getPPI(This)

Returns the resolution of the device in pixels per inch.

getSize(This)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getSizeMM(This)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getTextBackground(This)

Gets the current text background colour.

getTextExtent(This, String)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getTextExtent/3

Gets the dimensions of the string using the currently selected font.

getTextForeground(This)

Gets the current text foreground colour.

getUserScale(This)

Gets the current user scale factor.

gradientFillConcentric(This, Rect, InitialColour, DestColour)

Fill the area specified by rect with a radial gradient, starting from initialColour at the centre of the circle and fading to destColour on the circle outside.

gradientFillConcentric(This, Rect, InitialColour, DestColour, CircleCenter)

Fill the area specified by rect with a radial gradient, starting from initialColour at the centre of the circle and fading to destColour on the circle outside.

gradientFillLinear(This, Rect, InitialColour, DestColour)

Equivalent to gradientFillLinear(This, Rect, InitialColour, DestColour, []).

gradientFillLinear/5

Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour.

isOk(This)

Returns true if the DC is ok to use.

logicalToDeviceX(This, X)

Converts logical X coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

logicalToDeviceXRel(This, X)

Converts logical X coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

logicalToDeviceY(This, Y)

Converts logical Y coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

logicalToDeviceYRel(This, Y)

Converts logical Y coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

maxX(This)

Gets the maximum horizontal extent used in drawing commands so far.

maxY(This)

Gets the maximum vertical extent used in drawing commands so far.

minX(This)

Gets the minimum horizontal extent used in drawing commands so far.

minY(This)

Gets the minimum vertical extent used in drawing commands so far.

resetBoundingBox(This)

Resets the bounding box: after a call to this function, the bounding box doesn't contain anything.

setAxisOrientation(This, XLeftRight, YBottomUp)

Sets the x and y axis orientation (i.e. the direction from lowest to highest values on the axis).

setBackground(This, Brush)

Sets the current background brush for the DC.

setBackgroundMode(This, Mode)

mode may be one of wxPENSTYLE\_SOLID and wxPENSTYLE\_TRANSPARENT.

setBrush(This, Brush)

Sets the current brush for the DC.

setClippingRegion(This, Rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setClippingRegion(This, Pt, Sz)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setDeviceOrigin(This, X, Y)

Sets the device origin (i.e. the origin in pixels after scaling has been applied).

setFont(This, Font)

Sets the current font for the DC.

setLayoutDirection(This, Dir)

Sets the current layout direction for the device context.

setLogicalFunction(This, Function)

Sets the current logical function for the device context.

setMapMode(This, Mode)

The mapping mode of the device context defines the unit of measurement used to convert logical units to device units.

setPalette(This, Palette)

If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC.

setPen(This, Pen)

Sets the current pen for the DC.

setTextBackground(This, Colour)

Sets the current text background colour for the DC.

setTextForeground(This, Colour)

Sets the current text foreground colour for the DC.

setUserScale(This, XScale, YScale)

Sets the user scaling factor, useful for applications which require 'zooming'.

startDoc(This, Message)

Starts a document (only relevant when outputting to a printer).

startPage(This)

Starts a document page (only relevant when outputting to a printer).

Types

wxDC()

-type wxDC() :: wx:wx_object().

Functions

blit(This, Dest, Size, Source, Src)

-spec blit(This, Dest, Size, Source, Src) -> boolean()
              when
                  This :: wxDC(),
                  Dest :: {X :: integer(), Y :: integer()},
                  Size :: {W :: integer(), H :: integer()},
                  Source :: wxDC(),
                  Src :: {X :: integer(), Y :: integer()}.

Equivalent to blit(This, Dest, Size, Source, Src, []).

blit/6

-spec blit(This, Dest, Size, Source, Src, [Option]) -> boolean()
              when
                  This :: wxDC(),
                  Dest :: {X :: integer(), Y :: integer()},
                  Size :: {W :: integer(), H :: integer()},
                  Source :: wxDC(),
                  Src :: {X :: integer(), Y :: integer()},
                  Option ::
                      {rop, wx:wx_enum()} |
                      {useMask, boolean()} |
                      {srcPtMask, {X :: integer(), Y :: integer()}}.

Copy from a source DC to this DC.

With this method you can specify the destination coordinates and the size of area to copy which will be the same for both the source and target DCs. If you need to apply scaling while copying, use StretchBlit() (not implemented in wx).

Notice that source DC coordinates xsrc and ysrc are interpreted using the current source DC coordinate system, i.e. the scale, origin position and axis directions are taken into account when transforming them to physical (pixel) coordinates.

Remark: There is partial support for blit/6 in wxPostScriptDC, under X.

See:

wxMemoryDC

wxBitmap

wxMask

calcBoundingBox(This, X, Y)

-spec calcBoundingBox(This, X, Y) -> ok when This :: wxDC(), X :: integer(), Y :: integer().

Adds the specified point to the bounding box which can be retrieved with minX/1, maxX/1 and minY/1, maxY/1 functions.

See: resetBoundingBox/1

clear(This)

-spec clear(This) -> ok when This :: wxDC().

Clears the device context using the current background brush.

Note that setBackground/2 method must be used to set the brush used by clear/1, the brush used for filling the shapes set by setBrush/2 is ignored by it.

If no background brush was set, solid white brush is used to clear the device context.

crossHair(This, Pt)

-spec crossHair(This, Pt) -> ok when This :: wxDC(), Pt :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

destroyClippingRegion(This)

-spec destroyClippingRegion(This) -> ok when This :: wxDC().

Destroys the current clipping region so that none of the DC is clipped.

See: setClippingRegion/3

deviceToLogicalX(This, X)

-spec deviceToLogicalX(This, X) -> integer() when This :: wxDC(), X :: integer().

Convert device X coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

deviceToLogicalXRel(This, X)

-spec deviceToLogicalXRel(This, X) -> integer() when This :: wxDC(), X :: integer().

Convert device X coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

Use this for converting a width, for example.

deviceToLogicalY(This, Y)

-spec deviceToLogicalY(This, Y) -> integer() when This :: wxDC(), Y :: integer().

Converts device Y coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

deviceToLogicalYRel(This, Y)

-spec deviceToLogicalYRel(This, Y) -> integer() when This :: wxDC(), Y :: integer().

Convert device Y coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

Use this for converting a height, for example.

drawArc(This, PtStart, PtEnd, Centre)

-spec drawArc(This, PtStart, PtEnd, Centre) -> ok
                 when
                     This :: wxDC(),
                     PtStart :: {X :: integer(), Y :: integer()},
                     PtEnd :: {X :: integer(), Y :: integer()},
                     Centre :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawBitmap(This, Bmp, Pt)

-spec drawBitmap(This, Bmp, Pt) -> ok
                    when
                        This :: wxDC(),
                        Bmp :: wxBitmap:wxBitmap(),
                        Pt :: {X :: integer(), Y :: integer()}.

Equivalent to drawBitmap(This, Bmp, Pt, []).

drawBitmap/4

-spec drawBitmap(This, Bmp, Pt, [Option]) -> ok
                    when
                        This :: wxDC(),
                        Bmp :: wxBitmap:wxBitmap(),
                        Pt :: {X :: integer(), Y :: integer()},
                        Option :: {useMask, boolean()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawCheckMark(This, Rect)

-spec drawCheckMark(This, Rect) -> ok
                       when
                           This :: wxDC(),
                           Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawCircle(This, Pt, Radius)

-spec drawCircle(This, Pt, Radius) -> ok
                    when This :: wxDC(), Pt :: {X :: integer(), Y :: integer()}, Radius :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipse(This, Rect)

-spec drawEllipse(This, Rect) -> ok
                     when
                         This :: wxDC(),
                         Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipse(This, Pt, Size)

-spec drawEllipse(This, Pt, Size) -> ok
                     when
                         This :: wxDC(),
                         Pt :: {X :: integer(), Y :: integer()},
                         Size :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawEllipticArc(This, Pt, Sz, Sa, Ea)

-spec drawEllipticArc(This, Pt, Sz, Sa, Ea) -> ok
                         when
                             This :: wxDC(),
                             Pt :: {X :: integer(), Y :: integer()},
                             Sz :: {W :: integer(), H :: integer()},
                             Sa :: number(),
                             Ea :: number().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawIcon(This, Icon, Pt)

-spec drawIcon(This, Icon, Pt) -> ok
                  when This :: wxDC(), Icon :: wxIcon:wxIcon(), Pt :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLabel(This, Text, Rect)

-spec drawLabel(This, Text, Rect) -> ok
                   when
                       This :: wxDC(),
                       Text :: unicode:chardata(),
                       Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Equivalent to drawLabel(This, Text, Rect, []).

drawLabel/4

-spec drawLabel(This, Text, Rect, [Option]) -> ok
                   when
                       This :: wxDC(),
                       Text :: unicode:chardata(),
                       Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                       Option :: {alignment, integer()} | {indexAccel, integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLine(This, Pt1, Pt2)

-spec drawLine(This, Pt1, Pt2) -> ok
                  when
                      This :: wxDC(),
                      Pt1 :: {X :: integer(), Y :: integer()},
                      Pt2 :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawLines(This, Points)

-spec drawLines(This, Points) -> ok when This :: wxDC(), Points :: [{X :: integer(), Y :: integer()}].

Equivalent to drawLines(This, Points, []).

drawLines/3

-spec drawLines(This, Points, [Option]) -> ok
                   when
                       This :: wxDC(),
                       Points :: [{X :: integer(), Y :: integer()}],
                       Option :: {xoffset, integer()} | {yoffset, integer()}.

Draws lines using an array of points of size n adding the optional offset coordinate.

The current pen is used for drawing the lines.

drawPoint(This, Pt)

-spec drawPoint(This, Pt) -> ok when This :: wxDC(), Pt :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawPolygon(This, Points)

-spec drawPolygon(This, Points) -> ok when This :: wxDC(), Points :: [{X :: integer(), Y :: integer()}].

Equivalent to drawPolygon(This, Points, []).

drawPolygon/3

-spec drawPolygon(This, Points, [Option]) -> ok
                     when
                         This :: wxDC(),
                         Points :: [{X :: integer(), Y :: integer()}],
                         Option ::
                             {xoffset, integer()} | {yoffset, integer()} | {fillStyle, wx:wx_enum()}.

Draws a filled polygon using an array of points of size n, adding the optional offset coordinate.

The first and last points are automatically closed.

The last argument specifies the fill rule: wxODDEVEN_RULE (the default) or wxWINDING_RULE.

The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling.

drawRectangle(This, Rect)

-spec drawRectangle(This, Rect) -> ok
                       when
                           This :: wxDC(),
                           Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRectangle(This, Pt, Sz)

-spec drawRectangle(This, Pt, Sz) -> ok
                       when
                           This :: wxDC(),
                           Pt :: {X :: integer(), Y :: integer()},
                           Sz :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRotatedText(This, Text, Point, Angle)

-spec drawRotatedText(This, Text, Point, Angle) -> ok
                         when
                             This :: wxDC(),
                             Text :: unicode:chardata(),
                             Point :: {X :: integer(), Y :: integer()},
                             Angle :: number().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRoundedRectangle(This, Rect, Radius)

-spec drawRoundedRectangle(This, Rect, Radius) -> ok
                              when
                                  This :: wxDC(),
                                  Rect ::
                                      {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                                  Radius :: number().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawRoundedRectangle(This, Pt, Sz, Radius)

-spec drawRoundedRectangle(This, Pt, Sz, Radius) -> ok
                              when
                                  This :: wxDC(),
                                  Pt :: {X :: integer(), Y :: integer()},
                                  Sz :: {W :: integer(), H :: integer()},
                                  Radius :: number().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

drawText(This, Text, Pt)

-spec drawText(This, Text, Pt) -> ok
                  when
                      This :: wxDC(), Text :: unicode:chardata(), Pt :: {X :: integer(), Y :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

endDoc(This)

-spec endDoc(This) -> ok when This :: wxDC().

Ends a document (only relevant when outputting to a printer).

endPage(This)

-spec endPage(This) -> ok when This :: wxDC().

Ends a document page (only relevant when outputting to a printer).

floodFill(This, Pt, Col)

-spec floodFill(This, Pt, Col) -> boolean()
                   when This :: wxDC(), Pt :: {X :: integer(), Y :: integer()}, Col :: wx:wx_colour().

Equivalent to floodFill(This, Pt, Col, []).

floodFill/4

-spec floodFill(This, Pt, Col, [Option]) -> boolean()
                   when
                       This :: wxDC(),
                       Pt :: {X :: integer(), Y :: integer()},
                       Col :: wx:wx_colour(),
                       Option :: {style, wx:wx_enum()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getBackground(This)

-spec getBackground(This) -> wxBrush:wxBrush() when This :: wxDC().

Gets the brush used for painting the background.

See: setBackground/2

getBackgroundMode(This)

-spec getBackgroundMode(This) -> integer() when This :: wxDC().

Returns the current background mode: wxPENSTYLE\_SOLID or wxPENSTYLE\_TRANSPARENT.

See: setBackgroundMode/2

getBrush(This)

-spec getBrush(This) -> wxBrush:wxBrush() when This :: wxDC().

Gets the current brush.

See: setBrush/2

getCharHeight(This)

-spec getCharHeight(This) -> integer() when This :: wxDC().

Gets the character height of the currently set font.

getCharWidth(This)

-spec getCharWidth(This) -> integer() when This :: wxDC().

Gets the average character width of the currently set font.

getClippingBox(This)

-spec getClippingBox(This) -> Result
                        when
                            Result ::
                                {X :: integer(),
                                 Y :: integer(),
                                 Width :: integer(),
                                 Height :: integer()},
                            This :: wxDC().

Gets the rectangle surrounding the current clipping region. If no clipping region is set this function returns the extent of the device context. @remarks Clipping region is given in logical coordinates. @param x If non-<span class='literal'>NULL</span>, filled in with the logical horizontal coordinate of the top left corner of the clipping region if the function returns true or 0 otherwise. @param y If non-<span class='literal'>NULL</span>, filled in with the logical vertical coordinate of the top left corner of the clipping region if the function returns true or 0 otherwise. @param width If non-<span class='literal'>NULL</span>, filled in with the width of the clipping region if the function returns true or the device context width otherwise. @param height If non-<span class='literal'>NULL</span>, filled in with the height of the clipping region if the function returns true or the device context height otherwise.

Return: true if there is a clipping region or false if there is no active clipping region (note that this return value is available only since wxWidgets 3.1.2, this function didn't return anything in the previous versions).

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxDC().

Gets the current font.

Notice that even although each device context object has some default font after creation, this method would return a ?wxNullFont initially and only after calling setFont/2 a valid font is returned.

getLayoutDirection(This)

-spec getLayoutDirection(This) -> wx:wx_enum() when This :: wxDC().

Gets the current layout direction of the device context.

On platforms where RTL layout is supported, the return value will either be wxLayout_LeftToRight or wxLayout_RightToLeft. If RTL layout is not supported, the return value will be wxLayout_Default.

See: setLayoutDirection/2

getLogicalFunction(This)

-spec getLogicalFunction(This) -> wx:wx_enum() when This :: wxDC().

Gets the current logical function.

See: setLogicalFunction/2

getMapMode(This)

-spec getMapMode(This) -> wx:wx_enum() when This :: wxDC().

Gets the current mapping mode for the device context.

See: setMapMode/2

getMultiLineTextExtent(This, String)

-spec getMultiLineTextExtent(This, String) -> {W :: integer(), H :: integer()}
                                when This :: wxDC(), String :: unicode:chardata().

Gets the dimensions of the string using the currently selected font.

string is the text string to measure.

Return: The text extent as a {Width,Height} object.

Note: This function works with both single-line and multi-line strings.

See:

wxFont

setFont/2

getPartialTextExtents/2

getTextExtent/3

getMultiLineTextExtent/3

-spec getMultiLineTextExtent(This, String, [Option]) ->
                                {W :: integer(), H :: integer(), HeightLine :: integer()}
                                when
                                    This :: wxDC(),
                                    String :: unicode:chardata(),
                                    Option :: {font, wxFont:wxFont()}.

Gets the dimensions of the string using the currently selected font.

string is the text string to measure, heightLine, if non NULL, is where to store the height of a single line.

The text extent is set in the given w and h pointers.

If the optional parameter font is specified and valid, then it is used for the text extent calculation, otherwise the currently selected font is used.

If string is empty, its horizontal extent is 0 but, for convenience when using this function for allocating enough space for a possibly multi-line string, its vertical extent is the same as the height of an empty line of text. Please note that this behaviour differs from that of getTextExtent/3.

Note: This function works with both single-line and multi-line strings.

See:

wxFont

setFont/2

getPartialTextExtents/2

getTextExtent/3

getPartialTextExtents(This, Text)

-spec getPartialTextExtents(This, Text) -> Result
                               when
                                   Result :: {Res :: boolean(), Widths :: [integer()]},
                                   This :: wxDC(),
                                   Text :: unicode:chardata().

Fills the widths array with the widths from the beginning of text to the corresponding character of text.

The generic version simply builds a running total of the widths of each character using getTextExtent/3, however if the various platforms have a native API function that is faster or more accurate than the generic implementation then it should be used instead.

See:

getMultiLineTextExtent/3

getTextExtent/3

getPen(This)

-spec getPen(This) -> wxPen:wxPen() when This :: wxDC().

Gets the current pen.

See: setPen/2

getPixel(This, Pos)

-spec getPixel(This, Pos) -> Result
                  when
                      Result :: {Res :: boolean(), Colour :: wx:wx_colour4()},
                      This :: wxDC(),
                      Pos :: {X :: integer(), Y :: integer()}.

Gets in colour the colour at the specified location.

This method isn't available for wxPostScriptDC or wxMetafileDC (not implemented in wx) nor for any DC in wxOSX port and simply returns false there.

Note: Setting a pixel can be done using drawPoint/2.

Note: This method shouldn't be used with wxPaintDC as accessing the DC while drawing can result in unexpected results, notably in wxGTK.

getPPI(This)

-spec getPPI(This) -> {W :: integer(), H :: integer()} when This :: wxDC().

Returns the resolution of the device in pixels per inch.

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxDC().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getSizeMM(This)

-spec getSizeMM(This) -> {W :: integer(), H :: integer()} when This :: wxDC().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getTextBackground(This)

-spec getTextBackground(This) -> wx:wx_colour4() when This :: wxDC().

Gets the current text background colour.

See: setTextBackground/2

getTextExtent(This, String)

-spec getTextExtent(This, String) -> {W :: integer(), H :: integer()}
                       when This :: wxDC(), String :: unicode:chardata().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getTextExtent/3

-spec getTextExtent(This, String, [Option]) -> Result
                       when
                           Result ::
                               {W :: integer(),
                                H :: integer(),
                                Descent :: integer(),
                                ExternalLeading :: integer()},
                           This :: wxDC(),
                           String :: unicode:chardata(),
                           Option :: {theFont, wxFont:wxFont()}.

Gets the dimensions of the string using the currently selected font.

string is the text string to measure, descent is the dimension from the baseline of the font to the bottom of the descender, and externalLeading is any extra vertical space added to the font by the font designer (usually is zero).

The text extent is returned in w and h pointers or as a {Width,Height} object depending on which version of this function is used.

If the optional parameter font is specified and valid, then it is used for the text extent calculation. Otherwise the currently selected font is.

If string is empty, its extent is 0 in both directions, as expected.

Note: This function only works with single-line strings.

See:

wxFont

setFont/2

getPartialTextExtents/2

getMultiLineTextExtent/3

getTextForeground(This)

-spec getTextForeground(This) -> wx:wx_colour4() when This :: wxDC().

Gets the current text foreground colour.

See: setTextForeground/2

getUserScale(This)

-spec getUserScale(This) -> {X :: number(), Y :: number()} when This :: wxDC().

Gets the current user scale factor.

See: setUserScale/3

gradientFillConcentric(This, Rect, InitialColour, DestColour)

-spec gradientFillConcentric(This, Rect, InitialColour, DestColour) -> ok
                                when
                                    This :: wxDC(),
                                    Rect ::
                                        {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                                    InitialColour :: wx:wx_colour(),
                                    DestColour :: wx:wx_colour().

Fill the area specified by rect with a radial gradient, starting from initialColour at the centre of the circle and fading to destColour on the circle outside.

The circle is placed at the centre of rect.

Note: Currently this function is very slow, don't use it for real-time drawing.

gradientFillConcentric(This, Rect, InitialColour, DestColour, CircleCenter)

-spec gradientFillConcentric(This, Rect, InitialColour, DestColour, CircleCenter) -> ok
                                when
                                    This :: wxDC(),
                                    Rect ::
                                        {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                                    InitialColour :: wx:wx_colour(),
                                    DestColour :: wx:wx_colour(),
                                    CircleCenter :: {X :: integer(), Y :: integer()}.

Fill the area specified by rect with a radial gradient, starting from initialColour at the centre of the circle and fading to destColour on the circle outside.

circleCenter are the relative coordinates of centre of the circle in the specified rect.

Note: Currently this function is very slow, don't use it for real-time drawing.

gradientFillLinear(This, Rect, InitialColour, DestColour)

-spec gradientFillLinear(This, Rect, InitialColour, DestColour) -> ok
                            when
                                This :: wxDC(),
                                Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                                InitialColour :: wx:wx_colour(),
                                DestColour :: wx:wx_colour().

Equivalent to gradientFillLinear(This, Rect, InitialColour, DestColour, []).

gradientFillLinear/5

-spec gradientFillLinear(This, Rect, InitialColour, DestColour, [Option]) -> ok
                            when
                                This :: wxDC(),
                                Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                                InitialColour :: wx:wx_colour(),
                                DestColour :: wx:wx_colour(),
                                Option :: {nDirection, wx:wx_enum()}.

Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour.

The nDirection specifies the direction of the colour change, default is to use initialColour on the left part of the rectangle and destColour on the right one.

isOk(This)

-spec isOk(This) -> boolean() when This :: wxDC().

Returns true if the DC is ok to use.

logicalToDeviceX(This, X)

-spec logicalToDeviceX(This, X) -> integer() when This :: wxDC(), X :: integer().

Converts logical X coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

logicalToDeviceXRel(This, X)

-spec logicalToDeviceXRel(This, X) -> integer() when This :: wxDC(), X :: integer().

Converts logical X coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

Use this for converting a width, for example.

logicalToDeviceY(This, Y)

-spec logicalToDeviceY(This, Y) -> integer() when This :: wxDC(), Y :: integer().

Converts logical Y coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.

logicalToDeviceYRel(This, Y)

-spec logicalToDeviceYRel(This, Y) -> integer() when This :: wxDC(), Y :: integer().

Converts logical Y coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.

Use this for converting a height, for example.

maxX(This)

-spec maxX(This) -> integer() when This :: wxDC().

Gets the maximum horizontal extent used in drawing commands so far.

maxY(This)

-spec maxY(This) -> integer() when This :: wxDC().

Gets the maximum vertical extent used in drawing commands so far.

minX(This)

-spec minX(This) -> integer() when This :: wxDC().

Gets the minimum horizontal extent used in drawing commands so far.

minY(This)

-spec minY(This) -> integer() when This :: wxDC().

Gets the minimum vertical extent used in drawing commands so far.

resetBoundingBox(This)

-spec resetBoundingBox(This) -> ok when This :: wxDC().

Resets the bounding box: after a call to this function, the bounding box doesn't contain anything.

See: calcBoundingBox/3

setAxisOrientation(This, XLeftRight, YBottomUp)

-spec setAxisOrientation(This, XLeftRight, YBottomUp) -> ok
                            when This :: wxDC(), XLeftRight :: boolean(), YBottomUp :: boolean().

Sets the x and y axis orientation (i.e. the direction from lowest to highest values on the axis).

The default orientation is x axis from left to right and y axis from top down.

setBackground(This, Brush)

-spec setBackground(This, Brush) -> ok when This :: wxDC(), Brush :: wxBrush:wxBrush().

Sets the current background brush for the DC.

setBackgroundMode(This, Mode)

-spec setBackgroundMode(This, Mode) -> ok when This :: wxDC(), Mode :: integer().

mode may be one of wxPENSTYLE\_SOLID and wxPENSTYLE\_TRANSPARENT.

This setting determines whether text will be drawn with a background colour or not.

setBrush(This, Brush)

-spec setBrush(This, Brush) -> ok when This :: wxDC(), Brush :: wxBrush:wxBrush().

Sets the current brush for the DC.

If the argument is ?wxNullBrush (or another invalid brush; see wxBrush:isOk/1), the current brush is selected out of the device context (leaving wxDC without any valid brush), allowing the current brush to be destroyed safely.

See:

wxBrush

wxMemoryDC

setClippingRegion(This, Rect)

-spec setClippingRegion(This, Rect) -> ok
                           when
                               This :: wxDC(),
                               Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setClippingRegion(This, Pt, Sz)

-spec setClippingRegion(This, Pt, Sz) -> ok
                           when
                               This :: wxDC(),
                               Pt :: {X :: integer(), Y :: integer()},
                               Sz :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setDeviceOrigin(This, X, Y)

-spec setDeviceOrigin(This, X, Y) -> ok when This :: wxDC(), X :: integer(), Y :: integer().

Sets the device origin (i.e. the origin in pixels after scaling has been applied).

This function may be useful in Windows printing operations for placing a graphic on a page.

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxDC(), Font :: wxFont:wxFont().

Sets the current font for the DC.

If the argument is ?wxNullFont (or another invalid font; see wxFont:isOk/1), the current font is selected out of the device context (leaving wxDC without any valid font), allowing the current font to be destroyed safely.

See: wxFont

setLayoutDirection(This, Dir)

-spec setLayoutDirection(This, Dir) -> ok when This :: wxDC(), Dir :: wx:wx_enum().

Sets the current layout direction for the device context.

See: getLayoutDirection/1

setLogicalFunction(This, Function)

-spec setLogicalFunction(This, Function) -> ok when This :: wxDC(), Function :: wx:wx_enum().

Sets the current logical function for the device context.

Note: This function is not fully supported in all ports, due to the limitations of the underlying drawing model. Notably, wxINVERT which was commonly used for drawing rubber bands or other moving outlines in the past, is not, and will not, be supported by wxGTK3 and wxMac. The suggested alternative is to draw temporarily objects normally and refresh the (affected part of the) window to remove them later.

It determines how a source pixel (from a pen or brush colour, or source device context if using blit/6) combines with a destination pixel in the current device context. Text drawing is not affected by this function.

See ?wxRasterOperationMode enumeration values for more info.

The default is wxCOPY, which simply draws with the current colour. The others combine the current colour and the background using a logical operation.

setMapMode(This, Mode)

-spec setMapMode(This, Mode) -> ok when This :: wxDC(), Mode :: wx:wx_enum().

The mapping mode of the device context defines the unit of measurement used to convert logical units to device units.

Note that in X, text drawing isn't handled consistently with the mapping mode; a font is always specified in point size. However, setting the user scale (see setUserScale/3) scales the text appropriately. In Windows, scalable TrueType fonts are always used; in X, results depend on availability of fonts, but usually a reasonable match is found.

The coordinate origin is always at the top left of the screen/printer.

Drawing to a Windows printer device context uses the current mapping mode, but mapping mode is currently ignored for PostScript output.

setPalette(This, Palette)

-spec setPalette(This, Palette) -> ok when This :: wxDC(), Palette :: wxPalette:wxPalette().

If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC.

If the argument is ?wxNullPalette, the current palette is selected out of the device context, and the original palette restored.

See: wxPalette

setPen(This, Pen)

-spec setPen(This, Pen) -> ok when This :: wxDC(), Pen :: wxPen:wxPen().

Sets the current pen for the DC.

If the argument is ?wxNullPen (or another invalid pen; see wxPen:isOk/1), the current pen is selected out of the device context (leaving wxDC without any valid pen), allowing the current pen to be destroyed safely.

See: wxMemoryDC

setTextBackground(This, Colour)

-spec setTextBackground(This, Colour) -> ok when This :: wxDC(), Colour :: wx:wx_colour().

Sets the current text background colour for the DC.

setTextForeground(This, Colour)

-spec setTextForeground(This, Colour) -> ok when This :: wxDC(), Colour :: wx:wx_colour().

Sets the current text foreground colour for the DC.

See: wxMemoryDC

setUserScale(This, XScale, YScale)

-spec setUserScale(This, XScale, YScale) -> ok
                      when This :: wxDC(), XScale :: number(), YScale :: number().

Sets the user scaling factor, useful for applications which require 'zooming'.

startDoc(This, Message)

-spec startDoc(This, Message) -> boolean() when This :: wxDC(), Message :: unicode:chardata().

Starts a document (only relevant when outputting to a printer).

message is a message to show while printing.

startPage(This)

-spec startPage(This) -> ok when This :: wxDC().

Starts a document page (only relevant when outputting to a printer).

wxDCOverlay

Connects an overlay with a drawing DC.

See:

wxOverlay

wxDC

wxWidgets docs: wxDCOverlay

Summary

Types

wxDCOverlay()

Functions

clear(This)

Clears the layer, restoring the state at the last init.

destroy(This)

Destroys the object

new(Overlay, Dc)

Convenience wrapper that behaves the same using the entire area of the dc.

new(Overlay, Dc, X, Y, Width, Height)

Connects this overlay to the corresponding drawing dc, if the overlay is not initialized yet this call will do so.

Types

wxDCOverlay()

-type wxDCOverlay() :: wx:wx_object().

Functions

clear(This)

-spec clear(This) -> ok when This :: wxDCOverlay().

Clears the layer, restoring the state at the last init.

destroy(This)

-spec destroy(This :: wxDCOverlay()) -> ok.

Destroys the object

new(Overlay, Dc)

-spec new(Overlay, Dc) -> wxDCOverlay() when Overlay :: wxOverlay:wxOverlay(), Dc :: wxDC:wxDC().

Convenience wrapper that behaves the same using the entire area of the dc.

new(Overlay, Dc, X, Y, Width, Height)

-spec new(Overlay, Dc, X, Y, Width, Height) -> wxDCOverlay()
             when
                 Overlay :: wxOverlay:wxOverlay(),
                 Dc :: wxDC:wxDC(),
                 X :: integer(),
                 Y :: integer(),
                 Width :: integer(),
                 Height :: integer().

Connects this overlay to the corresponding drawing dc, if the overlay is not initialized yet this call will do so.

wxDataObject

A wxDataObject represents data that can be copied to or from the clipboard, or dragged and dropped.

The important thing about wxDataObject is that this is a 'smart' piece of data unlike 'dumb' data containers such as memory buffers or files. Being 'smart' here means that the data object itself should know what data formats it supports and how to render itself in each of its supported formats.

A supported format, incidentally, is exactly the format in which the data can be requested from a data object or from which the data object may be set. In the general case, an object may support different formats on 'input' and 'output', i.e. it may be able to render itself in a given format but not be created from data on this format or vice versa. wxDataObject defines the wxDataObject::Direction (not implemented in wx) enumeration type which distinguishes between them.

See wxDataFormat (not implemented in wx) documentation for more about formats.

Not surprisingly, being 'smart' comes at a price of added complexity. This is reasonable for the situations when you really need to support multiple formats, but may be annoying if you only want to do something simple like cut and paste text.

To provide a solution for both cases, wxWidgets has two predefined classes which derive from wxDataObject: wxDataObjectSimple (not implemented in wx) and wxDataObjectComposite (not implemented in wx). wxDataObjectSimple (not implemented in wx) is the simplest wxDataObject possible and only holds data in a single format (such as HTML or text) and wxDataObjectComposite (not implemented in wx) is the simplest way to implement a wxDataObject that does support multiple formats because it achieves this by simply holding several wxDataObjectSimple (not implemented in wx) objects.

So, you have several solutions when you need a wxDataObject class (and you need one as soon as you want to transfer data via the clipboard or drag and drop):

Please note that the easiest way to use drag and drop and the clipboard with multiple formats is by using wxDataObjectComposite (not implemented in wx), but it is not the most efficient one as each wxDataObjectSimple (not implemented in wx) would contain the whole data in its respective formats. Now imagine that you want to paste 200 pages of text in your proprietary format, as well as Word, RTF, HTML, Unicode and plain text to the clipboard and even today's computers are in trouble. For this case, you will have to derive from wxDataObject directly and make it enumerate its formats and provide the data in the requested format on demand.

Note that neither the GTK+ data transfer mechanisms for clipboard and drag and drop, nor OLE data transfer, copies any data until another application actually requests the data. This is in contrast to the 'feel' offered to the user of a program who would normally think that the data resides in the clipboard after having pressed 'Copy' - in reality it is only declared to be available.

You may also derive your own data object classes from wxCustomDataObject (not implemented in wx) for user-defined types. The format of user-defined data is given as a mime-type string literal, such as "application/word" or "image/png". These strings are used as they are under Unix (so far only GTK+) to identify a format and are translated into their Windows equivalent under Win32 (using the OLE IDataObject for data exchange to and from the clipboard and for drag and drop). Note that the format string translation under Windows is not yet finished.

Each class derived directly from wxDataObject must override and implement all of its functions which are pure virtual in the base class. The data objects which only render their data or only set it (i.e. work in only one direction), should return 0 from GetFormatCount() (not implemented in wx).

See:

Overview dnd

Examples

wxFileDataObject

wxTextDataObject

wxBitmapDataObject

wxWidgets docs: wxDataObject

Summary

Types

wxDataObject()

Types

wxDataObject()

-type wxDataObject() :: wx:wx_object().

wxDateEvent

This event class holds information about a date change and is used together with wxDatePickerCtrl.

It also serves as a base class for wxCalendarEvent.

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxDateEvent

Summary

Types

wxDate()

wxDateEvent()

wxDateEventType()

Functions

getDate(This)

Returns the date.

Types

wxDate()

-type wxDate() :: #wxDate{type :: wxDateEvent:wxDateEventType(), date :: wx:wx_datetime()}.

wxDateEvent()

-type wxDateEvent() :: wx:wx_object().

wxDateEventType()

-type wxDateEventType() :: date_changed.

Functions

getDate(This)

-spec getDate(This) -> wx:wx_datetime() when This :: wxDateEvent().

Returns the date.

wxDatePickerCtrl

This control allows the user to select a date.

Unlike wxCalendarCtrl, which is a relatively big control, wxDatePickerCtrl is implemented as a small window showing the currently selected date. The control can be edited using the keyboard, and can also display a popup window for more user-friendly date selection, depending on the styles used and the platform.

It is only available if wxUSE_DATEPICKCTRL is set to 1.

Styles

This class supports the following styles:

wxDP_SPIN: Creates a control without a month calendar drop down but with spin-control-like arrows to change individual date components. This style is not supported by the generic version.

wxDP_DROPDOWN: Creates a control with a month calendar drop-down part from which the user can select a date. This style is not supported in OSX/Cocoa native version.

wxDP_DEFAULT: Creates a control with the style that is best supported for the current platform (currently wxDP_SPIN under Windows and OSX/Cocoa and wxDP_DROPDOWN elsewhere).

wxDP_ALLOWNONE: With this style, the control allows the user to not enter any valid date at all. Without it - the default - the control always has some valid date. This style is not supported in OSX/Cocoa native version.

wxDP_SHOWCENTURY: Forces display of the century in the default date format. Without this style the century could be displayed, or not, depending on the default date representation in the system. This style is not supported in OSX/Cocoa native version currently. As can be seen from the remarks above, most of the control style are only supported in the native MSW implementation. In portable code it's recommended to use wxDP_DEFAULT style only, possibly combined with wxDP_SHOWCENTURY (this is also the style used by default if none is specified).

See:

wxCalendarCtrl

wxDateEvent

This class is derived, and can use functions, from:

wxPickerBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxDatePickerCtrl

Events

Event types emitted from this class:

date_changed

Summary

Types

wxDatePickerCtrl()

Functions

destroy(This)

Destroys the object

getRange(This, Dt1, Dt2)

If the control had been previously limited to a range of dates using setRange/3, returns the lower and upper bounds of this range.

getValue(This)

Returns the currently entered date.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Initializes the object and calls Create() (not implemented in wx) with all the parameters.

setRange(This, Dt1, Dt2)

Sets the valid range for the date selection.

setValue(This, Dt)

Changes the current value of the control.

Types

wxDatePickerCtrl()

-type wxDatePickerCtrl() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxDatePickerCtrl()) -> ok.

Destroys the object

getRange(This, Dt1, Dt2)

-spec getRange(This, Dt1, Dt2) -> boolean()
                  when This :: wxDatePickerCtrl(), Dt1 :: wx:wx_datetime(), Dt2 :: wx:wx_datetime().

If the control had been previously limited to a range of dates using setRange/3, returns the lower and upper bounds of this range.

If no range is set (or only one of the bounds is set), dt1 and/or dt2 are set to be invalid.

Notice that when using a native MSW implementation of this control the lower range is always set, even if setRange/3 hadn't been called explicitly, as the native control only supports dates later than year 1601.

Return: false if no range limits are currently set, true if at least one bound is set.

getValue(This)

-spec getValue(This) -> wx:wx_datetime() when This :: wxDatePickerCtrl().

Returns the currently entered date.

For a control with wxDP_ALLOWNONE style the returned value may be invalid if no date is entered, otherwise it is always valid.

new()

-spec new() -> wxDatePickerCtrl().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxDatePickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxDatePickerCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {date, wx:wx_datetime()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Initializes the object and calls Create() (not implemented in wx) with all the parameters.

setRange(This, Dt1, Dt2)

-spec setRange(This, Dt1, Dt2) -> ok
                  when This :: wxDatePickerCtrl(), Dt1 :: wx:wx_datetime(), Dt2 :: wx:wx_datetime().

Sets the valid range for the date selection.

If dt1 is valid, it becomes the earliest date (inclusive) accepted by the control. If dt2 is valid, it becomes the latest possible date.

Notice that if the current value is not inside the new range, it will be adjusted to lie inside it, i.e. calling this method can change the control value, however no events are generated by it.

Remark: If the current value of the control is outside of the newly set range bounds, the behaviour is undefined.

setValue(This, Dt)

-spec setValue(This, Dt) -> ok when This :: wxDatePickerCtrl(), Dt :: wx:wx_datetime().

Changes the current value of the control.

The date should be valid unless the control was created with wxDP_ALLOWNONE style and included in the currently selected range, if any.

Calling this method does not result in a date change event.

wxDialog

A dialog box is a window with a title bar and sometimes a system menu, which can be moved around the screen.

It can contain controls and other windows and is often used to allow the user to make some choice or to answer a question.

Dialogs can be made scrollable, automatically, for computers with low resolution screens: please see overview_dialog_autoscrolling for further details.

Dialogs usually contain either a single button allowing to close the dialog or two buttons, one accepting the changes and the other one discarding them (such button, if present, is automatically activated if the user presses the "Esc" key). By default, buttons with the standard wxID_OK and wxID_CANCEL identifiers behave as expected. Starting with wxWidgets 2.7 it is also possible to use a button with a different identifier instead, see setAffirmativeId/2 and SetEscapeId() (not implemented in wx).

Also notice that the createButtonSizer/2 should be used to create the buttons appropriate for the current platform and positioned correctly (including their order which is platform-dependent).

Modal and Modeless

There are two kinds of dialog, modal and modeless. A modal dialog blocks program flow and user input on other windows until it is dismissed, whereas a modeless dialog behaves more like a frame in that program flow continues, and input in other windows is still possible. To show a modal dialog you should use the showModal/1 method while to show a dialog modelessly you simply use show/2, just as with frames.

Note that the modal dialog is one of the very few examples of wxWindow-derived objects which may be created on the stack and not on the heap. In other words, while most windows would be created like this:

You can achieve the same result with dialogs by using simpler code:

An application can define a wxCloseEvent handler for the dialog to respond to system close events.

Styles

This class supports the following styles:

wxCAPTION: Puts a caption on the dialog box.

wxDEFAULT_DIALOG_STYLE: Equivalent to a combination of wxCAPTION, wxCLOSE_BOX and wxSYSTEM_MENU (the last one is not used under Unix).

wxRESIZE_BORDER: Display a resizable frame around the window.

wxSYSTEM_MENU: Display a system menu.

wxCLOSE_BOX: Displays a close box on the frame.

wxMAXIMIZE_BOX: Displays a maximize box on the dialog.

wxMINIMIZE_BOX: Displays a minimize box on the dialog.

wxTHICK_FRAME: Display a thick frame around the window.

wxSTAY_ON_TOP: The dialog stays on top of all other windows.

wxNO_3D: This style is obsolete and doesn't do anything any more, don't use it in any new code.

wxDIALOG_NO_PARENT: By default, a dialog created with a NULL parent window will be given the application's top level window (not implemented in wx) as parent. Use this style to prevent this from happening and create an orphan dialog. This is not recommended for modal dialogs.

wxDIALOG_EX_CONTEXTHELP: Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send a wxEVT_HELP event if the user clicked on an application window. Note that this is an extended style and must be set by calling wxWindow:setExtraStyle/2 before Create is called (two-step construction).

wxDIALOG_EX_METAL: On macOS, frames with this style will be shown with a metallic look. This is an extra style. Under Unix or Linux, MWM (the Motif Window Manager) or other window managers recognizing the MHM hints should be running for any of these styles to have an effect.

See:

Overview dialog

wxFrame

Overview validator

This class is derived, and can use functions, from:

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxDialog

Events

Event types emitted from this class:

close_window

init_dialog

Summary

Types

wxDialog()

Functions

create(This, Parent, Id, Title)

Equivalent to create(This, Parent, Id, Title, []).

create/5

Used for two-step dialog box construction.

createButtonSizer(This, Flags)

Creates a sizer with standard buttons.

createStdDialogButtonSizer(This, Flags)

Creates a wxStdDialogButtonSizer with standard buttons.

destroy(This)

Destroys the object

endModal(This, RetCode)

Ends a modal dialog, passing a value to be returned from the showModal/1 invocation.

getAffirmativeId(This)

Gets the identifier of the button which works like standard OK button in this dialog.

getReturnCode(This)

Gets the return code for this window.

isModal(This)

Returns true if the dialog box is modal, false otherwise.

new()

Default constructor.

new(Parent, Id, Title)

Equivalent to new(Parent, Id, Title, []).

new/4

Constructor.

setAffirmativeId(This, Id)

Sets the identifier to be used as OK button.

setReturnCode(This, RetCode)

Sets the return code for this window.

show(This)

Equivalent to show(This, []).

show/2

Hides or shows the dialog.

showModal(This)

Shows an application-modal dialog.

Types

wxDialog()

-type wxDialog() :: wx:wx_object().

Functions

create(This, Parent, Id, Title)

-spec create(This, Parent, Id, Title) -> boolean()
                when
                    This :: wxDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Id, Title, []).

create/5

-spec create(This, Parent, Id, Title, [Option]) -> boolean()
                when
                    This :: wxDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Used for two-step dialog box construction.

See: new/4

createButtonSizer(This, Flags)

-spec createButtonSizer(This, Flags) -> wxSizer:wxSizer() when This :: wxDialog(), Flags :: integer().

Creates a sizer with standard buttons.

flags is a bit list of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE, wxHELP, wxNO_DEFAULT.

The sizer lays out the buttons in a manner appropriate to the platform.

This function uses createStdDialogButtonSizer/2 internally for most platforms but doesn't create the sizer at all for the platforms with hardware buttons (such as smartphones) for which it sets up the hardware buttons appropriately and returns NULL, so don't forget to test that the return value is valid before using it.

createStdDialogButtonSizer(This, Flags)

-spec createStdDialogButtonSizer(This, Flags) -> wxStdDialogButtonSizer:wxStdDialogButtonSizer()
                                    when This :: wxDialog(), Flags :: integer().

Creates a wxStdDialogButtonSizer with standard buttons.

flags is a bit list of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE, wxHELP, wxNO_DEFAULT.

The sizer lays out the buttons in a manner appropriate to the platform.

destroy(This)

-spec destroy(This :: wxDialog()) -> ok.

Destroys the object

endModal(This, RetCode)

-spec endModal(This, RetCode) -> ok when This :: wxDialog(), RetCode :: integer().

Ends a modal dialog, passing a value to be returned from the showModal/1 invocation.

See:

showModal/1

getReturnCode/1

setReturnCode/2

getAffirmativeId(This)

-spec getAffirmativeId(This) -> integer() when This :: wxDialog().

Gets the identifier of the button which works like standard OK button in this dialog.

See: setAffirmativeId/2

getReturnCode(This)

-spec getReturnCode(This) -> integer() when This :: wxDialog().

Gets the return code for this window.

Remark: A return code is normally associated with a modal dialog, where showModal/1 returns a code to the application.

See:

setReturnCode/2

showModal/1

endModal/2

isModal(This)

-spec isModal(This) -> boolean() when This :: wxDialog().

Returns true if the dialog box is modal, false otherwise.

new()

-spec new() -> wxDialog().

Default constructor.

new(Parent, Id, Title)

-spec new(Parent, Id, Title) -> wxDialog()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Title :: unicode:chardata().

Equivalent to new(Parent, Id, Title, []).

new/4

-spec new(Parent, Id, Title, [Option]) -> wxDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Title :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

See: create/5

setAffirmativeId(This, Id)

-spec setAffirmativeId(This, Id) -> ok when This :: wxDialog(), Id :: integer().

Sets the identifier to be used as OK button.

When the button with this identifier is pressed, the dialog calls wxWindow:validate/1 and wxWindow:transferDataFromWindow/1 and, if they both return true, closes the dialog with the affirmative id return code.

Also, when the user presses a hardware OK button on the devices having one or the special OK button in the PocketPC title bar, an event with this id is generated.

By default, the affirmative id is wxID_OK.

See: getAffirmativeId/1

setReturnCode(This, RetCode)

-spec setReturnCode(This, RetCode) -> ok when This :: wxDialog(), RetCode :: integer().

Sets the return code for this window.

A return code is normally associated with a modal dialog, where showModal/1 returns a code to the application. The function endModal/2 calls setReturnCode/2.

See:

getReturnCode/1

showModal/1

endModal/2

show(This)

-spec show(This) -> boolean() when This :: wxDialog().

Equivalent to show(This, []).

show/2

-spec show(This, [Option]) -> boolean() when This :: wxDialog(), Option :: {show, boolean()}.

Hides or shows the dialog.

The preferred way of dismissing a modal dialog is to use endModal/2.

showModal(This)

-spec showModal(This) -> integer() when This :: wxDialog().

Shows an application-modal dialog.

Program flow does not return until the dialog has been dismissed with endModal/2.

Notice that it is possible to call showModal/1 for a dialog which had been previously shown with show/2, this allows making an existing modeless dialog modal. However showModal/1 can't be called twice without intervening endModal/2 calls.

Note that this function creates a temporary event loop which takes precedence over the application's main event loop (see wxEventLoopBase (not implemented in wx)) and which is destroyed when the dialog is dismissed. This also results in a call to wxApp::ProcessPendingEvents() (not implemented in wx).

Return: The value set with setReturnCode/2.

See:

endModal/2

getReturnCode/1

setReturnCode/2

wxDirDialog

This class represents the directory chooser dialog.

Styles

This class supports the following styles:

wxDD_DEFAULT_STYLE: Equivalent to a combination of wxDEFAULT_DIALOG_STYLE and wxRESIZE_BORDER.

wxDD_DIR_MUST_EXIST: The dialog will allow the user to choose only an existing folder. When this style is not given, a "Create new directory" button is added to the dialog (on Windows) or some other way is provided to the user to type the name of a new folder.

wxDD_CHANGE_DIR: Change the current working directory to the directory chosen by the user.

Note: This flag cannot be used with the wxDD_MULTIPLE style.

wxDD_MULTIPLE: Allow the user to select multiple directories. This flag is only available since wxWidgets 3.1.4

wxDD_SHOW_HIDDEN: Show hidden and system folders. This flag is only available since wxWidgets 3.1.4 Notice that wxRESIZE_BORDER has special side effect under Windows where two different directory selection dialogs are available and this style also implicitly selects the new version as the old one always has fixed size. As the new version is almost always preferable, it is recommended that wxRESIZE_BORDER style be always used. This is the case if the dialog is created with the default style value but if you need to use any additional styles you should still specify wxDD_DEFAULT_STYLE unless you explicitly need to use the old dialog version under Windows. E.g. do instead of just using wxDD_DIR_MUST_EXIST style alone.

Remark: MacOS 10.11+ does not display a title bar on the dialog. Use setMessage/2 to change the string displayed to the user at the top of the dialog after creation. The wxTopLevelWindow:setTitle/2 method is provided for compatibility with pre-10.11 MacOS versions that do still support displaying the title bar.

See:

Overview cmndlg

wxFileDialog

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxDirDialog

Summary

Types

wxDirDialog()

Functions

destroy(This)

Destroys the object

getMessage(This)

Returns the message that will be displayed on the dialog.

getPath(This)

Returns the default or user-selected path.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

setMessage(This, Message)

Sets the message that will be displayed on the dialog.

setPath(This, Path)

Sets the default path.

Types

wxDirDialog()

-type wxDirDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxDirDialog()) -> ok.

Destroys the object

getMessage(This)

-spec getMessage(This) -> unicode:charlist() when This :: wxDirDialog().

Returns the message that will be displayed on the dialog.

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxDirDialog().

Returns the default or user-selected path.

Note: This function can't be used with dialogs which have the wxDD_MULTIPLE style, use GetPaths() (not implemented in wx) instead.

new(Parent)

-spec new(Parent) -> wxDirDialog() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxDirDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {title, unicode:chardata()} |
                     {defaultPath, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {sz, {W :: integer(), H :: integer()}}.

Constructor.

Use wxDialog:showModal/1 to show the dialog.

setMessage(This, Message)

-spec setMessage(This, Message) -> ok when This :: wxDirDialog(), Message :: unicode:chardata().

Sets the message that will be displayed on the dialog.

setPath(This, Path)

-spec setPath(This, Path) -> ok when This :: wxDirDialog(), Path :: unicode:chardata().

Sets the default path.

wxDirPickerCtrl

This control allows the user to select a directory.

The generic implementation is a button which brings up a wxDirDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the dir-chooser dialog. It is only available if wxUSE_DIRPICKERCTRL is set to 1 (the default).

Styles

This class supports the following styles:

wxDIRP_DEFAULT_STYLE: The default style: includes wxDIRP_DIR_MUST_EXIST and, under wxMSW only, wxDIRP_USE_TEXTCTRL.

wxDIRP_USE_TEXTCTRL: Creates a text control to the left of the picker button which is completely managed by the wxDirPickerCtrl and which can be used by the user to specify a path (see SetPath). The text control is automatically synchronized with button's value. Use functions defined in wxPickerBase to modify the text control.

wxDIRP_DIR_MUST_EXIST: Creates a picker which allows selecting only existing directories in the popup wxDirDialog. Notice that, as with wxFLP_FILE_MUST_EXIST, it is still possible to enter a non-existent directory even when this file is specified if wxDIRP_USE_TEXTCTRL style is also used. Also note that if wxDIRP_USE_TEXTCTRL is not used, the native wxGTK implementation always uses this style as it doesn't support selecting non-existent directories.

wxDIRP_CHANGE_DIR: Change current working directory on each user directory selection change.

wxDIRP_SMALL: Use smaller version of the control with a small "..." button instead of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.

See:

wxDirDialog

wxFileDirPickerEvent

This class is derived, and can use functions, from:

wxPickerBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxDirPickerCtrl

Events

Event types emitted from this class:

command_dirpicker_changed

Summary

Types

wxDirPickerCtrl()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates the widgets with the given parameters.

destroy(This)

Destroys the object

getPath(This)

Returns the absolute path of the currently selected directory.

new()

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Initializes the object and calls create/4 with all the parameters.

setPath(This, Dirname)

Sets the absolute path of the currently selected directory.

Types

wxDirPickerCtrl()

-type wxDirPickerCtrl() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxDirPickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxDirPickerCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {path, unicode:chardata()} |
                        {message, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the widgets with the given parameters.

Return: true if the control was successfully created or false if creation failed.

destroy(This)

-spec destroy(This :: wxDirPickerCtrl()) -> ok.

Destroys the object

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxDirPickerCtrl().

Returns the absolute path of the currently selected directory.

new()

-spec new() -> wxDirPickerCtrl().

new(Parent, Id)

-spec new(Parent, Id) -> wxDirPickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxDirPickerCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {path, unicode:chardata()} |
                     {message, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Initializes the object and calls create/4 with all the parameters.

setPath(This, Dirname)

-spec setPath(This, Dirname) -> ok when This :: wxDirPickerCtrl(), Dirname :: unicode:chardata().

Sets the absolute path of the currently selected directory.

If the control uses wxDIRP_DIR_MUST_EXIST and does not use wxDIRP_USE_TEXTCTRL style, the dirname must be a name of an existing directory and will be simply ignored by the native wxGTK implementation if this is not the case.

wxDisplay

Determines the sizes and locations of displays connected to the system.

wxWidgets docs: wxDisplay

Summary

Types

wxDisplay()

Functions

destroy(This)

Destroys the object

getClientArea(This)

Returns the client area of the display.

getCount()

Returns the number of connected displays.

getFromPoint(Pt)

Returns the index of the display on which the given point lies, or wxNOT\_FOUND if the point is not on any connected display.

getFromWindow(Win)

Returns the index of the display on which the given window lies.

getGeometry(This)

Returns the bounding rectangle of the display whose index was passed to the constructor.

getName(This)

Returns the display's name.

getPPI(This)

Returns display resolution in pixels per inch.

isOk(This)

Returns true if the object was initialized successfully.

isPrimary(This)

Returns true if the display is the primary display.

new()

Default constructor creating wxDisplay object representing the primary display.

new/1

Constructor creating the display object associated with the given window.

Types

wxDisplay()

-type wxDisplay() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxDisplay()) -> ok.

Destroys the object

getClientArea(This)

-spec getClientArea(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                       when This :: wxDisplay().

Returns the client area of the display.

The client area is the part of the display available for the normal (non full screen) windows, usually it is the same as getGeometry/1 but it could be less if there is a taskbar (or equivalent) on this display.

getCount()

-spec getCount() -> integer().

Returns the number of connected displays.

getFromPoint(Pt)

-spec getFromPoint(Pt) -> integer() when Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the display on which the given point lies, or wxNOT\_FOUND if the point is not on any connected display.

getFromWindow(Win)

-spec getFromWindow(Win) -> integer() when Win :: wxWindow:wxWindow().

Returns the index of the display on which the given window lies.

If the window is on more than one display it gets the display that overlaps the window the most.

Returns wxNOT_FOUND if the window is not on any connected display.

getGeometry(This)

-spec getGeometry(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                     when This :: wxDisplay().

Returns the bounding rectangle of the display whose index was passed to the constructor.

See:

getClientArea/1

wx_misc:displaySize/0

getName(This)

-spec getName(This) -> unicode:charlist() when This :: wxDisplay().

Returns the display's name.

The returned value is currently an empty string under all platforms except MSW.

getPPI(This)

-spec getPPI(This) -> {W :: integer(), H :: integer()} when This :: wxDisplay().

Returns display resolution in pixels per inch.

Horizontal and vertical resolution are returned in x and y components of the {Width,Height} object respectively.

If the resolution information is not available, returns.

Since: 3.1.2

isOk(This)

-spec isOk(This) -> boolean() when This :: wxDisplay().

Returns true if the object was initialized successfully.

isPrimary(This)

-spec isPrimary(This) -> boolean() when This :: wxDisplay().

Returns true if the display is the primary display.

The primary display is the one whose index is 0.

new()

-spec new() -> wxDisplay().

Default constructor creating wxDisplay object representing the primary display.

new/1

-spec new(Index) -> wxDisplay() when Index :: integer();
         (Window) -> wxDisplay() when Window :: wxWindow:wxWindow().

Constructor creating the display object associated with the given window.

This is the most convenient way of finding the display on which the given window is shown while falling back to the default display if it is not shown at all or positioned outside of any display.

See: getFromWindow/1

Since: 3.1.2

wxDisplayChangedEvent

A display changed event is sent to top-level windows when the display resolution has changed.

This event is currently emitted under Windows only.

See: wxDisplay

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxDisplayChangedEvent

Events

Use wxEvtHandler:connect/3 with wxDisplayChangedEventType to subscribe to events of this type.

Summary

Types

wxDisplayChanged()

wxDisplayChangedEvent()

wxDisplayChangedEventType()

Types

wxDisplayChanged()

-type wxDisplayChanged() :: #wxDisplayChanged{type :: wxDisplayChangedEvent:wxDisplayChangedEventType()}.

wxDisplayChangedEvent()

-type wxDisplayChangedEvent() :: wx:wx_object().

wxDisplayChangedEventType()

-type wxDisplayChangedEventType() :: display_changed.

wxDropFilesEvent

This class is used for drop files events, that is, when files have been dropped onto the window.

The window must have previously been enabled for dropping by calling wxWindow:dragAcceptFiles/2.

Important note: this is a separate implementation to the more general drag and drop implementation documented in the overview_dnd. It uses the older, Windows message-based approach of dropping files.

See:

Overview events

wxWindow:dragAcceptFiles/2

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxDropFilesEvent

Events

Use wxEvtHandler:connect/3 with wxDropFilesEventType to subscribe to events of this type.

Summary

Types

wxDropFiles()

wxDropFilesEvent()

wxDropFilesEventType()

Functions

getFiles(This)

Returns an array of filenames.

getNumberOfFiles(This)

Returns the number of files dropped.

getPosition(This)

Returns the position at which the files were dropped.

Types

wxDropFiles()

-type wxDropFiles() ::
          #wxDropFiles{type :: wxDropFilesEvent:wxDropFilesEventType(),
                       pos :: {X :: integer(), Y :: integer()},
                       files :: [unicode:chardata()]}.

wxDropFilesEvent()

-type wxDropFilesEvent() :: wx:wx_object().

wxDropFilesEventType()

-type wxDropFilesEventType() :: drop_files.

Functions

getFiles(This)

-spec getFiles(This) -> [unicode:charlist()] when This :: wxDropFilesEvent().

Returns an array of filenames.

getNumberOfFiles(This)

-spec getNumberOfFiles(This) -> integer() when This :: wxDropFilesEvent().

Returns the number of files dropped.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxDropFilesEvent().

Returns the position at which the files were dropped.

Returns an array of filenames.

wxEraseEvent

An erase event is sent when a window's background needs to be repainted.

On some platforms, such as GTK+, this event is simulated (simply generated just before the paint event) and may cause flicker. It is therefore recommended that you set the text background colour explicitly in order to prevent flicker. The default background colour under GTK+ is grey.

To intercept this event, use the EVT_ERASE_BACKGROUND macro in an event table definition.

You must use the device context returned by getDC/1 to draw on, don't create a wxPaintDC in the event handler.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxEraseEvent

Events

Use wxEvtHandler:connect/3 with wxEraseEventType to subscribe to events of this type.

Summary

Types

wxErase()

wxEraseEvent()

wxEraseEventType()

Functions

getDC(This)

Returns the device context associated with the erase event to draw on.

Types

wxErase()

-type wxErase() :: #wxErase{type :: wxEraseEvent:wxEraseEventType(), dc :: wxDC:wxDC()}.

wxEraseEvent()

-type wxEraseEvent() :: wx:wx_object().

wxEraseEventType()

-type wxEraseEventType() :: erase_background.

Functions

getDC(This)

-spec getDC(This) -> wxDC:wxDC() when This :: wxEraseEvent().

Returns the device context associated with the erase event to draw on.

The returned pointer is never NULL.

wxEvent

An event is a structure holding information about an event passed to a callback or member function.

wxEvent used to be a multipurpose event object, and is an abstract base class for other event classes (see below).

For more information about events, see the overview_events overview.

See:

wxCommandEvent

wxMouseEvent

wxWidgets docs: wxEvent

Summary

Types

wxEvent()

Functions

getId(This)

Returns the identifier associated with this event, such as a button command id.

getSkipped(This)

Returns true if the event handler should be skipped, false otherwise.

getTimestamp(This)

Gets the timestamp for the event.

isCommandEvent(This)

Returns true if the event is or is derived from wxCommandEvent else it returns false.

resumePropagation(This, PropagationLevel)

Sets the propagation level to the given value (for example returned from an earlier call to stopPropagation/1).

shouldPropagate(This)

Test if this event should be propagated or not, i.e. if the propagation level is currently greater than 0.

skip(This)

Equivalent to skip(This, []).

skip/2

This method can be used inside an event handler to control whether further event handlers bound to this event will be called after the current one returns.

stopPropagation(This)

Stop the event from propagating to its parent window.

Types

wxEvent()

-type wxEvent() :: wx:wx_object().

Functions

getId(This)

-spec getId(This) -> integer() when This :: wxEvent().

Returns the identifier associated with this event, such as a button command id.

getSkipped(This)

-spec getSkipped(This) -> boolean() when This :: wxEvent().

Returns true if the event handler should be skipped, false otherwise.

getTimestamp(This)

-spec getTimestamp(This) -> integer() when This :: wxEvent().

Gets the timestamp for the event.

The timestamp is the time in milliseconds since some fixed moment (not necessarily the standard Unix Epoch, so only differences between the timestamps and not their absolute values usually make sense).

Warning:

wxWidgets returns a non-NULL timestamp only for mouse and key events (see wxMouseEvent and wxKeyEvent).

isCommandEvent(This)

-spec isCommandEvent(This) -> boolean() when This :: wxEvent().

Returns true if the event is or is derived from wxCommandEvent else it returns false.

Note: exists only for optimization purposes.

resumePropagation(This, PropagationLevel)

-spec resumePropagation(This, PropagationLevel) -> ok
                           when This :: wxEvent(), PropagationLevel :: integer().

Sets the propagation level to the given value (for example returned from an earlier call to stopPropagation/1).

shouldPropagate(This)

-spec shouldPropagate(This) -> boolean() when This :: wxEvent().

Test if this event should be propagated or not, i.e. if the propagation level is currently greater than 0.

skip(This)

-spec skip(This) -> ok when This :: wxEvent().

Equivalent to skip(This, []).

skip/2

-spec skip(This, [Option]) -> ok when This :: wxEvent(), Option :: {skip, boolean()}.

This method can be used inside an event handler to control whether further event handlers bound to this event will be called after the current one returns.

Without skip/2 (or equivalently if Skip(false) is used), the event will not be processed any more. If Skip(true) is called, the event processing system continues searching for a further handler function for this event, even though it has been processed already in the current handler.

In general, it is recommended to skip all non-command events to allow the default handling to take place. The command events are, however, normally not skipped as usually a single command such as a button click or menu item selection must only be processed by one handler.

stopPropagation(This)

-spec stopPropagation(This) -> integer() when This :: wxEvent().

Stop the event from propagating to its parent window.

Returns the old propagation level value which may be later passed to resumePropagation/2 to allow propagating the event again.

wxEvtHandler

The Event handler

A class that can handle events from the windowing system. wxWindow is (and therefore all window classes are) derived from this class.

To get events from wxwidgets objects you subscribe to them by calling connect/3.

If the callback option is not supplied events are sent as messages.

These messages will be #wx{} where EventRecord is a record that depends on the wxEventType. The records are defined in: wx/include/wx.hrl.

If a callback was supplied to connect, the callback will be invoked (in another process) to handle the event. The callback should be of arity 2.

fun Callback (EventRecord::wx(), EventObject::wxObject()).

Note: The callback will be in executed in new process each time.

See: Overview events

wxWidgets docs: wxEvtHandler

Summary

Types

event()

wx()

wxEventType()

wxEvtHandler()

Functions

connect(This, EventType)

Equivalent to connect(This, EventType, []).

connect/3

This function subscribes to events.

disconnect(This)

Equivalent to disconnect(This, null, []).

disconnect(This, EventType)

Equivalent to disconnect(This, EventType, []).

disconnect/3

This function unsubscribes the process or callback fun from the event handler.

Types

event()

-type event() ::
          wxActivateEvent:wxActivate() |
          wxAuiManagerEvent:wxAuiManager() |
          wxAuiNotebookEvent:wxAuiNotebook() |
          wxBookCtrlEvent:wxBookCtrl() |
          wxCalendarEvent:wxCalendar() |
          wxChildFocusEvent:wxChildFocus() |
          wxClipboardTextEvent:wxClipboardText() |
          wxCloseEvent:wxClose() |
          wxColourPickerEvent:wxColourPicker() |
          wxCommandEvent:wxCommand() |
          wxContextMenuEvent:wxContextMenu() |
          wxDateEvent:wxDate() |
          wxDisplayChangedEvent:wxDisplayChanged() |
          wxDropFilesEvent:wxDropFiles() |
          wxEraseEvent:wxErase() |
          wxFileDirPickerEvent:wxFileDirPicker() |
          wxFocusEvent:wxFocus() |
          wxFontPickerEvent:wxFontPicker() |
          wxGridEvent:wxGrid() |
          wxHelpEvent:wxHelp() |
          wxHtmlLinkEvent:wxHtmlLink() |
          wxIconizeEvent:wxIconize() |
          wxIdleEvent:wxIdle() |
          wxInitDialogEvent:wxInitDialog() |
          wxJoystickEvent:wxJoystick() |
          wxKeyEvent:wxKey() |
          wxListEvent:wxList() |
          wxMaximizeEvent:wxMaximize() |
          wxMenuEvent:wxMenu() |
          wxMouseCaptureChangedEvent:wxMouseCaptureChanged() |
          wxMouseCaptureLostEvent:wxMouseCaptureLost() |
          wxMouseEvent:wxMouse() |
          wxMoveEvent:wxMove() |
          wxNavigationKeyEvent:wxNavigationKey() |
          wxPaintEvent:wxPaint() |
          wxPaletteChangedEvent:wxPaletteChanged() |
          wxQueryNewPaletteEvent:wxQueryNewPalette() |
          wxSashEvent:wxSash() |
          wxScrollEvent:wxScroll() |
          wxScrollWinEvent:wxScrollWin() |
          wxSetCursorEvent:wxSetCursor() |
          wxShowEvent:wxShow() |
          wxSizeEvent:wxSize() |
          wxSpinEvent:wxSpin() |
          wxSplitterEvent:wxSplitter() |
          wxStyledTextEvent:wxStyledText() |
          wxSysColourChangedEvent:wxSysColourChanged() |
          wxTaskBarIconEvent:wxTaskBarIcon() |
          wxTreeEvent:wxTree() |
          wxUpdateUIEvent:wxUpdateUI() |
          wxWebViewEvent:wxWebView() |
          wxWindowCreateEvent:wxWindowCreate() |
          wxWindowDestroyEvent:wxWindowDestroy().

wx()

-type wx() :: #wx{id :: integer(), obj :: wx:wx_object(), userData :: term(), event :: event()}.

wxEventType()

(not exported)

-type wxEventType() ::
          wxActivateEvent:wxActivateEventType() |
          wxAuiManagerEvent:wxAuiManagerEventType() |
          wxAuiNotebookEvent:wxAuiNotebookEventType() |
          wxBookCtrlEvent:wxBookCtrlEventType() |
          wxCalendarEvent:wxCalendarEventType() |
          wxChildFocusEvent:wxChildFocusEventType() |
          wxClipboardTextEvent:wxClipboardTextEventType() |
          wxCloseEvent:wxCloseEventType() |
          wxColourPickerEvent:wxColourPickerEventType() |
          wxCommandEvent:wxCommandEventType() |
          wxContextMenuEvent:wxContextMenuEventType() |
          wxDateEvent:wxDateEventType() |
          wxDisplayChangedEvent:wxDisplayChangedEventType() |
          wxDropFilesEvent:wxDropFilesEventType() |
          wxEraseEvent:wxEraseEventType() |
          wxFileDirPickerEvent:wxFileDirPickerEventType() |
          wxFocusEvent:wxFocusEventType() |
          wxFontPickerEvent:wxFontPickerEventType() |
          wxGridEvent:wxGridEventType() |
          wxHelpEvent:wxHelpEventType() |
          wxHtmlLinkEvent:wxHtmlLinkEventType() |
          wxIconizeEvent:wxIconizeEventType() |
          wxIdleEvent:wxIdleEventType() |
          wxInitDialogEvent:wxInitDialogEventType() |
          wxJoystickEvent:wxJoystickEventType() |
          wxKeyEvent:wxKeyEventType() |
          wxListEvent:wxListEventType() |
          wxMaximizeEvent:wxMaximizeEventType() |
          wxMenuEvent:wxMenuEventType() |
          wxMouseCaptureChangedEvent:wxMouseCaptureChangedEventType() |
          wxMouseCaptureLostEvent:wxMouseCaptureLostEventType() |
          wxMouseEvent:wxMouseEventType() |
          wxMoveEvent:wxMoveEventType() |
          wxNavigationKeyEvent:wxNavigationKeyEventType() |
          wxPaintEvent:wxPaintEventType() |
          wxPaletteChangedEvent:wxPaletteChangedEventType() |
          wxQueryNewPaletteEvent:wxQueryNewPaletteEventType() |
          wxSashEvent:wxSashEventType() |
          wxScrollEvent:wxScrollEventType() |
          wxScrollWinEvent:wxScrollWinEventType() |
          wxSetCursorEvent:wxSetCursorEventType() |
          wxShowEvent:wxShowEventType() |
          wxSizeEvent:wxSizeEventType() |
          wxSpinEvent:wxSpinEventType() |
          wxSplitterEvent:wxSplitterEventType() |
          wxStyledTextEvent:wxStyledTextEventType() |
          wxSysColourChangedEvent:wxSysColourChangedEventType() |
          wxTaskBarIconEvent:wxTaskBarIconEventType() |
          wxTreeEvent:wxTreeEventType() |
          wxUpdateUIEvent:wxUpdateUIEventType() |
          wxWebViewEvent:wxWebViewEventType() |
          wxWindowCreateEvent:wxWindowCreateEventType() |
          wxWindowDestroyEvent:wxWindowDestroyEventType().

wxEvtHandler()

-type wxEvtHandler() :: wx:wx_object().

Functions

connect(This, EventType)

-spec connect(This :: wxEvtHandler(), EventType :: wxEventType()) -> ok.

Equivalent to connect(This, EventType, []).

connect/3

-spec connect(This :: wxEvtHandler(), EventType :: wxEventType(), [Option]) -> ok
                 when
                     Option ::
                         {id, integer()} |
                         {lastId, integer()} |
                         {skip, boolean()} |
                         callback |
                         {callback, function()} |
                         {userData, term()}.

This function subscribes to events.

Subscribes to events of type EventType, in the range id, lastId.

The events will be received as messages if no callback is supplied.

Options

id:{id, integer()}The identifier (or first of the identifier range) to be associated with this event handler. Default is ?wxID_ANY

lastid:{lastId,integer()}The second part of the identifier range. If used 'id' must be set as the starting identifier range. Default is ?wxID_ANY

skip:{skip,boolean()}If skip is true further event_handlers will be called. This is not used if the 'callback' option is used. Default is false.

callback:{callback,function()}Use a callbackfun(EventRecord::wx(),EventObject::wxObject())to process the event. Default not specified i.e. a message will be delivered to the process calling this function.

userData:{userData,term()}An erlang term that will be sent with the event. Default: [].

disconnect(This)

-spec disconnect(This :: wxEvtHandler()) -> boolean().

Equivalent to disconnect(This, null, []).

disconnect(This, EventType)

-spec disconnect(This :: wxEvtHandler(), EventType :: wxEventType()) -> boolean().

Equivalent to disconnect(This, EventType, []).

disconnect/3

-spec disconnect(This :: wxEvtHandler(), EventType :: wxEventType(), [Option]) -> boolean()
                    when Option :: {id, integer()} | {lastId, integer()} | {callback, function()}.

This function unsubscribes the process or callback fun from the event handler.

EventType may be the atom 'null' to match any eventtype. Notice that the options skip and userdata is not used to match the eventhandler.

wxFileDataObject

wxFileDataObject is a specialization of wxDataObject for file names.

The program works with it just as if it were a list of absolute file names, but internally it uses the same format as Explorer and other compatible programs under Windows or GNOME/KDE file manager under Unix which makes it possible to receive files from them using this class.

See:

wxDataObject

wxTextDataObject

wxBitmapDataObject

wxDataObject

This class is derived, and can use functions, from:

wxDataObject

wxWidgets docs: wxFileDataObject

Summary

Types

wxFileDataObject()

Functions

addFile(This, File)

Adds a file to the file list represented by this data object (Windows only).

destroy(This)

Destroys the object

getFilenames(This)

Returns the array of file names.

new()

Constructor.

Types

wxFileDataObject()

-type wxFileDataObject() :: wx:wx_object().

Functions

addFile(This, File)

-spec addFile(This, File) -> ok when This :: wxFileDataObject(), File :: unicode:chardata().

Adds a file to the file list represented by this data object (Windows only).

destroy(This)

-spec destroy(This :: wxFileDataObject()) -> ok.

Destroys the object

getFilenames(This)

-spec getFilenames(This) -> [unicode:charlist()] when This :: wxFileDataObject().

Returns the array of file names.

new()

-spec new() -> wxFileDataObject().

Constructor.

wxFileDialog

This class represents the file chooser dialog.

The path and filename are distinct elements of a full file pathname. If path is ?wxEmptyString, the current directory will be used. If filename is ?wxEmptyString, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename.

The typical usage for the open file dialog is:

The typical usage for the save file dialog is instead somewhat simpler:

Remark: All implementations of the wxFileDialog provide a wildcard filter. Typing a filename containing wildcards (, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. The wildcard may be a specification for multiple types of file with a description for each, such as: It must be noted that wildcard support in the native Motif file dialog is quite limited: only one file type is supported, and it is displayed without the descriptive test; "BMP files (.bmp)|.bmp" is displayed as ".bmp", and both "BMP files (.bmp)|.bmp|GIF files (.gif)|.gif" and "Image files|.bmp;.gif" are errors. On Mac macOS in the open file dialog the filter choice box is not shown by default. Instead all given wildcards are appplied at the same time: So in the above example all bmp, gif and png files are displayed. To enforce the display of the filter choice set the corresponding wxSystemOptions before calling the file open dialog: But in contrast to Windows and Unix, where the file type choice filters only the selected files, on Mac macOS even in this case the dialog shows all files matching all file types. The files which does not match the currently selected file type are greyed out and are not selectable.

Styles

This class supports the following styles:

wxFD_DEFAULT_STYLE: Equivalent to wxFD_OPEN.

wxFD_OPEN: This is an open dialog; usually this means that the default button's label of the dialog is "Open". Cannot be combined with wxFD_SAVE.

wxFD_SAVE: This is a save dialog; usually this means that the default button's label of the dialog is "Save". Cannot be combined with wxFD_OPEN.

wxFD_OVERWRITE_PROMPT: For save dialog only: prompt for a confirmation if a file will be overwritten.

wxFD_NO_FOLLOW: Directs the dialog to return the path and file name of the selected shortcut file, not its target as it does by default. Currently this flag is only implemented in wxMSW and wxOSX (where it prevents aliases from being resolved). The non-dereferenced link path is always returned, even without this flag, under Unix and so using it there doesn't do anything. This flag was added in wxWidgets 3.1.0.

wxFD_FILE_MUST_EXIST: For open dialog only: the user may only select files that actually exist. Notice that under macOS the file dialog with wxFD_OPEN style always behaves as if this style was specified, because it is impossible to choose a file that doesn't exist from a standard macOS file dialog.

wxFD_MULTIPLE: For open dialog only: allows selecting multiple files.

wxFD_CHANGE_DIR: Change the current working directory (when the dialog is dismissed) to the directory where the file(s) chosen by the user are.

wxFD_PREVIEW: Show the preview of the selected files (currently only supported by wxGTK).

wxFD_SHOW_HIDDEN: Show hidden files. This flag was added in wxWidgets 3.1.3

See:

Overview cmndlg

?wxFileSelector()

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxFileDialog

Summary

Types

wxFileDialog()

Functions

destroy(This)

Destroys the object

getDirectory(This)

Returns the default directory.

getFilename(This)

Returns the default filename.

getFilenames(This)

Fills the array filenames with the names of the files chosen.

getFilterIndex(This)

Returns the index into the list of filters supplied, optionally, in the wildcard parameter.

getMessage(This)

Returns the message that will be displayed on the dialog.

getPath(This)

Returns the full path (directory and filename) of the selected file.

getPaths(This)

Fills the array paths with the full paths of the files chosen.

getWildcard(This)

Returns the file dialog wildcard.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

setDirectory(This, Directory)

Sets the default directory.

setFilename(This, Setfilename)

Sets the default filename.

setFilterIndex(This, FilterIndex)

Sets the default filter index, starting from zero.

setMessage(This, Message)

Sets the message that will be displayed on the dialog.

setPath(This, Path)

Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).

setWildcard(This, WildCard)

Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".

Types

wxFileDialog()

-type wxFileDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxFileDialog()) -> ok.

Destroys the object

getDirectory(This)

-spec getDirectory(This) -> unicode:charlist() when This :: wxFileDialog().

Returns the default directory.

getFilename(This)

-spec getFilename(This) -> unicode:charlist() when This :: wxFileDialog().

Returns the default filename.

Note: This function can't be used with dialogs which have the wxFD_MULTIPLE style, use getFilenames/1 instead.

getFilenames(This)

-spec getFilenames(This) -> [unicode:charlist()] when This :: wxFileDialog().

Fills the array filenames with the names of the files chosen.

This function should only be used with the dialogs which have wxFD_MULTIPLE style, use getFilename/1 for the others.

Note that under Windows, if the user selects shortcuts, the filenames include paths, since the application cannot determine the full path of each referenced file by appending the directory containing the shortcuts to the filename.

getFilterIndex(This)

-spec getFilterIndex(This) -> integer() when This :: wxFileDialog().

Returns the index into the list of filters supplied, optionally, in the wildcard parameter.

Before the dialog is shown, this is the index which will be used when the dialog is first displayed.

After the dialog is shown, this is the index selected by the user.

getMessage(This)

-spec getMessage(This) -> unicode:charlist() when This :: wxFileDialog().

Returns the message that will be displayed on the dialog.

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxFileDialog().

Returns the full path (directory and filename) of the selected file.

Note: This function can't be used with dialogs which have the wxFD_MULTIPLE style, use getPaths/1 instead.

getPaths(This)

-spec getPaths(This) -> [unicode:charlist()] when This :: wxFileDialog().

Fills the array paths with the full paths of the files chosen.

This function should only be used with the dialogs which have wxFD_MULTIPLE style, use getPath/1 for the others.

getWildcard(This)

-spec getWildcard(This) -> unicode:charlist() when This :: wxFileDialog().

Returns the file dialog wildcard.

new(Parent)

-spec new(Parent) -> wxFileDialog() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxFileDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {message, unicode:chardata()} |
                     {defaultDir, unicode:chardata()} |
                     {defaultFile, unicode:chardata()} |
                     {wildCard, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {sz, {W :: integer(), H :: integer()}}.

Constructor.

Use wxDialog:showModal/1 to show the dialog.

setDirectory(This, Directory)

-spec setDirectory(This, Directory) -> ok when This :: wxFileDialog(), Directory :: unicode:chardata().

Sets the default directory.

setFilename(This, Setfilename)

-spec setFilename(This, Setfilename) -> ok
                     when This :: wxFileDialog(), Setfilename :: unicode:chardata().

Sets the default filename.

In wxGTK this will have little effect unless a default directory has previously been set.

setFilterIndex(This, FilterIndex)

-spec setFilterIndex(This, FilterIndex) -> ok when This :: wxFileDialog(), FilterIndex :: integer().

Sets the default filter index, starting from zero.

setMessage(This, Message)

-spec setMessage(This, Message) -> ok when This :: wxFileDialog(), Message :: unicode:chardata().

Sets the message that will be displayed on the dialog.

setPath(This, Path)

-spec setPath(This, Path) -> ok when This :: wxFileDialog(), Path :: unicode:chardata().

Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).

setWildcard(This, WildCard)

-spec setWildcard(This, WildCard) -> ok when This :: wxFileDialog(), WildCard :: unicode:chardata().

Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".

Note that the native Motif dialog has some limitations with respect to wildcards; see the Remarks section above.

wxFileDirPickerEvent

This event class is used for the events generated by wxFilePickerCtrl and by wxDirPickerCtrl.

See:

wxFilePickerCtrl

wxDirPickerCtrl

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxFileDirPickerEvent

Events

Use wxEvtHandler:connect/3 with wxFileDirPickerEventType to subscribe to events of this type.

Summary

Types

wxFileDirPicker()

wxFileDirPickerEvent()

wxFileDirPickerEventType()

Functions

getPath(This)

Retrieve the absolute path of the file/directory the user has just selected.

Types

wxFileDirPicker()

-type wxFileDirPicker() ::
          #wxFileDirPicker{type :: wxFileDirPickerEvent:wxFileDirPickerEventType(),
                           path :: unicode:chardata()}.

wxFileDirPickerEvent()

-type wxFileDirPickerEvent() :: wx:wx_object().

wxFileDirPickerEventType()

-type wxFileDirPickerEventType() :: command_filepicker_changed | command_dirpicker_changed.

Functions

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxFileDirPickerEvent().

Retrieve the absolute path of the file/directory the user has just selected.

wxFilePickerCtrl

This control allows the user to select a file.

The generic implementation is a button which brings up a wxFileDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the file-chooser dialog. It is only available if wxUSE_FILEPICKERCTRL is set to 1 (the default).

Styles

This class supports the following styles:

wxFLP_DEFAULT_STYLE: The default style: includes wxFLP_OPEN | wxFLP_FILE_MUST_EXIST and, under wxMSW and wxOSX, wxFLP_USE_TEXTCTRL.

wxFLP_USE_TEXTCTRL: Creates a text control to the left of the picker button which is completely managed by the wxFilePickerCtrl and which can be used by the user to specify a path (see SetPath). The text control is automatically synchronized with button's value. Use functions defined in wxPickerBase to modify the text control.

wxFLP_OPEN: Creates a picker which allows the user to select a file to open.

wxFLP_SAVE: Creates a picker which allows the user to select a file to save.

wxFLP_OVERWRITE_PROMPT: Can be combined with wxFLP_SAVE only: ask confirmation to the user before selecting a file.

wxFLP_FILE_MUST_EXIST: Can be combined with wxFLP_OPEN only: the file selected in the popup wxFileDialog must be an existing file. Notice that it still remains possible for the user to enter a non-existent file name in the text control if wxFLP_USE_TEXTCTRL is also used, this flag is a hint for the user rather than a guarantee that the selected file does exist for the program.

wxFLP_CHANGE_DIR: Change current working directory on each user file selection change.

wxFLP_SMALL: Use smaller version of the control with a small "..." button instead of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.

See:

wxFileDialog

wxFileDirPickerEvent

This class is derived, and can use functions, from:

wxPickerBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxFilePickerCtrl

Events

Event types emitted from this class:

command_filepicker_changed

Summary

Types

wxFilePickerCtrl()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates this widget with the given parameters.

destroy(This)

Destroys the object

getPath(This)

Returns the absolute path of the currently selected file.

new()

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Initializes the object and calls create/4 with all the parameters.

setPath(This, Filename)

Sets the absolute path of the currently selected file.

Types

wxFilePickerCtrl()

-type wxFilePickerCtrl() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxFilePickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxFilePickerCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {path, unicode:chardata()} |
                        {message, unicode:chardata()} |
                        {wildcard, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates this widget with the given parameters.

Return: true if the control was successfully created or false if creation failed.

destroy(This)

-spec destroy(This :: wxFilePickerCtrl()) -> ok.

Destroys the object

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxFilePickerCtrl().

Returns the absolute path of the currently selected file.

new()

-spec new() -> wxFilePickerCtrl().

new(Parent, Id)

-spec new(Parent, Id) -> wxFilePickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxFilePickerCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {path, unicode:chardata()} |
                     {message, unicode:chardata()} |
                     {wildcard, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Initializes the object and calls create/4 with all the parameters.

setPath(This, Filename)

-spec setPath(This, Filename) -> ok when This :: wxFilePickerCtrl(), Filename :: unicode:chardata().

Sets the absolute path of the currently selected file.

If the control uses wxFLP_FILE_MUST_EXIST and does not use wxFLP_USE_TEXTCTRL style, the filename must be a name of an existing file and will be simply ignored by the native wxGTK implementation if this is not the case (the generic implementation used under the other platforms accepts even invalid file names currently, but this is subject to change in the future, don't rely on being able to use non-existent paths with it).

wxFindReplaceData

wxFindReplaceData holds the data for wxFindReplaceDialog.

It is used to initialize the dialog with the default values and will keep the last values from the dialog when it is closed. It is also updated each time a wxFindDialogEvent (not implemented in wx) is generated so instead of using the wxFindDialogEvent (not implemented in wx) methods you can also directly query this object.

Note that all SetXXX() methods may only be called before showing the dialog and calling them has no effect later.

wxWidgets docs: wxFindReplaceData

Summary

Types

wxFindReplaceData()

Functions

destroy(This)

Destroys the object

getFindString(This)

Get the string to find.

getFlags(This)

Get the combination of wxFindReplaceFlags values.

getReplaceString(This)

Get the replacement string.

new()

Equivalent to new([]).

new(Options)

Constructor initializes the flags to default value (0).

setFindString(This, Str)

Set the string to find (used as initial value by the dialog).

setFlags(This, Flags)

Set the flags to use to initialize the controls of the dialog.

setReplaceString(This, Str)

Set the replacement string (used as initial value by the dialog).

Types

wxFindReplaceData()

-type wxFindReplaceData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxFindReplaceData()) -> ok.

Destroys the object

getFindString(This)

-spec getFindString(This) -> unicode:charlist() when This :: wxFindReplaceData().

Get the string to find.

getFlags(This)

-spec getFlags(This) -> integer() when This :: wxFindReplaceData().

Get the combination of wxFindReplaceFlags values.

getReplaceString(This)

-spec getReplaceString(This) -> unicode:charlist() when This :: wxFindReplaceData().

Get the replacement string.

new()

-spec new() -> wxFindReplaceData().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxFindReplaceData() when Option :: {flags, integer()}.

Constructor initializes the flags to default value (0).

setFindString(This, Str)

-spec setFindString(This, Str) -> ok when This :: wxFindReplaceData(), Str :: unicode:chardata().

Set the string to find (used as initial value by the dialog).

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxFindReplaceData(), Flags :: integer().

Set the flags to use to initialize the controls of the dialog.

setReplaceString(This, Str)

-spec setReplaceString(This, Str) -> ok when This :: wxFindReplaceData(), Str :: unicode:chardata().

Set the replacement string (used as initial value by the dialog).

wxFindReplaceDialog

wxFindReplaceDialog is a standard modeless dialog which is used to allow the user to search for some text (and possibly replace it with something else).

The actual searching is supposed to be done in the owner window which is the parent of this dialog. Note that it means that unlike for the other standard dialogs this one must have a parent window. Also note that there is no way to use this dialog in a modal way; it is always, by design and implementation, modeless.

Please see the page_samples_dialogs sample for an example of using it.

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxFindReplaceDialog

Summary

Types

wxFindReplaceDialog()

Functions

create(This, Parent, Data, Title)

Equivalent to create(This, Parent, Data, Title, []).

create/5

Creates the dialog; use wxWindow:show/2 to show it on screen.

destroy(This)

Destroys the object

getData(This)

Get the wxFindReplaceData object used by this dialog.

new()

new(Parent, Data, Title)

Equivalent to new(Parent, Data, Title, []).

new/4

After using default constructor create/5 must be called.

Types

wxFindReplaceDialog()

-type wxFindReplaceDialog() :: wx:wx_object().

Functions

create(This, Parent, Data, Title)

-spec create(This, Parent, Data, Title) -> boolean()
                when
                    This :: wxFindReplaceDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Data :: wxFindReplaceData:wxFindReplaceData(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Data, Title, []).

create/5

-spec create(This, Parent, Data, Title, [Option]) -> boolean()
                when
                    This :: wxFindReplaceDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Data :: wxFindReplaceData:wxFindReplaceData(),
                    Title :: unicode:chardata(),
                    Option :: {style, integer()}.

Creates the dialog; use wxWindow:show/2 to show it on screen.

The parent and data parameters must be non-NULL.

destroy(This)

-spec destroy(This :: wxFindReplaceDialog()) -> ok.

Destroys the object

getData(This)

-spec getData(This) -> wxFindReplaceData:wxFindReplaceData() when This :: wxFindReplaceDialog().

Get the wxFindReplaceData object used by this dialog.

new()

-spec new() -> wxFindReplaceDialog().

new(Parent, Data, Title)

-spec new(Parent, Data, Title) -> wxFindReplaceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Data :: wxFindReplaceData:wxFindReplaceData(),
                 Title :: unicode:chardata().

Equivalent to new(Parent, Data, Title, []).

new/4

-spec new(Parent, Data, Title, [Option]) -> wxFindReplaceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Data :: wxFindReplaceData:wxFindReplaceData(),
                 Title :: unicode:chardata(),
                 Option :: {style, integer()}.

After using default constructor create/5 must be called.

The parent and data parameters must be non-NULL.

wxFlexGridSizer

A flex grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or width as in the wxGridSizer.

Since wxWidgets 2.5.0, wxFlexGridSizer can also size items equally in one direction but unequally ("flexibly") in the other. If the sizer is only flexible in one direction (this can be changed using setFlexibleDirection/2), it needs to be decided how the sizer should grow in the other ("non-flexible") direction in order to fill the available space. The setNonFlexibleGrowMode/2 method serves this purpose.

See:

wxSizer

Overview sizer

This class is derived, and can use functions, from:

wxGridSizer

wxSizer

wxWidgets docs: wxFlexGridSizer

Summary

Types

wxFlexGridSizer()

Functions

addGrowableCol(This, Idx)

Equivalent to addGrowableCol(This, Idx, []).

addGrowableCol/3

Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer.

addGrowableRow(This, Idx)

Equivalent to addGrowableRow(This, Idx, []).

addGrowableRow/3

Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.

destroy(This)

Destroys the object

getFlexibleDirection(This)

Returns a ?wxOrientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).

getNonFlexibleGrowMode(This)

Returns the value that specifies how the sizer grows in the "non-flexible" direction if there is one.

new(Cols)

Equivalent to new(Cols, []).

new(Cols, Options)

new/3

new(Rows, Cols, Vgap, Hgap)

removeGrowableCol(This, Idx)

Specifies that the idx column index is no longer growable.

removeGrowableRow(This, Idx)

Specifies that the idx row index is no longer growable.

setFlexibleDirection(This, Direction)

Specifies whether the sizer should flexibly resize its columns, rows, or both.

setNonFlexibleGrowMode(This, Mode)

Specifies how the sizer should grow in the non-flexible direction if there is one (so setFlexibleDirection/2 must have been called previously).

Types

wxFlexGridSizer()

-type wxFlexGridSizer() :: wx:wx_object().

Functions

addGrowableCol(This, Idx)

-spec addGrowableCol(This, Idx) -> ok when This :: wxFlexGridSizer(), Idx :: integer().

Equivalent to addGrowableCol(This, Idx, []).

addGrowableCol/3

-spec addGrowableCol(This, Idx, [Option]) -> ok
                        when
                            This :: wxFlexGridSizer(),
                            Idx :: integer(),
                            Option :: {proportion, integer()}.

Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer.

The proportion parameter has the same meaning as the stretch factor for the sizers (see wxBoxSizer) except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all).

Notice that the column must not be already growable, if you need to change the proportion you must call removeGrowableCol/2 first and then make it growable (with a different proportion) again. You can use IsColGrowable() (not implemented in wx) to check whether a column is already growable.

addGrowableRow(This, Idx)

-spec addGrowableRow(This, Idx) -> ok when This :: wxFlexGridSizer(), Idx :: integer().

Equivalent to addGrowableRow(This, Idx, []).

addGrowableRow/3

-spec addGrowableRow(This, Idx, [Option]) -> ok
                        when
                            This :: wxFlexGridSizer(),
                            Idx :: integer(),
                            Option :: {proportion, integer()}.

Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.

This is identical to addGrowableCol/3 except that it works with rows and not columns.

destroy(This)

-spec destroy(This :: wxFlexGridSizer()) -> ok.

Destroys the object

getFlexibleDirection(This)

-spec getFlexibleDirection(This) -> integer() when This :: wxFlexGridSizer().

Returns a ?wxOrientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).

Return: One of the following values:

wxVERTICAL: Rows are flexibly sized.

wxHORIZONTAL: Columns are flexibly sized.

wxBOTH: Both rows and columns are flexibly sized (this is the default value).

See: setFlexibleDirection/2

getNonFlexibleGrowMode(This)

-spec getNonFlexibleGrowMode(This) -> wx:wx_enum() when This :: wxFlexGridSizer().

Returns the value that specifies how the sizer grows in the "non-flexible" direction if there is one.

The behaviour of the elements in the flexible direction (i.e. both rows and columns by default, or rows only if getFlexibleDirection/1 is wxVERTICAL or columns only if it is wxHORIZONTAL) is always governed by their proportion as specified in the call to addGrowableRow/3 or addGrowableCol/3. What happens in the other direction depends on the value of returned by this function as described below.

Return: One of the following values:

wxFLEX_GROWMODE_NONE: Sizer doesn't grow its elements at all in the non-flexible direction.

wxFLEX_GROWMODE_SPECIFIED: Sizer honors growable columns/rows set with addGrowableCol/3 and addGrowableRow/3 in the non-flexible direction as well. In this case equal sizing applies to minimum sizes of columns or rows (this is the default value).

wxFLEX_GROWMODE_ALL: Sizer equally stretches all columns or rows in the non-flexible direction, independently of the proportions applied in the flexible direction.

See:

setFlexibleDirection/2

setNonFlexibleGrowMode/2

new(Cols)

-spec new(Cols) -> wxFlexGridSizer() when Cols :: integer().

Equivalent to new(Cols, []).

new(Cols, Options)

-spec new(Cols, [Option]) -> wxFlexGridSizer()
             when Cols :: integer(), Option :: {gap, {W :: integer(), H :: integer()}}.

new/3

-spec new(Cols, Vgap, Hgap) -> wxFlexGridSizer()
             when Cols :: integer(), Vgap :: integer(), Hgap :: integer();
         (Rows, Cols, Gap) -> wxFlexGridSizer()
             when Rows :: integer(), Cols :: integer(), Gap :: {W :: integer(), H :: integer()}.

new(Rows, Cols, Vgap, Hgap)

-spec new(Rows, Cols, Vgap, Hgap) -> wxFlexGridSizer()
             when Rows :: integer(), Cols :: integer(), Vgap :: integer(), Hgap :: integer().

removeGrowableCol(This, Idx)

-spec removeGrowableCol(This, Idx) -> ok when This :: wxFlexGridSizer(), Idx :: integer().

Specifies that the idx column index is no longer growable.

removeGrowableRow(This, Idx)

-spec removeGrowableRow(This, Idx) -> ok when This :: wxFlexGridSizer(), Idx :: integer().

Specifies that the idx row index is no longer growable.

setFlexibleDirection(This, Direction)

-spec setFlexibleDirection(This, Direction) -> ok when This :: wxFlexGridSizer(), Direction :: integer().

Specifies whether the sizer should flexibly resize its columns, rows, or both.

Argument direction can be wxVERTICAL, wxHORIZONTAL or wxBOTH (which is the default value). Any other value is ignored.

See getFlexibleDirection/1 for the explanation of these values. Note that this method does not trigger relayout.

setNonFlexibleGrowMode(This, Mode)

-spec setNonFlexibleGrowMode(This, Mode) -> ok when This :: wxFlexGridSizer(), Mode :: wx:wx_enum().

Specifies how the sizer should grow in the non-flexible direction if there is one (so setFlexibleDirection/2 must have been called previously).

Argument mode can be one of those documented in getNonFlexibleGrowMode/1, please see there for their explanation. Note that this method does not trigger relayout.

wxFocusEvent

A focus event is sent when a window's focus changes.

The window losing focus receives a "kill focus" event while the window gaining it gets a "set focus" one.

Notice that the set focus event happens both when the user gives focus to the window (whether using the mouse or keyboard) and when it is done from the program itself using wxWindow:setFocus/1.

The focus event handlers should almost invariably call wxEvent:skip/2 on their event argument to allow the default handling to take place. Failure to do this may result in incorrect behaviour of the native controls. Also note that wxEVT_KILL_FOCUS handler must not call wxWindow:setFocus/1 as this, again, is not supported by all native controls. If you need to do this, consider using the Delayed Action Mechanism (not implemented in wx) described in wxIdleEvent documentation.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxFocusEvent

Events

Use wxEvtHandler:connect/3 with wxFocusEventType to subscribe to events of this type.

Summary

Types

wxFocus()

wxFocusEvent()

wxFocusEventType()

Functions

getWindow(This)

Returns the window associated with this event, that is the window which had the focus before for the wxEVT\_SET\_FOCUS event and the window which is going to receive focus for the wxEVT\_KILL\_FOCUS one.

Types

wxFocus()

-type wxFocus() :: #wxFocus{type :: wxFocusEvent:wxFocusEventType(), win :: wxWindow:wxWindow()}.

wxFocusEvent()

-type wxFocusEvent() :: wx:wx_object().

wxFocusEventType()

-type wxFocusEventType() :: set_focus | kill_focus.

Functions

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxFocusEvent().

Returns the window associated with this event, that is the window which had the focus before for the wxEVT\_SET\_FOCUS event and the window which is going to receive focus for the wxEVT\_KILL\_FOCUS one.

Warning: the window pointer may be NULL!

wxFont

A font is an object which determines the appearance of text.

Fonts are used for drawing text to a device context, and setting the appearance of a window's text, see wxDC:setFont/2 and wxWindow:setFont/2.

The easiest way to create a custom font is to use wxFontInfo (not implemented in wx) object to specify the font attributes and then use new/5 constructor. Alternatively, you could start with one of the pre-defined fonts or use wxWindow:getFont/1 and modify the font, e.g. by increasing its size using MakeLarger() (not implemented in wx) or changing its weight using MakeBold() (not implemented in wx).

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

You can retrieve the current system font settings with wxSystemSettings.

Predefined objects (include wx.hrl): ?wxNullFont, ?wxNORMAL_FONT, ?wxSMALL_FONT, ?wxITALIC_FONT, ?wxSWISS_FONT

See:

Overview font

wxDC:setFont/2

wxDC:drawText/3

wxDC:getTextExtent/3

wxFontDialog

wxSystemSettings

wxWidgets docs: wxFont

Summary

Types

wxFont()

Functions

destroy(This)

Destroys the object

getDefaultEncoding()

Returns the current application's default encoding.

getFaceName(This)

Returns the face name associated with the font, or the empty string if there is no face information.

getFamily(This)

Gets the font family if possible.

getNativeFontInfoDesc(This)

Returns the platform-dependent string completely describing this font.

getNativeFontInfoUserDesc(This)

Returns a user-friendly string for this font object.

getPointSize(This)

Gets the point size as an integer number.

getStyle(This)

Gets the font style.

getUnderlined(This)

Returns true if the font is underlined, false otherwise.

getWeight(This)

Gets the font weight.

isFixedWidth(This)

Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.

isOk(This)

Returns true if this object is a valid font, false otherwise.

new()

Default ctor.

new/1

Copy constructor, uses reference counting.

new/4

Equivalent to: new/5

new/5

Creates a font object with the specified attributes and size in pixels.

ok(This)

Equivalent to: isOk/1

setDefaultEncoding(Encoding)

Sets the default font encoding.

setFaceName(This, FaceName)

Sets the facename for the font.

setFamily(This, Family)

Sets the font family.

setPointSize(This, PointSize)

Sets the font size in points to an integer value.

setStyle(This, Style)

Sets the font style.

setUnderlined(This, Underlined)

Sets underlining.

setWeight(This, Weight)

Sets the font weight.

Types

wxFont()

-type wxFont() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxFont()) -> ok.

Destroys the object

getDefaultEncoding()

-spec getDefaultEncoding() -> wx:wx_enum().

Returns the current application's default encoding.

See:

Overview fontencoding

setDefaultEncoding/1

getFaceName(This)

-spec getFaceName(This) -> unicode:charlist() when This :: wxFont().

Returns the face name associated with the font, or the empty string if there is no face information.

See: setFaceName/2

getFamily(This)

-spec getFamily(This) -> wx:wx_enum() when This :: wxFont().

Gets the font family if possible.

As described in ?wxFontFamily docs the returned value acts as a rough, basic classification of the main font properties (look, spacing).

If the current font face name is not recognized by wxFont or by the underlying system, wxFONTFAMILY_DEFAULT is returned.

Note that currently this function is not very precise and so not particularly useful. Font families mostly make sense only for font creation, see setFamily/2.

See: setFamily/2

getNativeFontInfoDesc(This)

-spec getNativeFontInfoDesc(This) -> unicode:charlist() when This :: wxFont().

Returns the platform-dependent string completely describing this font.

Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).

Note that the returned string is not meant to be shown or edited by the user: a typical use of this function is for serializing in string-form a wxFont object.

See: getNativeFontInfoUserDesc/1

getNativeFontInfoUserDesc(This)

-spec getNativeFontInfoUserDesc(This) -> unicode:charlist() when This :: wxFont().

Returns a user-friendly string for this font object.

Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).

The string does not encode all wxFont infos under all platforms; e.g. under wxMSW the font family is not present in the returned string.

Some examples of the formats of returned strings (which are platform-dependent) are in SetNativeFontInfoUserDesc() (not implemented in wx).

See: getNativeFontInfoDesc/1

getPointSize(This)

-spec getPointSize(This) -> integer() when This :: wxFont().

Gets the point size as an integer number.

This function is kept for compatibility reasons. New code should use GetFractionalPointSize() (not implemented in wx) and support fractional point sizes.

See: setPointSize/2

getStyle(This)

-spec getStyle(This) -> wx:wx_enum() when This :: wxFont().

Gets the font style.

See ?wxFontStyle for a list of valid styles.

See: setStyle/2

getUnderlined(This)

-spec getUnderlined(This) -> boolean() when This :: wxFont().

Returns true if the font is underlined, false otherwise.

See: setUnderlined/2

getWeight(This)

-spec getWeight(This) -> wx:wx_enum() when This :: wxFont().

Gets the font weight.

See ?wxFontWeight for a list of valid weight identifiers.

See: setWeight/2

isFixedWidth(This)

-spec isFixedWidth(This) -> boolean() when This :: wxFont().

Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.

Note that this function under some platforms is different from just testing for the font family being equal to wxFONTFAMILY_TELETYPE because native platform-specific functions are used for the check (resulting in a more accurate return value).

isOk(This)

-spec isOk(This) -> boolean() when This :: wxFont().

Returns true if this object is a valid font, false otherwise.

new()

-spec new() -> wxFont().

Default ctor.

new/1

-spec new(NativeInfoString) -> wxFont() when NativeInfoString :: unicode:chardata();
         (Font) -> wxFont() when Font :: wxFont().

Copy constructor, uses reference counting.

new/4

-spec new(PointSize, Family, Style, Weight) -> wxFont()
             when
                 PointSize :: integer(),
                 Family :: wx:wx_enum(),
                 Style :: wx:wx_enum(),
                 Weight :: wx:wx_enum();
         (PixelSize, Family, Style, Weight) -> wxFont()
             when
                 PixelSize :: {W :: integer(), H :: integer()},
                 Family :: wx:wx_enum(),
                 Style :: wx:wx_enum(),
                 Weight :: wx:wx_enum().

Equivalent to: new/5

new/5

-spec new(PointSize, Family, Style, Weight, [Option]) -> wxFont()
             when
                 PointSize :: integer(),
                 Family :: wx:wx_enum(),
                 Style :: wx:wx_enum(),
                 Weight :: wx:wx_enum(),
                 Option ::
                     {underlined, boolean()} | {face, unicode:chardata()} | {encoding, wx:wx_enum()};
         (PixelSize, Family, Style, Weight, [Option]) -> wxFont()
             when
                 PixelSize :: {W :: integer(), H :: integer()},
                 Family :: wx:wx_enum(),
                 Style :: wx:wx_enum(),
                 Weight :: wx:wx_enum(),
                 Option ::
                     {underline, boolean()} | {faceName, unicode:chardata()} | {encoding, wx:wx_enum()}.

Creates a font object with the specified attributes and size in pixels.

Notice that the use of this constructor is often more verbose and less readable than the use of constructor from wxFontInfo (not implemented in wx), consider using that constructor instead.

Remark: If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.

ok(This)

-spec ok(This) -> boolean() when This :: wxFont().

Equivalent to: isOk/1

setDefaultEncoding(Encoding)

-spec setDefaultEncoding(Encoding) -> ok when Encoding :: wx:wx_enum().

Sets the default font encoding.

See:

Overview fontencoding

getDefaultEncoding/0

setFaceName(This, FaceName)

-spec setFaceName(This, FaceName) -> boolean() when This :: wxFont(), FaceName :: unicode:chardata().

Sets the facename for the font.

Remark: To avoid portability problems, don't rely on a specific face, but specify the font family instead (see ?wxFontFamily and setFamily/2).

Return: true if the given face name exists; if the face name doesn't exist in the user's system then the font is invalidated (so that isOk/1 will return false) and false is returned.

See:

getFaceName/1

setFamily/2

setFamily(This, Family)

-spec setFamily(This, Family) -> ok when This :: wxFont(), Family :: wx:wx_enum().

Sets the font family.

As described in ?wxFontFamily docs the given family value acts as a rough, basic indication of the main font properties (look, spacing).

Note that changing the font family results in changing the font face name.

See:

getFamily/1

setFaceName/2

setPointSize(This, PointSize)

-spec setPointSize(This, PointSize) -> ok when This :: wxFont(), PointSize :: integer().

Sets the font size in points to an integer value.

This is a legacy version of the function only supporting integer point sizes. It can still be used, but to avoid unnecessarily restricting the font size in points to integer values, consider using the new (added in wxWidgets 3.1.2) SetFractionalPointSize() (not implemented in wx) function instead.

setStyle(This, Style)

-spec setStyle(This, Style) -> ok when This :: wxFont(), Style :: wx:wx_enum().

Sets the font style.

See: getStyle/1

setUnderlined(This, Underlined)

-spec setUnderlined(This, Underlined) -> ok when This :: wxFont(), Underlined :: boolean().

Sets underlining.

See: getUnderlined/1

setWeight(This, Weight)

-spec setWeight(This, Weight) -> ok when This :: wxFont(), Weight :: wx:wx_enum().

Sets the font weight.

See: getWeight/1

wxFontData

This class holds a variety of information related to font dialogs.

See:

Overview cmndlg

wxFont

wxFontDialog

wxWidgets docs: wxFontData

Summary

Types

wxFontData()

Functions

destroy(This)

Destroys the object

enableEffects(This, Enable)

Enables or disables "effects" under Windows or generic only.

getAllowSymbols(This)

Under Windows, returns a flag determining whether symbol fonts can be selected.

getChosenFont(This)

Gets the font chosen by the user if the user pressed OK (wxFontDialog::ShowModal() (not implemented in wx) returned wxID_OK).

getColour(This)

Gets the colour associated with the font dialog.

getEnableEffects(This)

Determines whether "effects" are enabled under Windows.

getInitialFont(This)

Gets the font that will be initially used by the font dialog.

getShowHelp(This)

Returns true if the Help button will be shown (Windows only).

new()

Constructor.

new(Data)

Copy Constructor.

setAllowSymbols(This, AllowSymbols)

Under Windows, determines whether symbol fonts can be selected.

setChosenFont(This, Font)

Sets the font that will be returned to the user (for internal use only).

setColour(This, Colour)

Sets the colour that will be used for the font foreground colour.

setInitialFont(This, Font)

Sets the font that will be initially used by the font dialog.

setRange(This, Min, Max)

Sets the valid range for the font point size (Windows only).

setShowHelp(This, ShowHelp)

Determines whether the Help button will be displayed in the font dialog (Windows only).

Types

wxFontData()

-type wxFontData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxFontData()) -> ok.

Destroys the object

enableEffects(This, Enable)

-spec enableEffects(This, Enable) -> ok when This :: wxFontData(), Enable :: boolean().

Enables or disables "effects" under Windows or generic only.

This refers to the controls for manipulating colour, strikeout and underline properties.

The default value is true.

getAllowSymbols(This)

-spec getAllowSymbols(This) -> boolean() when This :: wxFontData().

Under Windows, returns a flag determining whether symbol fonts can be selected.

Has no effect on other platforms.

The default value is true.

getChosenFont(This)

-spec getChosenFont(This) -> wxFont:wxFont() when This :: wxFontData().

Gets the font chosen by the user if the user pressed OK (wxFontDialog::ShowModal() (not implemented in wx) returned wxID_OK).

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxFontData().

Gets the colour associated with the font dialog.

The default value is black.

getEnableEffects(This)

-spec getEnableEffects(This) -> boolean() when This :: wxFontData().

Determines whether "effects" are enabled under Windows.

This refers to the controls for manipulating colour, strikeout and underline properties.

The default value is true.

getInitialFont(This)

-spec getInitialFont(This) -> wxFont:wxFont() when This :: wxFontData().

Gets the font that will be initially used by the font dialog.

This should have previously been set by the application.

getShowHelp(This)

-spec getShowHelp(This) -> boolean() when This :: wxFontData().

Returns true if the Help button will be shown (Windows only).

The default value is false.

new()

-spec new() -> wxFontData().

Constructor.

Initializes fontColour to black, showHelp to false, allowSymbols to true, enableEffects to true, minSize to 0 and maxSize to 0.

new(Data)

-spec new(Data) -> wxFontData() when Data :: wxFontData().

Copy Constructor.

setAllowSymbols(This, AllowSymbols)

-spec setAllowSymbols(This, AllowSymbols) -> ok when This :: wxFontData(), AllowSymbols :: boolean().

Under Windows, determines whether symbol fonts can be selected.

Has no effect on other platforms.

The default value is true.

setChosenFont(This, Font)

-spec setChosenFont(This, Font) -> ok when This :: wxFontData(), Font :: wxFont:wxFont().

Sets the font that will be returned to the user (for internal use only).

setColour(This, Colour)

-spec setColour(This, Colour) -> ok when This :: wxFontData(), Colour :: wx:wx_colour().

Sets the colour that will be used for the font foreground colour.

The default colour is black.

setInitialFont(This, Font)

-spec setInitialFont(This, Font) -> ok when This :: wxFontData(), Font :: wxFont:wxFont().

Sets the font that will be initially used by the font dialog.

setRange(This, Min, Max)

-spec setRange(This, Min, Max) -> ok when This :: wxFontData(), Min :: integer(), Max :: integer().

Sets the valid range for the font point size (Windows only).

The default is 0, 0 (unrestricted range).

setShowHelp(This, ShowHelp)

-spec setShowHelp(This, ShowHelp) -> ok when This :: wxFontData(), ShowHelp :: boolean().

Determines whether the Help button will be displayed in the font dialog (Windows only).

The default value is false.

wxFontDialog

This class represents the font chooser dialog.

See:

Overview cmndlg

wxFontData

?wxGetFontFromUser()

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxFontDialog

Summary

Types

wxFontDialog()

Functions

create(This, Parent, Data)

Creates the dialog if the wxFontDialog object had been initialized using the default constructor.

destroy(This)

Destroys the object

getFontData(This)

Returns the wxFontData associated with the font dialog.

new()

Default ctor.

new(Parent, Data)

Constructor.

Types

wxFontDialog()

-type wxFontDialog() :: wx:wx_object().

Functions

create(This, Parent, Data)

-spec create(This, Parent, Data) -> boolean()
                when
                    This :: wxFontDialog(),
                    Parent :: wxWindow:wxWindow(),
                    Data :: wxFontData:wxFontData().

Creates the dialog if the wxFontDialog object had been initialized using the default constructor.

Return: true on success and false if an error occurred.

destroy(This)

-spec destroy(This :: wxFontDialog()) -> ok.

Destroys the object

getFontData(This)

-spec getFontData(This) -> wxFontData:wxFontData() when This :: wxFontDialog().

Returns the wxFontData associated with the font dialog.

new()

-spec new() -> wxFontDialog().

Default ctor.

create/3 must be called before the dialog can be shown.

new(Parent, Data)

-spec new(Parent, Data) -> wxFontDialog()
             when Parent :: wxWindow:wxWindow(), Data :: wxFontData:wxFontData().

Constructor.

Pass a parent window, and the wxFontData object to be used to initialize the dialog controls.

wxFontPickerCtrl

This control allows the user to select a font.

The generic implementation is a button which brings up a wxFontDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the font-chooser dialog. It is only available if wxUSE_FONTPICKERCTRL is set to 1 (the default).

Styles

This class supports the following styles:

wxFNTP_DEFAULT_STYLE: The default style: wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL.

wxFNTP_USE_TEXTCTRL: Creates a text control to the left of the picker button which is completely managed by the wxFontPickerCtrl and which can be used by the user to specify a font (see SetSelectedFont). The text control is automatically synchronized with button's value. Use functions defined in wxPickerBase to modify the text control.

wxFNTP_FONTDESC_AS_LABEL: Keeps the label of the button updated with the fontface name and the font size. E.g. choosing "Times New Roman bold, italic with size 10" from the fontdialog, will update the label (overwriting any previous label) with the "Times New Roman, 10" text.

wxFNTP_USEFONT_FOR_LABEL: Uses the currently selected font to draw the label of the button.

See:

wxFontDialog

wxFontPickerEvent

This class is derived, and can use functions, from:

wxPickerBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxFontPickerCtrl

Events

Event types emitted from this class:

command_fontpicker_changed

Summary

Types

wxFontPickerCtrl()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates this widget with given parameters.

destroy(This)

Destroys the object

getMaxPointSize(This)

Returns the maximum point size value allowed for the user-chosen font.

getSelectedFont(This)

Returns the currently selected font.

new()

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Initializes the object and calls create/4 with all the parameters.

setMaxPointSize(This, Max)

Sets the maximum point size value allowed for the user-chosen font.

setSelectedFont(This, Font)

Sets the currently selected font.

Types

wxFontPickerCtrl()

-type wxFontPickerCtrl() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxFontPickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxFontPickerCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {initial, wxFont:wxFont()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates this widget with given parameters.

Return: true if the control was successfully created or false if creation failed.

destroy(This)

-spec destroy(This :: wxFontPickerCtrl()) -> ok.

Destroys the object

getMaxPointSize(This)

-spec getMaxPointSize(This) -> integer() when This :: wxFontPickerCtrl().

Returns the maximum point size value allowed for the user-chosen font.

getSelectedFont(This)

-spec getSelectedFont(This) -> wxFont:wxFont() when This :: wxFontPickerCtrl().

Returns the currently selected font.

Note that this function is completely different from wxWindow:getFont/1.

new()

-spec new() -> wxFontPickerCtrl().

new(Parent, Id)

-spec new(Parent, Id) -> wxFontPickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxFontPickerCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {initial, wxFont:wxFont()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Initializes the object and calls create/4 with all the parameters.

setMaxPointSize(This, Max)

-spec setMaxPointSize(This, Max) -> ok when This :: wxFontPickerCtrl(), Max :: integer().

Sets the maximum point size value allowed for the user-chosen font.

The default value is 100. Note that big fonts can require a lot of memory and CPU time both for creation and for rendering; thus, specially because the user has the option to specify the fontsize through a text control (see wxFNTP_USE_TEXTCTRL), it's a good idea to put a limit to the maximum font size when huge fonts do not make much sense.

setSelectedFont(This, Font)

-spec setSelectedFont(This, Font) -> ok when This :: wxFontPickerCtrl(), Font :: wxFont:wxFont().

Sets the currently selected font.

Note that this function is completely different from wxWindow:setFont/2.

wxFontPickerEvent

This event class is used for the events generated by wxFontPickerCtrl.

See: wxFontPickerCtrl

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxFontPickerEvent

Events

Use wxEvtHandler:connect/3 with wxFontPickerEventType to subscribe to events of this type.

Summary

Types

wxFontPicker()

wxFontPickerEvent()

wxFontPickerEventType()

Functions

getFont(This)

Retrieve the font the user has just selected.

Types

wxFontPicker()

-type wxFontPicker() ::
          #wxFontPicker{type :: wxFontPickerEvent:wxFontPickerEventType(), font :: wxFont:wxFont()}.

wxFontPickerEvent()

-type wxFontPickerEvent() :: wx:wx_object().

wxFontPickerEventType()

-type wxFontPickerEventType() :: command_fontpicker_changed.

Functions

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxFontPickerEvent().

Retrieve the font the user has just selected.

wxFrame

A frame is a window whose size and position can (usually) be changed by the user.

It usually has thick borders and a title bar, and can optionally contain a menu bar, toolbar and status bar. A frame can contain any window that is not a frame or dialog.

A frame that has a status bar and toolbar, created via the createStatusBar/2 and createToolBar/2 functions, manages these windows and adjusts the value returned by wxWindow:getClientSize/1 to reflect the remaining size available to application windows.

Remark: An application should normally define an wxCloseEvent handler for the frame to respond to system close events, for example so that related data and subwindows can be cleaned up.

Default event processing

wxFrame processes the following events:

wxEVT_SIZE: if the frame has exactly one child window, not counting the status and toolbar, this child is resized to take the entire frame client area. If two or more windows are present, they should be laid out explicitly either by manually handling wxEVT_SIZE or using sizers;

wxEVT_MENU_HIGHLIGHT: the default implementation displays the help string associated with the selected item in the first pane of the status bar, if there is one.

Styles

This class supports the following styles:

wxDEFAULT_FRAME_STYLE: Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER |
wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN.

wxICONIZE: Display the frame iconized (minimized). Windows only.

wxCAPTION: Puts a caption on the frame. Notice that this flag is required by wxMINIMIZE_BOX, wxMAXIMIZE_BOX and wxCLOSE_BOX on most systems as the corresponding buttons cannot be shown if the window has no title bar at all. I.e. if wxCAPTION is not specified those styles would be simply ignored.

wxMINIMIZE: Identical to wxICONIZE. Windows only.

wxMINIMIZE_BOX: Displays a minimize box on the frame.

wxMAXIMIZE: Displays the frame maximized. Windows and GTK+ only.

wxMAXIMIZE_BOX: Displays a maximize box on the frame. Notice that under wxGTK wxRESIZE_BORDER must be used as well or this style is ignored.

wxCLOSE_BOX: Displays a close box on the frame.

wxSTAY_ON_TOP: Stay on top of all other windows, see also wxFRAME_FLOAT_ON_PARENT.

wxSYSTEM_MENU: Displays a system menu containing the list of various windows commands in the window title bar. Unlike wxMINIMIZE_BOX, wxMAXIMIZE_BOX and wxCLOSE_BOX styles this style can be used without wxCAPTION, at least under Windows, and makes the system menu available without showing it on screen in this case. However it is recommended to only use it together with wxCAPTION for consistent behaviour under all platforms.

wxRESIZE_BORDER: Displays a resizable border around the window.

wxFRAME_TOOL_WINDOW: Causes a frame with a small title bar to be created; the frame does not appear in the taskbar under Windows or GTK+.

wxFRAME_NO_TASKBAR: Creates an otherwise normal frame but it does not appear in the taskbar under Windows or GTK+ (note that it will minimize to the desktop window under Windows which may seem strange to the users and thus it might be better to use this style only without wxMINIMIZE_BOX style). In wxGTK, the flag is respected only if the window manager supports _NET_WM_STATE_SKIP_TASKBAR hint.

wxFRAME_FLOAT_ON_PARENT: The frame will always be on top of its parent (unlike wxSTAY_ON_TOP). A frame created with this style must have a non-NULL parent.

wxFRAME_SHAPED: Windows with this style are allowed to have their shape changed with the wxTopLevelWindow:setShape/2 method. The default frame style is for normal, resizable frames. To create a frame which cannot be resized by user, you may use the following combination of styles:

See also the overview_windowstyles.

Extra Styles

This class supports the following extra styles:

wxFRAME_EX_CONTEXTHELP: Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send a wxEVT_HELP event if the user clicked on an application window. Note that this is an extended style and must be set by calling SetExtraStyle before Create is called (two-step construction). You cannot use this style together with wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so you should use wxDEFAULT_FRAME_STYLE ~ (wxMINIMIZE_BOX | wxMAXIMIZE_BOX) for the frames having this style (the dialogs don't have a minimize or a maximize box by default)

wxFRAME_EX_METAL: On macOS, frames with this style will be shown with a metallic look. This is an extra style.

See:

wxMDIParentFrame

wxMDIChildFrame

wxMiniFrame

wxDialog

This class is derived, and can use functions, from:

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxFrame

Events

Event types emitted from this class:

close_window

iconize

menu_open

menu_close

menu_highlight

Summary

Types

wxFrame()

Functions

create(This, Parent, Id, Title)

Equivalent to create(This, Parent, Id, Title, []).

create/5

Used in two-step frame construction.

createStatusBar(This)

Equivalent to createStatusBar(This, []).

createStatusBar/2

Creates a status bar at the bottom of the frame.

createToolBar(This)

Equivalent to createToolBar(This, []).

createToolBar/2

Creates a toolbar at the top or left of the frame.

destroy(This)

Destroys the object

getClientAreaOrigin(This)

Returns the origin of the frame client area (in client coordinates).

getMenuBar(This)

Returns a pointer to the menubar currently associated with the frame (if any).

getStatusBar(This)

Returns a pointer to the status bar currently associated with the frame (if any).

getStatusBarPane(This)

Returns the status bar pane used to display menu and toolbar help.

getToolBar(This)

Returns a pointer to the toolbar currently associated with the frame (if any).

new()

Default constructor.

new(Parent, Id, Title)

Equivalent to new(Parent, Id, Title, []).

new/4

Constructor, creating the window.

processCommand(This, Id)

Simulate a menu command.

sendSizeEvent(This)

Equivalent to sendSizeEvent(This, []).

sendSizeEvent/2

This function sends a dummy wxSizeEvent to the window allowing it to re-layout its children positions.

setMenuBar(This, MenuBar)

Tells the frame to show the given menu bar.

setStatusBar(This, StatusBar)

Associates a status bar with the frame.

setStatusBarPane(This, N)

Set the status bar pane used to display menu and toolbar help.

setStatusText(This, Text)

Equivalent to setStatusText(This, Text, []).

setStatusText/3

Sets the status bar text and updates the status bar display.

setStatusWidths(This, Widths_field)

Sets the widths of the fields in the status bar.

setToolBar(This, ToolBar)

Associates a toolbar with the frame.

Types

wxFrame()

-type wxFrame() :: wx:wx_object().

Functions

create(This, Parent, Id, Title)

-spec create(This, Parent, Id, Title) -> boolean()
                when
                    This :: wxFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Id, Title, []).

create/5

-spec create(This, Parent, Id, Title, [Option]) -> boolean()
                when
                    This :: wxFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Used in two-step frame construction.

See new/4 for further details.

createStatusBar(This)

-spec createStatusBar(This) -> wxStatusBar:wxStatusBar() when This :: wxFrame().

Equivalent to createStatusBar(This, []).

createStatusBar/2

-spec createStatusBar(This, [Option]) -> wxStatusBar:wxStatusBar()
                         when
                             This :: wxFrame(),
                             Option :: {number, integer()} | {style, integer()} | {id, integer()}.

Creates a status bar at the bottom of the frame.

Return: A pointer to the status bar if it was created successfully, NULL otherwise.

Remark: The width of the status bar is the whole width of the frame (adjusted automatically when resizing), and the height and text size are chosen by the host windowing system.

See:

setStatusText/3

getStatusBar/1

createToolBar(This)

-spec createToolBar(This) -> wxToolBar:wxToolBar() when This :: wxFrame().

Equivalent to createToolBar(This, []).

createToolBar/2

-spec createToolBar(This, [Option]) -> wxToolBar:wxToolBar()
                       when This :: wxFrame(), Option :: {style, integer()} | {id, integer()}.

Creates a toolbar at the top or left of the frame.

Return: A pointer to the toolbar if it was created successfully, NULL otherwise.

Remark: By default, the toolbar is an instance of wxToolBar. To use a different class, override OnCreateToolBar() (not implemented in wx). When a toolbar has been created with this function, or made known to the frame with setToolBar/2, the frame will manage the toolbar position and adjust the return value from wxWindow:getClientSize/1 to reflect the available space for application windows. Under Pocket PC, you should always use this function for creating the toolbar to be managed by the frame, so that wxWidgets can use a combined menubar and toolbar. Where you manage your own toolbars, create a wxToolBar as usual.

See:

createStatusBar/2

setToolBar/2

getToolBar/1

destroy(This)

-spec destroy(This :: wxFrame()) -> ok.

Destroys the object

getClientAreaOrigin(This)

-spec getClientAreaOrigin(This) -> {X :: integer(), Y :: integer()} when This :: wxFrame().

Returns the origin of the frame client area (in client coordinates).

It may be different from (0, 0) if the frame has a toolbar.

getMenuBar(This)

-spec getMenuBar(This) -> wxMenuBar:wxMenuBar() when This :: wxFrame().

Returns a pointer to the menubar currently associated with the frame (if any).

See:

setMenuBar/2

wxMenuBar

wxMenu

getStatusBar(This)

-spec getStatusBar(This) -> wxStatusBar:wxStatusBar() when This :: wxFrame().

Returns a pointer to the status bar currently associated with the frame (if any).

See:

createStatusBar/2

wxStatusBar

getStatusBarPane(This)

-spec getStatusBarPane(This) -> integer() when This :: wxFrame().

Returns the status bar pane used to display menu and toolbar help.

See: setStatusBarPane/2

getToolBar(This)

-spec getToolBar(This) -> wxToolBar:wxToolBar() when This :: wxFrame().

Returns a pointer to the toolbar currently associated with the frame (if any).

See:

createToolBar/2

wxToolBar

setToolBar/2

new()

-spec new() -> wxFrame().

Default constructor.

new(Parent, Id, Title)

-spec new(Parent, Id, Title) -> wxFrame()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Title :: unicode:chardata().

Equivalent to new(Parent, Id, Title, []).

new/4

-spec new(Parent, Id, Title, [Option]) -> wxFrame()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Title :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating the window.

Remark: For Motif, MWM (the Motif Window Manager) should be running for any window styles to work (otherwise all styles take effect).

See: create/5

processCommand(This, Id)

-spec processCommand(This, Id) -> boolean() when This :: wxFrame(), Id :: integer().

Simulate a menu command.

sendSizeEvent(This)

-spec sendSizeEvent(This) -> ok when This :: wxFrame().

Equivalent to sendSizeEvent(This, []).

sendSizeEvent/2

-spec sendSizeEvent(This, [Option]) -> ok when This :: wxFrame(), Option :: {flags, integer()}.

This function sends a dummy wxSizeEvent to the window allowing it to re-layout its children positions.

It is sometimes useful to call this function after adding or deleting a children after the frame creation or if a child size changes. Note that if the frame is using either sizers or constraints for the children layout, it is enough to call wxWindow:layout/1 directly and this function should not be used in this case.

If flags includes wxSEND_EVENT_POST value, this function posts the event, i.e. schedules it for later processing, instead of dispatching it directly. You can also use PostSizeEvent() (not implemented in wx) as a more readable equivalent of calling this function with this flag.

setMenuBar(This, MenuBar)

-spec setMenuBar(This, MenuBar) -> ok when This :: wxFrame(), MenuBar :: wxMenuBar:wxMenuBar().

Tells the frame to show the given menu bar.

Remark: If the frame is destroyed, the menu bar and its menus will be destroyed also, so do not delete the menu bar explicitly (except by resetting the frame's menu bar to another frame or NULL). Under Windows, a size event is generated, so be sure to initialize data members properly before calling setMenuBar/2. Note that on some platforms, it is not possible to call this function twice for the same frame object.

See:

getMenuBar/1

wxMenuBar

wxMenu

setStatusBar(This, StatusBar)

-spec setStatusBar(This, StatusBar) -> ok when This :: wxFrame(), StatusBar :: wxStatusBar:wxStatusBar().

Associates a status bar with the frame.

If statusBar is NULL, then the status bar, if present, is detached from the frame, but not deleted.

See:

createStatusBar/2

wxStatusBar

getStatusBar/1

setStatusBarPane(This, N)

-spec setStatusBarPane(This, N) -> ok when This :: wxFrame(), N :: integer().

Set the status bar pane used to display menu and toolbar help.

Using -1 disables help display.

setStatusText(This, Text)

-spec setStatusText(This, Text) -> ok when This :: wxFrame(), Text :: unicode:chardata().

Equivalent to setStatusText(This, Text, []).

setStatusText/3

-spec setStatusText(This, Text, [Option]) -> ok
                       when This :: wxFrame(), Text :: unicode:chardata(), Option :: {number, integer()}.

Sets the status bar text and updates the status bar display.

This is a simple wrapper for wxStatusBar:setStatusText/3 which doesn't do anything if the frame has no status bar, i.e. getStatusBar/1 returns NULL.

Remark: Use an empty string to clear the status bar.

See:

createStatusBar/2

wxStatusBar

setStatusWidths(This, Widths_field)

-spec setStatusWidths(This, Widths_field) -> ok when This :: wxFrame(), Widths_field :: [integer()].

Sets the widths of the fields in the status bar.

Remark: The widths of the variable fields are calculated from the total width of all fields, minus the sum of widths of the non-variable fields, divided by the number of variable fields.

setToolBar(This, ToolBar)

-spec setToolBar(This, ToolBar) -> ok when This :: wxFrame(), ToolBar :: wxToolBar:wxToolBar().

Associates a toolbar with the frame.

wxGBSizerItem

The wxGBSizerItem class is used by the wxGridBagSizer for tracking the items in the sizer.

It adds grid position and spanning information to the normal wxSizerItem by adding wxGBPosition (not implemented in wx) and wxGBSpan (not implemented in wx) attributes. Most of the time you will not need to use a wxGBSizerItem directly in your code, but there are a couple of cases where it is handy.

This class is derived, and can use functions, from:

wxSizerItem

wxWidgets docs: wxGBSizerItem

Summary

Types

wxGBSizerItem()

Types

wxGBSizerItem()

-type wxGBSizerItem() :: wx:wx_object().

wxGCDC

wxGCDC is a device context that draws on a wxGraphicsContext.

wxGCDC does its best to implement wxDC API, but the following features are not (fully) implemented because wxGraphicsContext doesn't support them:

wxDC:getPixel/2 method is not implemented and always returns false because modern graphics layers don't support retrieving the contents of the drawn pixels.

wxDC:floodFill/4 method is not, and can't be, implemented, as its functionality relies on reading the pixels from wxGraphicsContext too.

wxDC:setLogicalFunction/2 method only works with wxCOPY, wxOR, wxNO_OP, wxCLEAR and wxXOR functions, attempts to use any other function (including wxINVERT) don't do anything.

Similarly, ?wxRasterOperationMode parameter of wxDC:blit/6 and StretchBlit() (not implemented in wx) can only be one of the supported logical functions listed above, using any other function will result in an assertion failure and not drawing anything.

For Direct2D-based wxGraphicsContext, only true-type fonts can be used in the font-related functions.

See:

wxDC

wxGraphicsContext

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxGCDC

Summary

Types

wxGCDC()

Functions

destroy(This)

Destroys the object

getGraphicsContext(This)

Retrieves associated wxGraphicsContext.

new()

new(WindowDC)

Constructs a wxGCDC from a wxWindowDC.

setGraphicsContext(This, Context)

Set the graphics context to be used for this wxGCDC.

Types

wxGCDC()

-type wxGCDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGCDC()) -> ok.

Destroys the object

getGraphicsContext(This)

-spec getGraphicsContext(This) -> wxGraphicsContext:wxGraphicsContext() when This :: wxGCDC().

Retrieves associated wxGraphicsContext.

new()

-spec new() -> wxGCDC().

new(WindowDC)

-spec new(WindowDC) -> wxGCDC()
             when
                 WindowDC ::
                     wxWindowDC:wxWindowDC() |
                     wxMemoryDC:wxMemoryDC() |
                     wxGraphicsContext:wxGraphicsContext().

Constructs a wxGCDC from a wxWindowDC.

setGraphicsContext(This, Context)

-spec setGraphicsContext(This, Context) -> ok
                            when This :: wxGCDC(), Context :: wxGraphicsContext:wxGraphicsContext().

Set the graphics context to be used for this wxGCDC.

Note that this object takes ownership of context and will delete it when it is destroyed or when setGraphicsContext/2 is called again.

Also, unlike the constructor taking wxGraphicsContext, this method will reapply the current font, pen and brush, so that this object continues to use them, if they had been changed before (which is never the case when constructing wxGCDC directly from wxGraphicsContext).

wxGLCanvas

wxGLCanvas is a class for displaying OpenGL graphics.

It is always used in conjunction with wxGLContext as the context can only be made current (i.e. active for the OpenGL commands) when it is associated to a wxGLCanvas.

More precisely, you first need to create a wxGLCanvas window and then create an instance of a wxGLContext that is initialized with this wxGLCanvas and then later use either setCurrent/2 with the instance of the wxGLContext or wxGLContext:setCurrent/2 with the instance of the wxGLCanvas (which might be not the same as was used for the creation of the context) to bind the OpenGL state that is represented by the rendering context to the canvas, and then finally call swapBuffers/1 to swap the buffers of the OpenGL canvas and thus show your current output.

Please note that wxGLContext always uses physical pixels, even on the platforms where wxWindow uses logical pixels, affected by the coordinate scaling, on high DPI displays. Thus, if you want to set the OpenGL view port to the size of entire window, you must multiply the result returned by wxWindow:getClientSize/1 by wxWindow:getContentScaleFactor/1 before passing it to glViewport(). Same considerations apply to other OpenGL functions and other coordinates, notably those retrieved from wxMouseEvent in the event handlers.

Notice that versions of wxWidgets previous to 2.9 used to implicitly create a wxGLContext inside wxGLCanvas itself. This is still supported in the current version but is deprecated now and will be removed in the future, please update your code to create the rendering contexts explicitly.

To set up the attributes for the canvas (number of bits for the depth buffer, number of bits for the stencil buffer and so on) you pass them in the constructor using a wxGLAttributes (not implemented in wx) instance. You can still use the way before 3.1.0 (setting up the correct values of the attribList parameter) but it's discouraged.

Note: On those platforms which use a configure script (e.g. Linux and macOS) OpenGL support is automatically enabled if the relative headers and libraries are found. To switch it on under the other platforms (e.g. Windows), you need to edit the setup.h file and set wxUSE_GLCANVAS to 1 and then also pass USE_OPENGL=1 to the make utility. You may also need to add opengl32.lib (and glu32.lib for old OpenGL versions) to the list of the libraries your program is linked with.

See: wxGLContext

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxGLCanvas

Summary

Types

wxGLCanvas()

Functions

createSurface(This)

destroy(This)

Destroys the object

isDisplaySupported(AttribList)

Determines if a canvas having the specified attributes is available.

new(Parent)

Equivalent to new(Parent, []).

new/2

This constructor is still available only for compatibility reasons.

setCurrent(This, Context)

Makes the OpenGL state that is represented by the OpenGL rendering context context current, i.e.

swapBuffers(This)

Swaps the double-buffer of this window, making the back-buffer the front-buffer and vice versa, so that the output of the previous OpenGL commands is displayed on the window.

Types

wxGLCanvas()

-type wxGLCanvas() :: wx:wx_object().

Functions

createSurface(This)

-spec createSurface(This) -> boolean() when This :: wxGLCanvas().

destroy(This)

-spec destroy(This :: wxGLCanvas()) -> ok.

Destroys the object

isDisplaySupported(AttribList)

-spec isDisplaySupported(AttribList) -> boolean() when AttribList :: [integer()].

Determines if a canvas having the specified attributes is available.

This only applies for visual attributes, not rendering context attributes. Please, use the new form of this method, using wxGLAttributes (not implemented in wx).

Return: true if attributes are supported.

new(Parent)

-spec new(Parent) -> wxGLCanvas() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxGLCanvas()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {attribList, [integer()]} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {name, unicode:chardata()} |
                     {palette, wxPalette:wxPalette()}.

This constructor is still available only for compatibility reasons.

Please use the constructor with wxGLAttributes (not implemented in wx) instead.

If attribList is not specified, wxGLAttributes::PlatformDefaults() (not implemented in wx) is used, plus some other attributes (see below).

setCurrent(This, Context)

-spec setCurrent(This, Context) -> boolean()
                    when This :: wxGLCanvas(), Context :: wxGLContext:wxGLContext().

Makes the OpenGL state that is represented by the OpenGL rendering context context current, i.e.

it will be used by all subsequent OpenGL calls.

This is equivalent to wxGLContext:setCurrent/2 called with this window as parameter.

Note: This function may only be called when the window is shown on screen, in particular it can't usually be called from the constructor as the window isn't yet shown at this moment.

Return: false if an error occurred.

swapBuffers(This)

-spec swapBuffers(This) -> boolean() when This :: wxGLCanvas().

Swaps the double-buffer of this window, making the back-buffer the front-buffer and vice versa, so that the output of the previous OpenGL commands is displayed on the window.

Return: false if an error occurred.

wxGLContext

An instance of a wxGLContext represents the state of an OpenGL state machine and the connection between OpenGL and the system.

The OpenGL state includes everything that can be set with the OpenGL API: colors, rendering variables, buffer data ids, texture objects, etc. It is possible to have multiple rendering contexts share buffer data and textures. This feature is specially useful when the application use multiple threads for updating data into the memory of the graphics card.

Whether one only rendering context is used with or bound to multiple output windows or if each window has its own bound context is a developer decision. It is important to take into account that GPU makers may set different pointers to the same OGL function for different contexts. The way these pointers are retrieved from the OGL driver should be used again for each new context.

Binding (making current) a rendering context with another instance of a wxGLCanvas however works only if the both wxGLCanvas instances were created with the same attributes.

OpenGL version 3 introduced a new type of specification profile, the modern core profile. The old compatibility profile maintains all legacy features. Since wxWidgets 3.1.0 you can choose the type of context and even ask for a specified OGL version number. However, its advised to use only core profile as the compatibility profile may run a bit slower.

OpenGL core profile specification defines several flags at context creation that determine not only the type of context but also some features. Some of these flags can be set in the list of attributes used at wxGLCanvas ctor. But since wxWidgets 3.1.0 it is strongly encouraged to use the new mechanism: setting the context attributes with a wxGLContextAttrs (not implemented in wx) object and the canvas attributes with a wxGLAttributes (not implemented in wx) object.

The best way of knowing if your OpenGL environment supports a specific type of context is creating a wxGLContext instance and checking isOK/1. If it returns false, then simply delete that instance and create a new one with other attributes.

wxHAS_OPENGL_ES is defined on platforms that only have this implementation available (e.g. the iPhone) and don't support the full specification.

See: wxGLCanvas

wxWidgets docs: wxGLContext

Summary

Types

wxGLContext()

Functions

destroy(This)

Destroys the object

isOK(This)

Checks if the underlying OpenGL rendering context was correctly created by the system with the requested attributes.

new(Win)

Equivalent to new(Win, []).

new/2

Constructor.

setCurrent(This, Win)

Makes the OpenGL state that is represented by this rendering context current with the wxGLCanvas win.

Types

wxGLContext()

-type wxGLContext() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGLContext()) -> ok.

Destroys the object

isOK(This)

-spec isOK(This) -> boolean() when This :: wxGLContext().

Checks if the underlying OpenGL rendering context was correctly created by the system with the requested attributes.

If this function returns false then the wxGLContext object is useless and should be deleted and recreated with different attributes.

Since: 3.1.0

new(Win)

-spec new(Win) -> wxGLContext() when Win :: wxGLCanvas:wxGLCanvas().

Equivalent to new(Win, []).

new/2

-spec new(Win, [Option]) -> wxGLContext()
             when Win :: wxGLCanvas:wxGLCanvas(), Option :: {other, wxGLContext()}.

Constructor.

setCurrent(This, Win)

-spec setCurrent(This, Win) -> boolean() when This :: wxGLContext(), Win :: wxGLCanvas:wxGLCanvas().

Makes the OpenGL state that is represented by this rendering context current with the wxGLCanvas win.

Note: win can be a different wxGLCanvas window than the one that was passed to the constructor of this rendering context. If RC is an object of type wxGLContext, the statements "RC.SetCurrent(win);" and "win.SetCurrent(RC);" are equivalent, see wxGLCanvas:setCurrent/2.

wxGauge

A gauge is a horizontal or vertical bar which shows a quantity (often time).

wxGauge supports two working modes: determinate and indeterminate progress.

The first is the usual working mode (see setValue/2 and setRange/2) while the second can be used when the program is doing some processing but you don't know how much progress is being done. In this case, you can periodically call the pulse/1 function to make the progress bar switch to indeterminate mode (graphically it's usually a set of blocks which move or bounce in the bar control).

wxGauge supports dynamic switch between these two work modes.

There are no user commands for the gauge.

Styles

This class supports the following styles:

wxGA_HORIZONTAL: Creates a horizontal gauge.

wxGA_VERTICAL: Creates a vertical gauge.

wxGA_SMOOTH: Creates smooth progress bar with one pixel wide update step (not supported by all platforms).

wxGA_TEXT: Display the current value in percents in the gauge itself. This style is only supported in wxQt and ignored under the other platforms. This flag is only available in wxWidgets 3.1.0 and later.

wxGA_PROGRESS: Reflect the value of gauge in the application taskbar button under Windows 7 and later and the dock icon under macOS, ignored under the other platforms. This flag is only available in wxWidgets 3.1.0 and later.

See:

wxSlider

wxScrollBar

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxGauge

Summary

Types

wxGauge()

Functions

create(This, Parent, Id, Range)

Equivalent to create(This, Parent, Id, Range, []).

create/5

Creates the gauge for two-step construction.

destroy(This)

Destroys the object

getRange(This)

Returns the maximum position of the gauge.

getValue(This)

Returns the current position of the gauge.

isVertical(This)

Returns true if the gauge is vertical (has wxGA_VERTICAL style) and false otherwise.

new()

Default constructor.

new(Parent, Id, Range)

Equivalent to new(Parent, Id, Range, []).

new/4

Constructor, creating and showing a gauge.

pulse(This)

Switch the gauge to indeterminate mode (if required) and makes the gauge move a bit to indicate the user that some progress has been made.

setRange(This, Range)

Sets the range (maximum value) of the gauge.

setValue(This, Pos)

Sets the position of the gauge.

Types

wxGauge()

-type wxGauge() :: wx:wx_object().

Functions

create(This, Parent, Id, Range)

-spec create(This, Parent, Id, Range) -> boolean()
                when
                    This :: wxGauge(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Range :: integer().

Equivalent to create(This, Parent, Id, Range, []).

create/5

-spec create(This, Parent, Id, Range, [Option]) -> boolean()
                when
                    This :: wxGauge(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Range :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the gauge for two-step construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxGauge()) -> ok.

Destroys the object

getRange(This)

-spec getRange(This) -> integer() when This :: wxGauge().

Returns the maximum position of the gauge.

See: setRange/2

getValue(This)

-spec getValue(This) -> integer() when This :: wxGauge().

Returns the current position of the gauge.

See: setValue/2

isVertical(This)

-spec isVertical(This) -> boolean() when This :: wxGauge().

Returns true if the gauge is vertical (has wxGA_VERTICAL style) and false otherwise.

new()

-spec new() -> wxGauge().

Default constructor.

new(Parent, Id, Range)

-spec new(Parent, Id, Range) -> wxGauge()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Range :: integer().

Equivalent to new(Parent, Id, Range, []).

new/4

-spec new(Parent, Id, Range, [Option]) -> wxGauge()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Range :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a gauge.

See: create/5

pulse(This)

-spec pulse(This) -> ok when This :: wxGauge().

Switch the gauge to indeterminate mode (if required) and makes the gauge move a bit to indicate the user that some progress has been made.

Note: After calling this function the value returned by getValue/1 is undefined and thus you need to explicitly call setValue/2 if you want to restore the determinate mode.

setRange(This, Range)

-spec setRange(This, Range) -> ok when This :: wxGauge(), Range :: integer().

Sets the range (maximum value) of the gauge.

This function makes the gauge switch to determinate mode, if it's not already.

When the gauge is in indeterminate mode, under wxMSW the gauge repeatedly goes from zero to range and back; under other ports when in indeterminate mode, the range setting is ignored.

See: getRange/1

setValue(This, Pos)

-spec setValue(This, Pos) -> ok when This :: wxGauge(), Pos :: integer().

Sets the position of the gauge.

The pos must be between 0 and the gauge range as returned by getRange/1, inclusive.

This function makes the gauge switch to determinate mode, if it was in indeterminate mode before.

See: getValue/1

wxGenericDirCtrl

This control can be used to place a directory listing (with optional files) on an arbitrary window.

The control contains a wxTreeCtrl window representing the directory hierarchy, and optionally, a wxChoice window containing a list of filters.

Styles

This class supports the following styles:

wxDIRCTRL_DIR_ONLY: Only show directories, and not files.

wxDIRCTRL_3D_INTERNAL: Use 3D borders for internal controls. This is the default.

wxDIRCTRL_SELECT_FIRST: When setting the default path, select the first file in the directory.

wxDIRCTRL_SHOW_FILTERS: Show the drop-down filter list.

wxDIRCTRL_EDIT_LABELS: Allow the folder and file labels to be editable.

wxDIRCTRL_MULTIPLE: Allows multiple files and folders to be selected.

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxGenericDirCtrl

Events

Event types emitted from this class:

dirctrl_selectionchanged

dirctrl_fileactivated

Summary

Types

wxGenericDirCtrl()

Functions

collapseTree(This)

Collapses the entire tree.

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Create function for two-step construction.

destroy(This)

Destroys the object

expandPath(This, Path)

Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.

getDefaultPath(This)

Gets the default path.

getFilePath(This)

Gets selected filename path only (else empty string).

getFilter(This)

Returns the filter string.

getFilterIndex(This)

Returns the current filter index (zero-based).

getPath(This)

Gets the currently-selected directory or filename.

getPath(This, ItemId)

Gets the path corresponding to the given tree control item.

getRootId(This)

Returns the root id for the tree control.

getTreeCtrl(This)

Returns a pointer to the tree control.

init(This)

Initializes variables.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Main constructor.

reCreateTree(This)

Collapse and expand the tree, thus re-creating it from scratch.

setDefaultPath(This, Path)

Sets the default path.

setFilter(This, Filter)

Sets the filter string.

setFilterIndex(This, N)

Sets the current filter index (zero-based).

setPath(This, Path)

Sets the current path.

Types

wxGenericDirCtrl()

-type wxGenericDirCtrl() :: wx:wx_object().

Functions

collapseTree(This)

-spec collapseTree(This) -> ok when This :: wxGenericDirCtrl().

Collapses the entire tree.

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxGenericDirCtrl(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxGenericDirCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {dir, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {filter, unicode:chardata()} |
                        {defaultFilter, integer()}.

Create function for two-step construction.

See new/2 for details.

destroy(This)

-spec destroy(This :: wxGenericDirCtrl()) -> ok.

Destroys the object

expandPath(This, Path)

-spec expandPath(This, Path) -> boolean() when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.

getDefaultPath(This)

-spec getDefaultPath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets the default path.

getFilePath(This)

-spec getFilePath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets selected filename path only (else empty string).

This function doesn't count a directory as a selection.

getFilter(This)

-spec getFilter(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Returns the filter string.

getFilterIndex(This)

-spec getFilterIndex(This) -> integer() when This :: wxGenericDirCtrl().

Returns the current filter index (zero-based).

getPath(This)

-spec getPath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets the currently-selected directory or filename.

getPath(This, ItemId)

-spec getPath(This, ItemId) -> unicode:charlist() when This :: wxGenericDirCtrl(), ItemId :: integer().

Gets the path corresponding to the given tree control item.

Since: 2.9.5

getRootId(This)

-spec getRootId(This) -> integer() when This :: wxGenericDirCtrl().

Returns the root id for the tree control.

getTreeCtrl(This)

-spec getTreeCtrl(This) -> wxTreeCtrl:wxTreeCtrl() when This :: wxGenericDirCtrl().

Returns a pointer to the tree control.

init(This)

-spec init(This) -> ok when This :: wxGenericDirCtrl().

Initializes variables.

new()

-spec new() -> wxGenericDirCtrl().

Default constructor.

new(Parent)

-spec new(Parent) -> wxGenericDirCtrl() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxGenericDirCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {dir, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {filter, unicode:chardata()} |
                     {defaultFilter, integer()}.

Main constructor.

reCreateTree(This)

-spec reCreateTree(This) -> ok when This :: wxGenericDirCtrl().

Collapse and expand the tree, thus re-creating it from scratch.

May be used to update the displayed directory content.

setDefaultPath(This, Path)

-spec setDefaultPath(This, Path) -> ok when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Sets the default path.

setFilter(This, Filter)

-spec setFilter(This, Filter) -> ok when This :: wxGenericDirCtrl(), Filter :: unicode:chardata().

Sets the filter string.

setFilterIndex(This, N)

-spec setFilterIndex(This, N) -> ok when This :: wxGenericDirCtrl(), N :: integer().

Sets the current filter index (zero-based).

setPath(This, Path)

-spec setPath(This, Path) -> ok when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Sets the current path.

wxGraphicsBrush

A wxGraphicsBrush is a native representation of a brush.

The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via wxGraphicsContext:createBrush/2 or wxGraphicsRenderer:createBrush/2.

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsBrush

Summary

Types

wxGraphicsBrush()

Types

wxGraphicsBrush()

-type wxGraphicsBrush() :: wx:wx_object().

wxGraphicsContext

A wxGraphicsContext instance is the object that is drawn upon.

It is created by a renderer using wxGraphicsRenderer:createContext/2. This can be either directly using a renderer instance, or indirectly using the static convenience create/1 functions of wxGraphicsContext that always delegate the task to the default renderer.

Remark: For some renderers (like Direct2D or Cairo) processing of drawing operations may be deferred (Direct2D render target normally builds up a batch of rendering commands but defers processing of these commands, Cairo operates on a separate surface) so to make drawing results visible you need to update the content of the context by calling wxGraphicsContext::Flush() (not implemented in wx) or by destroying the context.

See:

wxGraphicsRenderer:createContext/2

wxGCDC

wxDC

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsContext

Summary

Types

wxGraphicsContext()

Functions

clip(This, Region)

Sets the clipping region to the intersection of the given region and the previously set clipping region.

clip(This, X, Y, W, H)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

concatTransform(This, Matrix)

Concatenates the passed in transform with the current transform of this context.

create()

Create a lightweight context that can be used only for measuring text.

create(WindowDC)

Creates a wxGraphicsContext from a wxWindowDC.

createBrush(This, Brush)

Creates a native brush from a wxBrush.

createFont(This, Font)

Equivalent to createFont(This, Font, []).

createFont/3

Creates a native graphics font from a wxFont and a text colour.

createFont/4

Creates a font object with the specified attributes.

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2)

Creates a native brush with a linear gradient. The brush starts at (@a x1, @a y1) and ends at (@a x2, @a y2). Either just the start and end gradient colours (@a c1 and @a c2) or full set of gradient @a stops can be specified. The version taking wxGraphicsGradientStops is new in wxWidgets 2.9.1. The matrix parameter was added in wxWidgets 3.1.3

createMatrix(This)

Equivalent to createMatrix(This, []).

createMatrix/2

Creates a native affine transformation matrix from the passed in values.

createPath(This)

Creates a native graphics path which is initially empty.

createPen(This, Pen)

Creates a native pen from a wxPen.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, OColor, CColor)

Creates a native brush with a radial gradient. The brush originates at (@a startX, @a startY) and ends on a circle around (@a endX, @a endY) with the given @a radius. The gradient may be specified either by its start and end colours @a oColor and @a cColor or by a full set of gradient @a stops. The version taking wxGraphicsGradientStops is new in wxWidgets 2.9.1. The ability to apply a transformation matrix to the gradient was added in 3.1.3

destroy(This)

Destroys the object

drawBitmap(This, Bmp, X, Y, W, H)

Draws the bitmap.

drawEllipse(This, X, Y, W, H)

Draws an ellipse.

drawIcon(This, Icon, X, Y, W, H)

Draws the icon.

drawLines(This, Points)

Equivalent to drawLines(This, Points, []).

drawLines/3

Draws a polygon.

drawPath(This, Path)

Equivalent to drawPath(This, Path, []).

drawPath/3

Draws the path by first filling and then stroking.

drawRectangle(This, X, Y, W, H)

Draws a rectangle.

drawRoundedRectangle(This, X, Y, W, H, Radius)

Draws a rounded rectangle.

drawText(This, Str, X, Y)

Draws text at the defined position.

drawText/5

Draws text at the defined position.

drawText(This, Str, X, Y, Angle, BackgroundBrush)

Draws text at the defined position.

fillPath(This, Path)

Equivalent to fillPath(This, Path, []).

fillPath/3

Fills the path with the current brush.

getPartialTextExtents(This, Text)

Fills the widths array with the widths from the beginning of text to the corresponding character of text.

getTextExtent(This, Text)

Gets the dimensions of the string using the currently selected font.

getTransform(This)

Gets the current transformation matrix of this context.

resetClip(This)

Resets the clipping to original shape.

rotate(This, Angle)

Rotates the current transformation matrix (in radians).

scale(This, XScale, YScale)

Scales the current transformation matrix.

setBrush(This, Brush)

Sets the brush for filling paths.

setFont(This, Font)

Sets the font for drawing text.

setFont(This, Font, Colour)

Sets the font for drawing text.

setPen(This, Pen)

Sets the pen used for stroking.

setTransform(This, Matrix)

Sets the current transformation matrix of this context.

strokeLine(This, X1, Y1, X2, Y2)

Strokes a single line.

strokeLines(This, Points)

Stroke lines connecting all the points.

strokePath(This, Path)

Strokes along a path with the current pen.

translate(This, Dx, Dy)

Translates the current transformation matrix.

Types

wxGraphicsContext()

-type wxGraphicsContext() :: wx:wx_object().

Functions

clip(This, Region)

-spec clip(This, Region) -> ok when This :: wxGraphicsContext(), Region :: wxRegion:wxRegion().

Sets the clipping region to the intersection of the given region and the previously set clipping region.

The clipping region is an area to which drawing is restricted.

Remark:

Clipping region should be given in logical coordinates.

Calling this function can only make the clipping region smaller, never larger.

You need to call resetClip/1 first if you want to set the clipping region exactly to the region specified.

If resulting clipping region is empty, then all drawing upon the context is clipped out (all changes made by drawing operations are masked out).

clip(This, X, Y, W, H)

-spec clip(This, X, Y, W, H) -> ok
              when
                  This :: wxGraphicsContext(),
                  X :: number(),
                  Y :: number(),
                  W :: number(),
                  H :: number().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

concatTransform(This, Matrix)

-spec concatTransform(This, Matrix) -> ok
                         when This :: wxGraphicsContext(), Matrix :: wxGraphicsMatrix:wxGraphicsMatrix().

Concatenates the passed in transform with the current transform of this context.

create()

-spec create() -> wxGraphicsContext().

Create a lightweight context that can be used only for measuring text.

create(WindowDC)

-spec create(WindowDC) -> wxGraphicsContext()
                when
                    WindowDC ::
                        wxWindowDC:wxWindowDC() |
                        wxWindow:wxWindow() |
                        wxMemoryDC:wxMemoryDC() |
                        wxImage:wxImage().

Creates a wxGraphicsContext from a wxWindowDC.

See: wxGraphicsRenderer:createContext/2

createBrush(This, Brush)

-spec createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush()
                     when This :: wxGraphicsContext(), Brush :: wxBrush:wxBrush().

Creates a native brush from a wxBrush.

createFont(This, Font)

-spec createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont()
                    when This :: wxGraphicsContext(), Font :: wxFont:wxFont().

Equivalent to createFont(This, Font, []).

createFont/3

-spec createFont(This, SizeInPixels, Facename) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsContext(),
                        SizeInPixels :: number(),
                        Facename :: unicode:chardata();
                (This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsContext(),
                        Font :: wxFont:wxFont(),
                        Option :: {col, wx:wx_colour()}.

Creates a native graphics font from a wxFont and a text colour.

Remark: For Direct2D graphics fonts can be created from TrueType fonts only.

createFont/4

-spec createFont(This, SizeInPixels, Facename, [Option]) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsContext(),
                        SizeInPixels :: number(),
                        Facename :: unicode:chardata(),
                        Option :: {flags, integer()} | {col, wx:wx_colour()}.

Creates a font object with the specified attributes.

The use of overload taking wxFont is preferred, see wxGraphicsRenderer:createFont/4 for more details.

Remark: For Direct2D graphics fonts can be created from TrueType fonts only.

Since: 2.9.3

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops)

-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) -> wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsContext(),
                                       X1 :: number(),
                                       Y1 :: number(),
                                       X2 :: number(),
                                       Y2 :: number(),
                                       Stops :: wxGraphicsGradientStops:wxGraphicsGradientStops().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2)

-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2) -> wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsContext(),
                                       X1 :: number(),
                                       Y1 :: number(),
                                       X2 :: number(),
                                       Y2 :: number(),
                                       C1 :: wx:wx_colour(),
                                       C2 :: wx:wx_colour().

Creates a native brush with a linear gradient. The brush starts at (@a x1, @a y1) and ends at (@a x2, @a y2). Either just the start and end gradient colours (@a c1 and @a c2) or full set of gradient @a stops can be specified. The version taking wxGraphicsGradientStops is new in wxWidgets 2.9.1. The matrix parameter was added in wxWidgets 3.1.3

createMatrix(This)

-spec createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when This :: wxGraphicsContext().

Equivalent to createMatrix(This, []).

createMatrix/2

-spec createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix()
                      when
                          This :: wxGraphicsContext(),
                          Option ::
                              {a, number()} |
                              {b, number()} |
                              {c, number()} |
                              {d, number()} |
                              {tx, number()} |
                              {ty, number()}.

Creates a native affine transformation matrix from the passed in values.

The default parameters result in an identity matrix.

createPath(This)

-spec createPath(This) -> wxGraphicsPath:wxGraphicsPath() when This :: wxGraphicsContext().

Creates a native graphics path which is initially empty.

createPen(This, Pen)

-spec createPen(This, Pen) -> wxGraphicsPen:wxGraphicsPen()
                   when This :: wxGraphicsContext(), Pen :: wxPen:wxPen().

Creates a native pen from a wxPen.

Prefer to use the overload taking wxGraphicsPenInfo (not implemented in wx) unless you already have a wxPen as constructing one only to pass it to this method is wasteful.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops)

-spec createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops) ->
                                   wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsContext(),
                                       StartX :: number(),
                                       StartY :: number(),
                                       EndX :: number(),
                                       EndY :: number(),
                                       Radius :: number(),
                                       Stops :: wxGraphicsGradientStops:wxGraphicsGradientStops().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, OColor, CColor)

-spec createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, OColor, CColor) ->
                                   wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsContext(),
                                       StartX :: number(),
                                       StartY :: number(),
                                       EndX :: number(),
                                       EndY :: number(),
                                       Radius :: number(),
                                       OColor :: wx:wx_colour(),
                                       CColor :: wx:wx_colour().

Creates a native brush with a radial gradient. The brush originates at (@a startX, @a startY) and ends on a circle around (@a endX, @a endY) with the given @a radius. The gradient may be specified either by its start and end colours @a oColor and @a cColor or by a full set of gradient @a stops. The version taking wxGraphicsGradientStops is new in wxWidgets 2.9.1. The ability to apply a transformation matrix to the gradient was added in 3.1.3

destroy(This)

-spec destroy(This :: wxGraphicsContext()) -> ok.

Destroys the object

drawBitmap(This, Bmp, X, Y, W, H)

-spec drawBitmap(This, Bmp, X, Y, W, H) -> ok
                    when
                        This :: wxGraphicsContext(),
                        Bmp :: wxBitmap:wxBitmap(),
                        X :: number(),
                        Y :: number(),
                        W :: number(),
                        H :: number().

Draws the bitmap.

In case of a mono bitmap, this is treated as a mask and the current brushed is used for filling.

drawEllipse(This, X, Y, W, H)

-spec drawEllipse(This, X, Y, W, H) -> ok
                     when
                         This :: wxGraphicsContext(),
                         X :: number(),
                         Y :: number(),
                         W :: number(),
                         H :: number().

Draws an ellipse.

drawIcon(This, Icon, X, Y, W, H)

-spec drawIcon(This, Icon, X, Y, W, H) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Icon :: wxIcon:wxIcon(),
                      X :: number(),
                      Y :: number(),
                      W :: number(),
                      H :: number().

Draws the icon.

drawLines(This, Points)

-spec drawLines(This, Points) -> ok
                   when This :: wxGraphicsContext(), Points :: [{X :: float(), Y :: float()}].

Equivalent to drawLines(This, Points, []).

drawLines/3

-spec drawLines(This, Points, [Option]) -> ok
                   when
                       This :: wxGraphicsContext(),
                       Points :: [{X :: float(), Y :: float()}],
                       Option :: {fillStyle, wx:wx_enum()}.

Draws a polygon.

drawPath(This, Path)

-spec drawPath(This, Path) -> ok
                  when This :: wxGraphicsContext(), Path :: wxGraphicsPath:wxGraphicsPath().

Equivalent to drawPath(This, Path, []).

drawPath/3

-spec drawPath(This, Path, [Option]) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Path :: wxGraphicsPath:wxGraphicsPath(),
                      Option :: {fillStyle, wx:wx_enum()}.

Draws the path by first filling and then stroking.

drawRectangle(This, X, Y, W, H)

-spec drawRectangle(This, X, Y, W, H) -> ok
                       when
                           This :: wxGraphicsContext(),
                           X :: number(),
                           Y :: number(),
                           W :: number(),
                           H :: number().

Draws a rectangle.

drawRoundedRectangle(This, X, Y, W, H, Radius)

-spec drawRoundedRectangle(This, X, Y, W, H, Radius) -> ok
                              when
                                  This :: wxGraphicsContext(),
                                  X :: number(),
                                  Y :: number(),
                                  W :: number(),
                                  H :: number(),
                                  Radius :: number().

Draws a rounded rectangle.

drawText(This, Str, X, Y)

-spec drawText(This, Str, X, Y) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Str :: unicode:chardata(),
                      X :: number(),
                      Y :: number().

Draws text at the defined position.

drawText/5

-spec drawText(This, Str, X, Y, Angle) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Str :: unicode:chardata(),
                      X :: number(),
                      Y :: number(),
                      Angle :: number();
              (This, Str, X, Y, BackgroundBrush) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Str :: unicode:chardata(),
                      X :: number(),
                      Y :: number(),
                      BackgroundBrush :: wxGraphicsBrush:wxGraphicsBrush().

Draws text at the defined position.

drawText(This, Str, X, Y, Angle, BackgroundBrush)

-spec drawText(This, Str, X, Y, Angle, BackgroundBrush) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Str :: unicode:chardata(),
                      X :: number(),
                      Y :: number(),
                      Angle :: number(),
                      BackgroundBrush :: wxGraphicsBrush:wxGraphicsBrush().

Draws text at the defined position.

fillPath(This, Path)

-spec fillPath(This, Path) -> ok
                  when This :: wxGraphicsContext(), Path :: wxGraphicsPath:wxGraphicsPath().

Equivalent to fillPath(This, Path, []).

fillPath/3

-spec fillPath(This, Path, [Option]) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Path :: wxGraphicsPath:wxGraphicsPath(),
                      Option :: {fillStyle, wx:wx_enum()}.

Fills the path with the current brush.

getPartialTextExtents(This, Text)

-spec getPartialTextExtents(This, Text) -> [number()]
                               when This :: wxGraphicsContext(), Text :: unicode:chardata().

Fills the widths array with the widths from the beginning of text to the corresponding character of text.

getTextExtent(This, Text)

-spec getTextExtent(This, Text) -> Result
                       when
                           Result ::
                               {Width :: number(),
                                Height :: number(),
                                Descent :: number(),
                                ExternalLeading :: number()},
                           This :: wxGraphicsContext(),
                           Text :: unicode:chardata().

Gets the dimensions of the string using the currently selected font.

getTransform(This)

-spec getTransform(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when This :: wxGraphicsContext().

Gets the current transformation matrix of this context.

resetClip(This)

-spec resetClip(This) -> ok when This :: wxGraphicsContext().

Resets the clipping to original shape.

rotate(This, Angle)

-spec rotate(This, Angle) -> ok when This :: wxGraphicsContext(), Angle :: number().

Rotates the current transformation matrix (in radians).

scale(This, XScale, YScale)

-spec scale(This, XScale, YScale) -> ok
               when This :: wxGraphicsContext(), XScale :: number(), YScale :: number().

Scales the current transformation matrix.

setBrush(This, Brush)

-spec setBrush(This, Brush) -> ok
                  when
                      This :: wxGraphicsContext(),
                      Brush :: wxGraphicsBrush:wxGraphicsBrush() | wxBrush:wxBrush().

Sets the brush for filling paths.

setFont(This, Font)

-spec setFont(This, Font) -> ok
                 when This :: wxGraphicsContext(), Font :: wxGraphicsFont:wxGraphicsFont().

Sets the font for drawing text.

setFont(This, Font, Colour)

-spec setFont(This, Font, Colour) -> ok
                 when This :: wxGraphicsContext(), Font :: wxFont:wxFont(), Colour :: wx:wx_colour().

Sets the font for drawing text.

Remark: For Direct2D only TrueType fonts can be used.

setPen(This, Pen)

-spec setPen(This, Pen) -> ok
                when This :: wxGraphicsContext(), Pen :: wxPen:wxPen() | wxGraphicsPen:wxGraphicsPen().

Sets the pen used for stroking.

setTransform(This, Matrix)

-spec setTransform(This, Matrix) -> ok
                      when This :: wxGraphicsContext(), Matrix :: wxGraphicsMatrix:wxGraphicsMatrix().

Sets the current transformation matrix of this context.

strokeLine(This, X1, Y1, X2, Y2)

-spec strokeLine(This, X1, Y1, X2, Y2) -> ok
                    when
                        This :: wxGraphicsContext(),
                        X1 :: number(),
                        Y1 :: number(),
                        X2 :: number(),
                        Y2 :: number().

Strokes a single line.

strokeLines(This, Points)

-spec strokeLines(This, Points) -> ok
                     when This :: wxGraphicsContext(), Points :: [{X :: float(), Y :: float()}].

Stroke lines connecting all the points.

Unlike the other overload of this function, this method draws a single polyline and not a number of disconnected lines.

strokePath(This, Path)

-spec strokePath(This, Path) -> ok
                    when This :: wxGraphicsContext(), Path :: wxGraphicsPath:wxGraphicsPath().

Strokes along a path with the current pen.

translate(This, Dx, Dy)

-spec translate(This, Dx, Dy) -> ok when This :: wxGraphicsContext(), Dx :: number(), Dy :: number().

Translates the current transformation matrix.

wxGraphicsFont

A wxGraphicsFont is a native representation of a font.

The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via wxGraphicsContext:createFont/4 or wxGraphicsRenderer:createFont/4.

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsFont

Summary

Types

wxGraphicsFont()

Types

wxGraphicsFont()

-type wxGraphicsFont() :: wx:wx_object().

wxGraphicsGradientStops

Represents a collection of wxGraphicGradientStop values for use with CreateLinearGradientBrush and CreateRadialGradientBrush.

The stops are maintained in order of position. If two or more stops are added with the same position then the one(s) added later come later. This can be useful for producing discontinuities in the colour gradient.

Notice that this class is write-once, you can't modify the stops once they had been added.

Since: 2.9.1

wxWidgets docs: wxGraphicsGradientStops

Summary

Types

wxGraphicsGradientStops()

Functions

add(This, Col, Pos)

Add a new stop.

destroy(This)

Destroys the object

getCount(This)

Returns the number of stops.

getEndColour(This)

Returns the end colour.

getStartColour(This)

Returns the start colour.

item(This, N)

Returns the stop at the given index.

new()

Equivalent to new([]).

new(Options)

Initializes the gradient stops with the given boundary colours.

setEndColour(This, Col)

Set the end colour to col.

setStartColour(This, Col)

Set the start colour to col.

Types

wxGraphicsGradientStops()

-type wxGraphicsGradientStops() :: wx:wx_object().

Functions

add(This, Col, Pos)

-spec add(This, Col, Pos) -> ok
             when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour(), Pos :: number().

Add a new stop.

destroy(This)

-spec destroy(This :: wxGraphicsGradientStops()) -> ok.

Destroys the object

getCount(This)

-spec getCount(This) -> integer() when This :: wxGraphicsGradientStops().

Returns the number of stops.

getEndColour(This)

-spec getEndColour(This) -> wx:wx_colour4() when This :: wxGraphicsGradientStops().

Returns the end colour.

getStartColour(This)

-spec getStartColour(This) -> wx:wx_colour4() when This :: wxGraphicsGradientStops().

Returns the start colour.

item(This, N)

-spec item(This, N) -> {wx:wx_colour4(), float()} when This :: wxGraphicsGradientStops(), N :: integer().

Returns the stop at the given index.

new()

-spec new() -> wxGraphicsGradientStops().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGraphicsGradientStops()
             when Option :: {startCol, wx:wx_colour()} | {endCol, wx:wx_colour()}.

Initializes the gradient stops with the given boundary colours.

Creates a wxGraphicsGradientStops instance with start colour given by startCol and end colour given by endCol.

setEndColour(This, Col)

-spec setEndColour(This, Col) -> ok when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour().

Set the end colour to col.

setStartColour(This, Col)

-spec setStartColour(This, Col) -> ok when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour().

Set the start colour to col.

wxGraphicsMatrix

A wxGraphicsMatrix is a native representation of an affine matrix.

The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via wxGraphicsContext:createMatrix/2 or wxGraphicsRenderer:createMatrix/2.

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsMatrix

Summary

Types

wxGraphicsMatrix()

Functions

concat(This, T)

Concatenates the matrix passed with the current matrix.

get(This)

Returns the component values of the matrix via the argument pointers.

invert(This)

Inverts the matrix.

isEqual(This, T)

Returns true if the elements of the transformation matrix are equal.

isIdentity(This)

Return true if this is the identity matrix.

rotate(This, Angle)

Rotates this matrix clockwise (in radians).

scale(This, XScale, YScale)

Scales this matrix.

set(This)

Equivalent to set(This, []).

set/2

Sets the matrix to the respective values (default values are the identity matrix).

transformDistance(This)

Applies this matrix to a distance (ie.

transformPoint(This)

Applies this matrix to a point.

translate(This, Dx, Dy)

Translates this matrix.

Types

wxGraphicsMatrix()

-type wxGraphicsMatrix() :: wx:wx_object().

Functions

concat(This, T)

-spec concat(This, T) -> ok when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().

Concatenates the matrix passed with the current matrix.

The effect of the resulting transformation is to first apply the transformation in t to the coordinates and then apply the transformation in the current matrix to the coordinates.

get(This)

-spec get(This) -> Result
             when
                 Result ::
                     {A :: number(),
                      B :: number(),
                      C :: number(),
                      D :: number(),
                      Tx :: number(),
                      Ty :: number()},
                 This :: wxGraphicsMatrix().

Returns the component values of the matrix via the argument pointers.

invert(This)

-spec invert(This) -> ok when This :: wxGraphicsMatrix().

Inverts the matrix.

isEqual(This, T)

-spec isEqual(This, T) -> boolean() when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().

Returns true if the elements of the transformation matrix are equal.

isIdentity(This)

-spec isIdentity(This) -> boolean() when This :: wxGraphicsMatrix().

Return true if this is the identity matrix.

rotate(This, Angle)

-spec rotate(This, Angle) -> ok when This :: wxGraphicsMatrix(), Angle :: number().

Rotates this matrix clockwise (in radians).

scale(This, XScale, YScale)

-spec scale(This, XScale, YScale) -> ok
               when This :: wxGraphicsMatrix(), XScale :: number(), YScale :: number().

Scales this matrix.

set(This)

-spec set(This) -> ok when This :: wxGraphicsMatrix().

Equivalent to set(This, []).

set/2

-spec set(This, [Option]) -> ok
             when
                 This :: wxGraphicsMatrix(),
                 Option ::
                     {a, number()} |
                     {b, number()} |
                     {c, number()} |
                     {d, number()} |
                     {tx, number()} |
                     {ty, number()}.

Sets the matrix to the respective values (default values are the identity matrix).

transformDistance(This)

-spec transformDistance(This) -> {Dx :: number(), Dy :: number()} when This :: wxGraphicsMatrix().

Applies this matrix to a distance (ie.

performs all transforms except translations).

transformPoint(This)

-spec transformPoint(This) -> {X :: number(), Y :: number()} when This :: wxGraphicsMatrix().

Applies this matrix to a point.

translate(This, Dx, Dy)

-spec translate(This, Dx, Dy) -> ok when This :: wxGraphicsMatrix(), Dx :: number(), Dy :: number().

Translates this matrix.

wxGraphicsObject

This class is the superclass of native graphics objects like pens etc.

It allows reference counting. Not instantiated by user code.

See:

wxGraphicsBrush

wxGraphicsPen

wxGraphicsMatrix

wxGraphicsPath

wxWidgets docs: wxGraphicsObject

Summary

Types

wxGraphicsObject()

Functions

destroy(This)

Destroys the object

getRenderer(This)

Returns the renderer that was used to create this instance, or NULL if it has not been initialized yet.

isNull(This)

Return: false if this object is valid, otherwise returns true.

Types

wxGraphicsObject()

-type wxGraphicsObject() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGraphicsObject()) -> ok.

Destroys the object

getRenderer(This)

-spec getRenderer(This) -> wxGraphicsRenderer:wxGraphicsRenderer() when This :: wxGraphicsObject().

Returns the renderer that was used to create this instance, or NULL if it has not been initialized yet.

isNull(This)

-spec isNull(This) -> boolean() when This :: wxGraphicsObject().

Return: false if this object is valid, otherwise returns true.

wxGraphicsPath

A wxGraphicsPath is a native representation of a geometric path.

The contents are specific and private to the respective renderer. Instances are reference counted and can therefore be assigned as usual. The only way to get a valid instance is by using wxGraphicsContext:createPath/1 or wxGraphicsRenderer:createPath/1.

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsPath

Summary

Types

wxGraphicsPath()

Functions

addArc(This, C, R, StartAngle, EndAngle, Clockwise)

addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise)

Adds an arc of a circle.

addArcToPoint(This, X1, Y1, X2, Y2, R)

Adds an arc (of a circle with radius r) that is tangent to the line connecting current point and (x1, y1) and to the line connecting (x1, y1) and (x2, y2).

addCircle(This, X, Y, R)

Appends a circle around (x,y) with radius r as a new closed subpath.

addCurveToPoint(This, C1, C2, E)

Adds a cubic bezier curve from the current point, using two control points and an end point.

addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y)

Adds a cubic bezier curve from the current point, using two control points and an end point.

addEllipse(This, X, Y, W, H)

Appends an ellipse fitting into the passed in rectangle as a new closed subpath.

addLineToPoint(This, P)

Adds a straight line from the current point to p.

addLineToPoint(This, X, Y)

Adds a straight line from the current point to (x,y).

addPath(This, Path)

Adds another path onto the current path.

addQuadCurveToPoint(This, Cx, Cy, X, Y)

Adds a quadratic bezier curve from the current point, using a control point and an end point.

addRectangle(This, X, Y, W, H)

Appends a rectangle as a new closed subpath.

addRoundedRectangle(This, X, Y, W, H, Radius)

Appends a rounded rectangle as a new closed subpath.

closeSubpath(This)

Closes the current sub-path.

contains(This, C)

Equivalent to contains(This, C, []).

contains/3

Return: true if the point is within the path.

contains/4

Return: true if the point is within the path.

getBox(This)

Gets the bounding box enclosing all points (possibly including control points).

getCurrentPoint(This)

Gets the last point of the current path, (0,0) if not yet set.

moveToPoint(This, P)

Begins a new subpath at p.

moveToPoint(This, X, Y)

Begins a new subpath at (x,y).

transform(This, Matrix)

Transforms each point of this path by the matrix.

Types

wxGraphicsPath()

-type wxGraphicsPath() :: wx:wx_object().

Functions

addArc(This, C, R, StartAngle, EndAngle, Clockwise)

-spec addArc(This, C, R, StartAngle, EndAngle, Clockwise) -> ok
                when
                    This :: wxGraphicsPath(),
                    C :: {X :: float(), Y :: float()},
                    R :: number(),
                    StartAngle :: number(),
                    EndAngle :: number(),
                    Clockwise :: boolean().

addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise)

-spec addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise) -> ok
                when
                    This :: wxGraphicsPath(),
                    X :: number(),
                    Y :: number(),
                    R :: number(),
                    StartAngle :: number(),
                    EndAngle :: number(),
                    Clockwise :: boolean().

Adds an arc of a circle.

The circle is defined by the coordinates of its centre (x, y) or c and its radius r. The arc goes from the starting angle startAngle to endAngle either clockwise or counter-clockwise depending on the value of clockwise argument.

The angles are measured in radians but, contrary to the usual mathematical convention, are always clockwise from the horizontal axis.

If for clockwise arc endAngle is less than startAngle it will be progressively increased by 2pi until it is greater than startAngle. If for counter-clockwise arc endAngle is greater than startAngle it will be progressively decreased by 2pi until it is less than startAngle.

If there is a current point set, an initial line segment will be added to the path to connect the current point to the beginning of the arc.

addArcToPoint(This, X1, Y1, X2, Y2, R)

-spec addArcToPoint(This, X1, Y1, X2, Y2, R) -> ok
                       when
                           This :: wxGraphicsPath(),
                           X1 :: number(),
                           Y1 :: number(),
                           X2 :: number(),
                           Y2 :: number(),
                           R :: number().

Adds an arc (of a circle with radius r) that is tangent to the line connecting current point and (x1, y1) and to the line connecting (x1, y1) and (x2, y2).

If the current point and the starting point of the arc are different, a straight line connecting these points is also appended. If there is no current point before the call to addArcToPoint/6 this function will behave as if preceded by a call to MoveToPoint(0, 0). After this call the current point will be at the ending point of the arc.

addCircle(This, X, Y, R)

-spec addCircle(This, X, Y, R) -> ok
                   when This :: wxGraphicsPath(), X :: number(), Y :: number(), R :: number().

Appends a circle around (x,y) with radius r as a new closed subpath.

After this call the current point will be at (x+r, y).

addCurveToPoint(This, C1, C2, E)

-spec addCurveToPoint(This, C1, C2, E) -> ok
                         when
                             This :: wxGraphicsPath(),
                             C1 :: {X :: float(), Y :: float()},
                             C2 :: {X :: float(), Y :: float()},
                             E :: {X :: float(), Y :: float()}.

Adds a cubic bezier curve from the current point, using two control points and an end point.

If there is no current point before the call to addCurveToPoint/7 this function will behave as if preceded by a call to MoveToPoint(c1).

addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y)

-spec addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y) -> ok
                         when
                             This :: wxGraphicsPath(),
                             Cx1 :: number(),
                             Cy1 :: number(),
                             Cx2 :: number(),
                             Cy2 :: number(),
                             X :: number(),
                             Y :: number().

Adds a cubic bezier curve from the current point, using two control points and an end point.

If there is no current point before the call to addCurveToPoint/7 this function will behave as if preceded by a call to MoveToPoint(cx1, cy1).

addEllipse(This, X, Y, W, H)

-spec addEllipse(This, X, Y, W, H) -> ok
                    when
                        This :: wxGraphicsPath(),
                        X :: number(),
                        Y :: number(),
                        W :: number(),
                        H :: number().

Appends an ellipse fitting into the passed in rectangle as a new closed subpath.

After this call the current point will be at (x+w, y+h/2).

addLineToPoint(This, P)

-spec addLineToPoint(This, P) -> ok when This :: wxGraphicsPath(), P :: {X :: float(), Y :: float()}.

Adds a straight line from the current point to p.

If current point is not yet set before the call to addLineToPoint/3 this function will behave as moveToPoint/3.

addLineToPoint(This, X, Y)

-spec addLineToPoint(This, X, Y) -> ok when This :: wxGraphicsPath(), X :: number(), Y :: number().

Adds a straight line from the current point to (x,y).

If current point is not yet set before the call to addLineToPoint/3 this function will behave as moveToPoint/3.

addPath(This, Path)

-spec addPath(This, Path) -> ok when This :: wxGraphicsPath(), Path :: wxGraphicsPath().

Adds another path onto the current path.

After this call the current point will be at the added path's current point. For Direct2D the path being appended shouldn't contain a started non-empty subpath when this function is called.

addQuadCurveToPoint(This, Cx, Cy, X, Y)

-spec addQuadCurveToPoint(This, Cx, Cy, X, Y) -> ok
                             when
                                 This :: wxGraphicsPath(),
                                 Cx :: number(),
                                 Cy :: number(),
                                 X :: number(),
                                 Y :: number().

Adds a quadratic bezier curve from the current point, using a control point and an end point.

If there is no current point before the call to addQuadCurveToPoint/5 this function will behave as if preceded by a call to MoveToPoint(cx, cy).

addRectangle(This, X, Y, W, H)

-spec addRectangle(This, X, Y, W, H) -> ok
                      when
                          This :: wxGraphicsPath(),
                          X :: number(),
                          Y :: number(),
                          W :: number(),
                          H :: number().

Appends a rectangle as a new closed subpath.

After this call the current point will be at (x, y).

addRoundedRectangle(This, X, Y, W, H, Radius)

-spec addRoundedRectangle(This, X, Y, W, H, Radius) -> ok
                             when
                                 This :: wxGraphicsPath(),
                                 X :: number(),
                                 Y :: number(),
                                 W :: number(),
                                 H :: number(),
                                 Radius :: number().

Appends a rounded rectangle as a new closed subpath.

If radius equals 0 this function will behave as addRectangle/5, otherwise after this call the current point will be at (x+w, y+h/2).

closeSubpath(This)

-spec closeSubpath(This) -> ok when This :: wxGraphicsPath().

Closes the current sub-path.

After this call the current point will be at the joined endpoint of the sub-path.

contains(This, C)

-spec contains(This, C) -> boolean() when This :: wxGraphicsPath(), C :: {X :: float(), Y :: float()}.

Equivalent to contains(This, C, []).

contains/3

-spec contains(This, X, Y) -> boolean() when This :: wxGraphicsPath(), X :: number(), Y :: number();
              (This, C, [Option]) -> boolean()
                  when
                      This :: wxGraphicsPath(),
                      C :: {X :: float(), Y :: float()},
                      Option :: {fillStyle, wx:wx_enum()}.

Return: true if the point is within the path.

contains/4

-spec contains(This, X, Y, [Option]) -> boolean()
                  when
                      This :: wxGraphicsPath(),
                      X :: number(),
                      Y :: number(),
                      Option :: {fillStyle, wx:wx_enum()}.

Return: true if the point is within the path.

getBox(This)

-spec getBox(This) -> {X :: float(), Y :: float(), W :: float(), H :: float()}
                when This :: wxGraphicsPath().

Gets the bounding box enclosing all points (possibly including control points).

getCurrentPoint(This)

-spec getCurrentPoint(This) -> {X :: float(), Y :: float()} when This :: wxGraphicsPath().

Gets the last point of the current path, (0,0) if not yet set.

moveToPoint(This, P)

-spec moveToPoint(This, P) -> ok when This :: wxGraphicsPath(), P :: {X :: float(), Y :: float()}.

Begins a new subpath at p.

moveToPoint(This, X, Y)

-spec moveToPoint(This, X, Y) -> ok when This :: wxGraphicsPath(), X :: number(), Y :: number().

Begins a new subpath at (x,y).

transform(This, Matrix)

-spec transform(This, Matrix) -> ok
                   when This :: wxGraphicsPath(), Matrix :: wxGraphicsMatrix:wxGraphicsMatrix().

Transforms each point of this path by the matrix.

For Direct2D the current path shouldn't contain a started non-empty subpath when this function is called.

wxGraphicsPen

A wxGraphicsPen is a native representation of a pen.

The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via wxGraphicsContext:createPen/2 or wxGraphicsRenderer::CreatePen() (not implemented in wx).

This class is derived, and can use functions, from:

wxGraphicsObject

wxWidgets docs: wxGraphicsPen

Summary

Types

wxGraphicsPen()

Types

wxGraphicsPen()

-type wxGraphicsPen() :: wx:wx_object().

wxGraphicsRenderer

A wxGraphicsRenderer is the instance corresponding to the rendering engine used.

There may be multiple instances on a system, if there are different rendering engines present, but there is always only one instance per engine. This instance is pointed back to by all objects created by it (wxGraphicsContext, wxGraphicsPath etc.) and can be retrieved through their wxGraphicsObject:getRenderer/1 method. Therefore you can create an additional instance of a path etc. by calling wxGraphicsObject:getRenderer/1 and then using the appropriate CreateXXX() function of that renderer.

wxWidgets docs: wxGraphicsRenderer

Summary

Types

wxGraphicsRenderer()

Functions

createBrush(This, Brush)

Creates a native brush from a wxBrush.

createContext(This, WindowDC)

Creates a wxGraphicsContext from a wxWindowDC.

createFont(This, Font)

Equivalent to createFont(This, Font, []).

createFont/3

Creates a native graphics font from a wxFont and a text colour.

createFont/4

Creates a graphics font with the given characteristics.

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops)

Creates a native brush with a linear gradient.

createMatrix(This)

Equivalent to createMatrix(This, []).

createMatrix/2

Creates a native affine transformation matrix from the passed in values.

createPath(This)

Creates a native graphics path which is initially empty.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops)

Creates a native brush with a radial gradient.

getDefaultRenderer()

Returns the default renderer on this platform.

Types

wxGraphicsRenderer()

-type wxGraphicsRenderer() :: wx:wx_object().

Functions

createBrush(This, Brush)

-spec createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush()
                     when This :: wxGraphicsRenderer(), Brush :: wxBrush:wxBrush().

Creates a native brush from a wxBrush.

createContext(This, WindowDC)

-spec createContext(This, WindowDC) -> wxGraphicsContext:wxGraphicsContext()
                       when
                           This :: wxGraphicsRenderer(),
                           WindowDC ::
                               wxWindowDC:wxWindowDC() | wxWindow:wxWindow() | wxMemoryDC:wxMemoryDC().

Creates a wxGraphicsContext from a wxWindowDC.

createFont(This, Font)

-spec createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont()
                    when This :: wxGraphicsRenderer(), Font :: wxFont:wxFont().

Equivalent to createFont(This, Font, []).

createFont/3

-spec createFont(This, SizeInPixels, Facename) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsRenderer(),
                        SizeInPixels :: number(),
                        Facename :: unicode:chardata();
                (This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsRenderer(),
                        Font :: wxFont:wxFont(),
                        Option :: {col, wx:wx_colour()}.

Creates a native graphics font from a wxFont and a text colour.

createFont/4

-spec createFont(This, SizeInPixels, Facename, [Option]) -> wxGraphicsFont:wxGraphicsFont()
                    when
                        This :: wxGraphicsRenderer(),
                        SizeInPixels :: number(),
                        Facename :: unicode:chardata(),
                        Option :: {flags, integer()} | {col, wx:wx_colour()}.

Creates a graphics font with the given characteristics.

If possible, the createFont/4 overload taking wxFont should be used instead. The main advantage of this overload is that it can be used without X server connection under Unix when using Cairo.

Since: 2.9.3

createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops)

-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, Stops) -> wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsRenderer(),
                                       X1 :: number(),
                                       Y1 :: number(),
                                       X2 :: number(),
                                       Y2 :: number(),
                                       Stops :: wxGraphicsGradientStops:wxGraphicsGradientStops().

Creates a native brush with a linear gradient.

Stops support is new since wxWidgets 2.9.1, previously only the start and end colours could be specified.

The ability to apply a transformation matrix to the gradient was added in 3.1.3

createMatrix(This)

-spec createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when This :: wxGraphicsRenderer().

Equivalent to createMatrix(This, []).

createMatrix/2

-spec createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix()
                      when
                          This :: wxGraphicsRenderer(),
                          Option ::
                              {a, number()} |
                              {b, number()} |
                              {c, number()} |
                              {d, number()} |
                              {tx, number()} |
                              {ty, number()}.

Creates a native affine transformation matrix from the passed in values.

The defaults result in an identity matrix.

createPath(This)

-spec createPath(This) -> wxGraphicsPath:wxGraphicsPath() when This :: wxGraphicsRenderer().

Creates a native graphics path which is initially empty.

createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops)

-spec createRadialGradientBrush(This, StartX, StartY, EndX, EndY, Radius, Stops) ->
                                   wxGraphicsBrush:wxGraphicsBrush()
                                   when
                                       This :: wxGraphicsRenderer(),
                                       StartX :: number(),
                                       StartY :: number(),
                                       EndX :: number(),
                                       EndY :: number(),
                                       Radius :: number(),
                                       Stops :: wxGraphicsGradientStops:wxGraphicsGradientStops().

Creates a native brush with a radial gradient.

Stops support is new since wxWidgets 2.9.1, previously only the start and end colours could be specified.

The ability to apply a transformation matrix to the gradient was added in 3.1.3

getDefaultRenderer()

-spec getDefaultRenderer() -> wxGraphicsRenderer().

Returns the default renderer on this platform.

On macOS this is the Core Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDIPlus renderer, and on GTK we currently default to the Cairo renderer.

wxGrid

wxGrid and its related classes are used for displaying and editing tabular data.

They provide a rich set of features for display, editing, and interacting with a variety of data sources. For simple applications, and to help you get started, wxGrid is the only class you need to refer to directly. It will set up default instances of the other classes and manage them for you. For more complex applications you can derive your own classes for custom grid views, grid data tables, cell editors and renderers. The overview_grid has examples of simple and more complex applications, explains the relationship between the various grid classes and has a summary of the keyboard shortcuts and mouse functions provided by wxGrid.

A wxGridTableBase (not implemented in wx) class holds the actual data to be displayed by a wxGrid class. One or more wxGrid classes may act as a view for one table class. The default table class is called wxGridStringTable (not implemented in wx) and holds an array of strings. An instance of such a class is created by createGrid/4.

wxGridCellRenderer is the abstract base class for rendering contents in a cell. The following renderers are predefined:

wxGridCellBoolRenderer

wxGridCellFloatRenderer

wxGridCellNumberRenderer

wxGridCellStringRenderer

wxGridCellDateRenderer (not implemented in wx)

wxGridCellDateTimeRenderer (not implemented in wx)

The look of a cell can be further defined using wxGridCellAttr. An object of this type may be returned by wxGridTableBase::GetAttr() (not implemented in wx).

wxGridCellEditor is the abstract base class for editing the value of a cell. The following editors are predefined:

wxGridCellBoolEditor

wxGridCellChoiceEditor

wxGridCellFloatEditor

wxGridCellNumberEditor

wxGridCellTextEditor

wxGridCellDateEditor (not implemented in wx)

Please see wxGridEvent, wxGridSizeEvent (not implemented in wx), wxGridRangeSelectEvent (not implemented in wx), and wxGridEditorCreatedEvent (not implemented in wx) for the documentation of all event types you can use with wxGrid.

See: Overview grid

This class is derived, and can use functions, from:

wxScrolledWindow

wxPanel

wxWindow

wxEvtHandler

wxWidgets docs: wxGrid

Summary

Types

wxGrid()

Functions

appendCols(This)

Equivalent to appendCols(This, []).

appendCols/2

Appends one or more new columns to the right of the grid.

appendRows(This)

Equivalent to appendRows(This, []).

appendRows/2

Appends one or more new rows to the bottom of the grid.

autoSize(This)

Automatically sets the height and width of all rows and columns to fit their contents.

autoSizeColumn(This, Col)

Equivalent to autoSizeColumn(This, Col, []).

autoSizeColumn/3

Automatically sizes the column to fit its contents.

autoSizeColumns(This)

Equivalent to autoSizeColumns(This, []).

autoSizeColumns/2

Automatically sizes all columns to fit their contents.

autoSizeRow(This, Row)

Equivalent to autoSizeRow(This, Row, []).

autoSizeRow/3

Automatically sizes the row to fit its contents.

autoSizeRows(This)

Equivalent to autoSizeRows(This, []).

autoSizeRows/2

Automatically sizes all rows to fit their contents.

beginBatch(This)

Increments the grid's batch count.

blockToDeviceRect(This, TopLeft, BottomRight)

Convert grid cell coordinates to grid window pixel coordinates.

canDragCell(This)

Return true if the dragging of cells is enabled or false otherwise.

canDragColMove(This)

Returns true if columns can be moved by dragging with the mouse.

canDragColSize(This, Col)

Returns true if the given column can be resized by dragging with the mouse.

canDragGridRowEdges(This)

Return true if row edges inside the grid can be dragged to resize the rows.

canDragGridSize(This)

Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.

canDragRowSize(This, Row)

Returns true if the given row can be resized by dragging with the mouse.

canEnableCellControl(This)

Returns true if the in-place edit control for the current grid cell can be used and false otherwise.

cellToRect(This, Coords)

Return the rectangle corresponding to the grid cell's size and position in logical coordinates.

cellToRect(This, Row, Col)

Return the rectangle corresponding to the grid cell's size and position in logical coordinates.

clearGrid(This)

Clears all data in the underlying grid table and repaints the grid.

clearSelection(This)

Deselects all cells that are currently selected.

createGrid(This, NumRows, NumCols)

Equivalent to createGrid(This, NumRows, NumCols, []).

createGrid/4

Creates a grid with the specified initial number of rows and columns.

deleteCols(This)

Equivalent to deleteCols(This, []).

deleteCols/2

Deletes one or more columns from a grid starting at the specified position.

deleteRows(This)

Equivalent to deleteRows(This, []).

deleteRows/2

Deletes one or more rows from a grid starting at the specified position.

destroy(This)

Destroys the object

disableCellEditControl(This)

Disables in-place editing of grid cells.

disableDragColSize(This)

Disables column sizing by dragging with the mouse.

disableDragGridSize(This)

Disable mouse dragging of grid lines to resize rows and columns.

disableDragRowSize(This)

Disables row sizing by dragging with the mouse.

enableCellEditControl(This)

Equivalent to enableCellEditControl(This, []).

enableCellEditControl/2

Enables or disables in-place editing of grid cell data.

enableDragColSize(This)

Equivalent to enableDragColSize(This, []).

enableDragColSize/2

Enables or disables column sizing by dragging with the mouse.

enableDragGridSize(This)

Equivalent to enableDragGridSize(This, []).

enableDragGridSize/2

Enables or disables row and column resizing by dragging gridlines with the mouse.

enableDragRowSize(This)

Equivalent to enableDragRowSize(This, []).

enableDragRowSize/2

Enables or disables row sizing by dragging with the mouse.

enableEditing(This, Edit)

Makes the grid globally editable or read-only.

enableGridLines(This)

Equivalent to enableGridLines(This, []).

enableGridLines/2

Turns the drawing of grid lines on or off.

endBatch(This)

Decrements the grid's batch count.

fit(This)

Overridden wxWindow method.

forceRefresh(This)

Causes immediate repainting of the grid.

getBatchCount(This)

Returns the number of times that beginBatch/1 has been called without (yet) matching calls to endBatch/1.

getCellAlignment(This, Row, Col)

Sets the arguments to the horizontal and vertical text alignment values for the grid cell at the specified location.

getCellBackgroundColour(This, Row, Col)

Returns the background colour of the cell at the specified location.

getCellEditor(This, Row, Col)

Returns a pointer to the editor for the cell at the specified location.

getCellFont(This, Row, Col)

Returns the font for text in the grid cell at the specified location.

getCellRenderer(This, Row, Col)

Returns a pointer to the renderer for the grid cell at the specified location.

getCellTextColour(This, Row, Col)

Returns the text colour for the grid cell at the specified location.

getCellValue(This, Coords)

Returns the string contained in the cell at the specified location.

getCellValue(This, Row, Col)

Returns the string contained in the cell at the specified location.

getColLabelAlignment(This)

Sets the arguments to the current column label alignment values.

getColLabelSize(This)

Returns the current height of the column labels.

getColLabelValue(This, Col)

Returns the specified column label.

getColMinimalAcceptableWidth(This)

Returns the minimal width to which a column may be resized.

getDefaultCellAlignment(This)

Returns the default cell alignment.

getDefaultCellBackgroundColour(This)

Returns the current default background colour for grid cells.

getDefaultCellFont(This)

Returns the current default font for grid cell text.

getDefaultCellTextColour(This)

Returns the current default colour for grid cell text.

getDefaultColLabelSize(This)

Returns the default height for column labels.

getDefaultColSize(This)

Returns the current default width for grid columns.

getDefaultEditor(This)

Returns a pointer to the current default grid cell editor.

getDefaultEditorForCell(This, C)

Returns the default editor for the specified cell.

getDefaultEditorForCell(This, Row, Col)

Returns the default editor for the specified cell.

getDefaultEditorForType(This, TypeName)

Returns the default editor for the cells containing values of the given type.

getDefaultRenderer(This)

Returns a pointer to the current default grid cell renderer.

getDefaultRendererForCell(This, Row, Col)

Returns the default renderer for the given cell.

getDefaultRendererForType(This, TypeName)

Returns the default renderer for the cell containing values of the given type.

getDefaultRowLabelSize(This)

Returns the default width for the row labels.

getDefaultRowSize(This)

Returns the current default height for grid rows.

getGridColLabelWindow(This)

Return the column labels window.

getGridCornerLabelWindow(This)

Return the window in the top left grid corner.

getGridCursorCol(This)

Returns the current grid cell column position.

getGridCursorRow(This)

Returns the current grid cell row position.

getGridLineColour(This)

Returns the colour used for grid lines.

getGridRowLabelWindow(This)

Return the row labels window.

getGridWindow(This)

Return the main grid window containing the grid cells.

getLabelBackgroundColour(This)

Returns the colour used for the background of row and column labels.

getLabelFont(This)

Returns the font used for row and column labels.

getLabelTextColour(This)

Returns the colour used for row and column label text.

getNumberCols(This)

Returns the total number of grid columns.

getNumberRows(This)

Returns the total number of grid rows.

getOrCreateCellAttr(This, Row, Col)

Returns the attribute for the given cell creating one if necessary.

getRowLabelAlignment(This)

Returns the alignment used for row labels.

getRowLabelSize(This)

Returns the current width of the row labels.

getRowLabelValue(This, Row)

Returns the specified row label.

getRowMinimalAcceptableHeight(This)

Returns the minimal size to which rows can be resized.

getRowSize(This, Row)

Returns the height of the specified row.

getScrollLineX(This)

Returns the number of pixels per horizontal scroll increment.

getScrollLineY(This)

Returns the number of pixels per vertical scroll increment.

getSelectedCells(This)

Returns an array of individually selected cells.

getSelectedCols(This)

Returns an array of selected columns.

getSelectedRows(This)

Returns an array of selected rows.

getSelectionBackground(This)

Returns the colour used for drawing the selection background.

getSelectionBlockBottomRight(This)

Returns an array of the bottom right corners of blocks of selected cells.

getSelectionBlockTopLeft(This)

Returns an array of the top left corners of blocks of selected cells.

getSelectionForeground(This)

Returns the colour used for drawing the selection foreground.

gridLinesEnabled(This)

Returns true if drawing of grid lines is turned on, false otherwise.

hideCellEditControl(This)

Hides the in-place cell edit control.

insertCols(This)

Equivalent to insertCols(This, []).

insertCols/2

Inserts one or more new columns into a grid with the first new column at the specified position.

insertRows(This)

Equivalent to insertRows(This, []).

insertRows/2

Inserts one or more new rows into a grid with the first new row at the specified position.

isCellEditControlEnabled(This)

Returns true if the in-place edit control is currently enabled.

isCurrentCellReadOnly(This)

Returns true if the current cell is read-only.

isEditable(This)

Returns false if the whole grid has been set as read-only or true otherwise.

isInSelection(This, Coords)

Returns true if the given cell is selected.

isInSelection(This, Row, Col)

Returns true if the given cell is selected.

isReadOnly(This, Row, Col)

Returns true if the cell at the specified location can't be edited.

isSelection(This)

Returns true if there are currently any selected cells, rows, columns or blocks.

isVisible(This, Coords)

Equivalent to isVisible(This, Coords, []).

isVisible/3

Returns true if a cell is either entirely or at least partially visible in the grid window.

isVisible/4

Returns true if a cell is either entirely or at least partially visible in the grid window.

makeCellVisible(This, Coords)

Brings the specified cell into the visible grid cell area with minimal scrolling.

makeCellVisible(This, Row, Col)

Brings the specified cell into the visible grid cell area with minimal scrolling.

moveCursorDown(This, ExpandSelection)

Moves the grid cursor down by one row.

moveCursorDownBlock(This, ExpandSelection)

Moves the grid cursor down in the current column such that it skips to the beginning or end of a block of non-empty cells.

moveCursorLeft(This, ExpandSelection)

Moves the grid cursor left by one column.

moveCursorLeftBlock(This, ExpandSelection)

Moves the grid cursor left in the current row such that it skips to the beginning or end of a block of non-empty cells.

moveCursorRight(This, ExpandSelection)

Moves the grid cursor right by one column.

moveCursorRightBlock(This, ExpandSelection)

Moves the grid cursor right in the current row such that it skips to the beginning or end of a block of non-empty cells.

moveCursorUp(This, ExpandSelection)

Moves the grid cursor up by one row.

moveCursorUpBlock(This, ExpandSelection)

Moves the grid cursor up in the current column such that it skips to the beginning or end of a block of non-empty cells.

movePageDown(This)

Moves the grid cursor down by some number of rows so that the previous bottom visible row becomes the top visible row.

movePageUp(This)

Moves the grid cursor up by some number of rows so that the previous top visible row becomes the bottom visible row.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor creating the grid window.

registerDataType(This, TypeName, Renderer, Editor)

Register a new data type.

saveEditControlValue(This)

Sets the value of the current grid cell to the current in-place edit control value.

selectAll(This)

Selects all cells in the grid.

selectBlock(This, TopLeft, BottomRight)

Equivalent to selectBlock(This, TopLeft, BottomRight, []).

selectBlock/4

Selects a rectangular block of cells.

selectBlock(This, TopRow, LeftCol, BottomRow, RightCol)

Equivalent to selectBlock(This, TopRow, LeftCol, BottomRow, RightCol, []).

selectBlock/6

Selects a rectangular block of cells.

selectCol(This, Col)

Equivalent to selectCol(This, Col, []).

selectCol/3

Selects the specified column.

selectRow(This, Row)

Equivalent to selectRow(This, Row, []).

selectRow/3

Selects the specified row.

setCellAlignment(This, Row, Col, Horiz, Vert)

Sets the horizontal and vertical alignment for grid cell text at the specified location.

setCellBackgroundColour(This, Row, Col, Colour)

Set the background colour for the given cell or all cells by default.

setCellEditor(This, Row, Col, Editor)

Sets the editor for the grid cell at the specified location.

setCellFont(This, Row, Col, Font)

Sets the font for text in the grid cell at the specified location.

setCellRenderer(This, Row, Col, Renderer)

Sets the renderer for the grid cell at the specified location.

setCellTextColour(This, Row, Col, Colour)

Sets the text colour for the given cell.

setCellValue(This, Coords, S)

Sets the string value for the cell at the specified location.

setCellValue(This, Row, Col, S)

Sets the string value for the cell at the specified location.

setColAttr(This, Col, Attr)

Sets the cell attributes for all cells in the specified column.

setColFormatBool(This, Col)

Sets the specified column to display boolean values.

setColFormatCustom(This, Col, TypeName)

Sets the specified column to display data in a custom format.

setColFormatFloat(This, Col)

Equivalent to setColFormatFloat(This, Col, []).

setColFormatFloat/3

Sets the specified column to display floating point values with the given width and precision.

setColFormatNumber(This, Col)

Sets the specified column to display integer values.

setColLabelAlignment(This, Horiz, Vert)

Sets the horizontal and vertical alignment of column label text.

setColLabelSize(This, Height)

Sets the height of the column labels.

setColLabelValue(This, Col, Value)

Set the value for the given column label.

setColMinimalAcceptableWidth(This, Width)

Sets the minimal width to which the user can resize columns.

setColMinimalWidth(This, Col, Width)

Sets the minimal width for the specified column col.

setColSize(This, Col, Width)

Sets the width of the specified column.

setDefaultCellAlignment(This, Horiz, Vert)

Sets the default horizontal and vertical alignment for grid cell text.

setDefaultCellBackgroundColour(This, Colour)

Sets the default background colour for grid cells.

setDefaultCellFont(This, Font)

Sets the default font to be used for grid cell text.

setDefaultCellTextColour(This, Colour)

Sets the current default colour for grid cell text.

setDefaultColSize(This, Width)

Equivalent to setDefaultColSize(This, Width, []).

setDefaultColSize/3

Sets the default width for columns in the grid.

setDefaultEditor(This, Editor)

Sets the default editor for grid cells.

setDefaultRenderer(This, Renderer)

Sets the default renderer for grid cells.

setDefaultRowSize(This, Height)

Equivalent to setDefaultRowSize(This, Height, []).

setDefaultRowSize/3

Sets the default height for rows in the grid.

setGridCursor(This, Coords)

Set the grid cursor to the specified cell.

setGridCursor(This, Row, Col)

Set the grid cursor to the specified cell.

setGridLineColour(This, Colour)

Sets the colour used to draw grid lines.

setLabelBackgroundColour(This, Colour)

Sets the background colour for row and column labels.

setLabelFont(This, Font)

Sets the font for row and column labels.

setLabelTextColour(This, Colour)

Sets the colour for row and column label text.

setMargins(This, ExtraWidth, ExtraHeight)

Sets the extra margins used around the grid area.

setReadOnly(This, Row, Col)

Equivalent to setReadOnly(This, Row, Col, []).

setReadOnly/4

Makes the cell at the specified location read-only or editable.

setRowAttr(This, Row, Attr)

Sets the cell attributes for all cells in the specified row.

setRowLabelAlignment(This, Horiz, Vert)

Sets the horizontal and vertical alignment of row label text.

setRowLabelSize(This, Width)

Sets the width of the row labels.

setRowLabelValue(This, Row, Value)

Sets the value for the given row label.

setRowMinimalAcceptableHeight(This, Height)

Sets the minimal row height used by default.

setRowMinimalHeight(This, Row, Height)

Sets the minimal height for the specified row.

setRowSize(This, Row, Height)

Sets the height of the specified row.

setScrollLineX(This, X)

Sets the number of pixels per horizontal scroll increment.

setScrollLineY(This, Y)

Sets the number of pixels per vertical scroll increment.

setSelectionBackground(This, C)

Set the colour to be used for drawing the selection background.

setSelectionForeground(This, C)

Set the colour to be used for drawing the selection foreground.

setSelectionMode(This, Selmode)

Set the selection behaviour of the grid.

showCellEditControl(This)

Displays the active in-place cell edit control for the current cell after it was hidden.

xToCol(This, X)

Equivalent to xToCol(This, X, []).

xToCol/3

Returns the column at the given pixel position depending on the window.

xToEdgeOfCol(This, X)

Returns the column whose right hand edge is close to the given logical x position.

yToEdgeOfRow(This, Y)

Returns the row whose bottom edge is close to the given logical y position.

yToRow(This, Y)

Equivalent to yToRow(This, Y, []).

yToRow/3

Returns the grid row that corresponds to the logical y coordinate.

Types

wxGrid()

-type wxGrid() :: wx:wx_object().

Functions

appendCols(This)

-spec appendCols(This) -> boolean() when This :: wxGrid().

Equivalent to appendCols(This, []).

appendCols/2

-spec appendCols(This, [Option]) -> boolean()
                    when This :: wxGrid(), Option :: {numCols, integer()} | {updateLabels, boolean()}.

Appends one or more new columns to the right of the grid.

The updateLabels argument is not used at present. If you are using a derived grid table class you will need to override wxGridTableBase::AppendCols() (not implemented in wx). See insertCols/2 for further information.

Return: true on success or false if appending columns failed.

appendRows(This)

-spec appendRows(This) -> boolean() when This :: wxGrid().

Equivalent to appendRows(This, []).

appendRows/2

-spec appendRows(This, [Option]) -> boolean()
                    when This :: wxGrid(), Option :: {numRows, integer()} | {updateLabels, boolean()}.

Appends one or more new rows to the bottom of the grid.

The updateLabels argument is not used at present. If you are using a derived grid table class you will need to override wxGridTableBase::AppendRows() (not implemented in wx). See insertRows/2 for further information.

Return: true on success or false if appending rows failed.

autoSize(This)

-spec autoSize(This) -> ok when This :: wxGrid().

Automatically sets the height and width of all rows and columns to fit their contents.

autoSizeColumn(This, Col)

-spec autoSizeColumn(This, Col) -> ok when This :: wxGrid(), Col :: integer().

Equivalent to autoSizeColumn(This, Col, []).

autoSizeColumn/3

-spec autoSizeColumn(This, Col, [Option]) -> ok
                        when This :: wxGrid(), Col :: integer(), Option :: {setAsMin, boolean()}.

Automatically sizes the column to fit its contents.

If setAsMin is true the calculated width will also be set as the minimal width for the column.

autoSizeColumns(This)

-spec autoSizeColumns(This) -> ok when This :: wxGrid().

Equivalent to autoSizeColumns(This, []).

autoSizeColumns/2

-spec autoSizeColumns(This, [Option]) -> ok when This :: wxGrid(), Option :: {setAsMin, boolean()}.

Automatically sizes all columns to fit their contents.

If setAsMin is true the calculated widths will also be set as the minimal widths for the columns.

autoSizeRow(This, Row)

-spec autoSizeRow(This, Row) -> ok when This :: wxGrid(), Row :: integer().

Equivalent to autoSizeRow(This, Row, []).

autoSizeRow/3

-spec autoSizeRow(This, Row, [Option]) -> ok
                     when This :: wxGrid(), Row :: integer(), Option :: {setAsMin, boolean()}.

Automatically sizes the row to fit its contents.

If setAsMin is true the calculated height will also be set as the minimal height for the row.

autoSizeRows(This)

-spec autoSizeRows(This) -> ok when This :: wxGrid().

Equivalent to autoSizeRows(This, []).

autoSizeRows/2

-spec autoSizeRows(This, [Option]) -> ok when This :: wxGrid(), Option :: {setAsMin, boolean()}.

Automatically sizes all rows to fit their contents.

If setAsMin is true the calculated heights will also be set as the minimal heights for the rows.

beginBatch(This)

-spec beginBatch(This) -> ok when This :: wxGrid().

Increments the grid's batch count.

When the count is greater than zero repainting of the grid is suppressed. Each call to BeginBatch must be matched by a later call to endBatch/1. Code that does a lot of grid modification can be enclosed between beginBatch/1 and endBatch/1 calls to avoid screen flicker. The final endBatch/1 call will cause the grid to be repainted.

Notice that you should use wxGridUpdateLocker (not implemented in wx) which ensures that there is always a matching endBatch/1 call for this beginBatch/1 if possible instead of calling this method directly.

blockToDeviceRect(This, TopLeft, BottomRight)

-spec blockToDeviceRect(This, TopLeft, BottomRight) ->
                           {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                           when
                               This :: wxGrid(),
                               TopLeft :: {R :: integer(), C :: integer()},
                               BottomRight :: {R :: integer(), C :: integer()}.

Convert grid cell coordinates to grid window pixel coordinates.

This function returns the rectangle that encloses the block of cells limited by topLeft and bottomRight cell in device coords and clipped to the client size of the grid window.

Since: 3.1.3 Parameter gridWindow has been added.

See: cellToRect/3

canDragCell(This)

-spec canDragCell(This) -> boolean() when This :: wxGrid().

Return true if the dragging of cells is enabled or false otherwise.

canDragColMove(This)

-spec canDragColMove(This) -> boolean() when This :: wxGrid().

Returns true if columns can be moved by dragging with the mouse.

Columns can be moved by dragging on their labels.

canDragColSize(This, Col)

-spec canDragColSize(This, Col) -> boolean() when This :: wxGrid(), Col :: integer().

Returns true if the given column can be resized by dragging with the mouse.

This function returns true if resizing the columns interactively is globally enabled, i.e. if disableDragColSize/1 hadn't been called, and if this column wasn't explicitly marked as non-resizable with DisableColResize() (not implemented in wx).

canDragGridRowEdges(This)

-spec canDragGridRowEdges(This) -> boolean() when This :: wxGrid().

Return true if row edges inside the grid can be dragged to resize the rows.

See:

canDragGridSize/1

canDragRowSize/2

Since: 3.1.4

canDragGridSize(This)

-spec canDragGridSize(This) -> boolean() when This :: wxGrid().

Return true if the dragging of grid lines to resize rows and columns is enabled or false otherwise.

canDragRowSize(This, Row)

-spec canDragRowSize(This, Row) -> boolean() when This :: wxGrid(), Row :: integer().

Returns true if the given row can be resized by dragging with the mouse.

This is the same as canDragColSize/2 but for rows.

canEnableCellControl(This)

-spec canEnableCellControl(This) -> boolean() when This :: wxGrid().

Returns true if the in-place edit control for the current grid cell can be used and false otherwise.

This function always returns false for the read-only cells.

cellToRect(This, Coords)

-spec cellToRect(This, Coords) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                    when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Return the rectangle corresponding to the grid cell's size and position in logical coordinates.

See: blockToDeviceRect/3

cellToRect(This, Row, Col)

-spec cellToRect(This, Row, Col) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                    when This :: wxGrid(), Row :: integer(), Col :: integer().

Return the rectangle corresponding to the grid cell's size and position in logical coordinates.

See: blockToDeviceRect/3

clearGrid(This)

-spec clearGrid(This) -> ok when This :: wxGrid().

Clears all data in the underlying grid table and repaints the grid.

The table is not deleted by this function. If you are using a derived table class then you need to override wxGridTableBase::Clear() (not implemented in wx) for this function to have any effect.

clearSelection(This)

-spec clearSelection(This) -> ok when This :: wxGrid().

Deselects all cells that are currently selected.

createGrid(This, NumRows, NumCols)

-spec createGrid(This, NumRows, NumCols) -> boolean()
                    when This :: wxGrid(), NumRows :: integer(), NumCols :: integer().

Equivalent to createGrid(This, NumRows, NumCols, []).

createGrid/4

-spec createGrid(This, NumRows, NumCols, [Option]) -> boolean()
                    when
                        This :: wxGrid(),
                        NumRows :: integer(),
                        NumCols :: integer(),
                        Option :: {selmode, wx:wx_enum()}.

Creates a grid with the specified initial number of rows and columns.

Call this directly after the grid constructor. When you use this function wxGrid will create and manage a simple table of string values for you. All of the grid data will be stored in memory.

For applications with more complex data types or relationships, or for dealing with very large datasets, you should derive your own grid table class and pass a table object to the grid with SetTable() (not implemented in wx) or AssignTable() (not implemented in wx).

deleteCols(This)

-spec deleteCols(This) -> boolean() when This :: wxGrid().

Equivalent to deleteCols(This, []).

deleteCols/2

-spec deleteCols(This, [Option]) -> boolean()
                    when
                        This :: wxGrid(),
                        Option :: {pos, integer()} | {numCols, integer()} | {updateLabels, boolean()}.

Deletes one or more columns from a grid starting at the specified position.

The updateLabels argument is not used at present. If you are using a derived grid table class you will need to override wxGridTableBase::DeleteCols() (not implemented in wx). See insertCols/2 for further information.

Return: true on success or false if deleting columns failed.

deleteRows(This)

-spec deleteRows(This) -> boolean() when This :: wxGrid().

Equivalent to deleteRows(This, []).

deleteRows/2

-spec deleteRows(This, [Option]) -> boolean()
                    when
                        This :: wxGrid(),
                        Option :: {pos, integer()} | {numRows, integer()} | {updateLabels, boolean()}.

Deletes one or more rows from a grid starting at the specified position.

The updateLabels argument is not used at present. If you are using a derived grid table class you will need to override wxGridTableBase::DeleteRows() (not implemented in wx). See insertRows/2 for further information.

Return: true on success or false if deleting rows failed.

destroy(This)

-spec destroy(This :: wxGrid()) -> ok.

Destroys the object

disableCellEditControl(This)

-spec disableCellEditControl(This) -> ok when This :: wxGrid().

Disables in-place editing of grid cells.

Equivalent to calling EnableCellEditControl(false).

disableDragColSize(This)

-spec disableDragColSize(This) -> ok when This :: wxGrid().

Disables column sizing by dragging with the mouse.

Equivalent to passing false to enableDragColSize/2.

disableDragGridSize(This)

-spec disableDragGridSize(This) -> ok when This :: wxGrid().

Disable mouse dragging of grid lines to resize rows and columns.

Equivalent to passing false to enableDragGridSize/2

disableDragRowSize(This)

-spec disableDragRowSize(This) -> ok when This :: wxGrid().

Disables row sizing by dragging with the mouse.

Equivalent to passing false to enableDragRowSize/2.

enableCellEditControl(This)

-spec enableCellEditControl(This) -> ok when This :: wxGrid().

Equivalent to enableCellEditControl(This, []).

enableCellEditControl/2

-spec enableCellEditControl(This, [Option]) -> ok when This :: wxGrid(), Option :: {enable, boolean()}.

Enables or disables in-place editing of grid cell data.

Enabling in-place editing generates wxEVT_GRID_EDITOR_SHOWN and, if it isn't vetoed by the application, shows the in-place editor which allows the user to change the cell value.

Disabling in-place editing does nothing if the in-place editor isn't currently shown, otherwise the wxEVT_GRID_EDITOR_HIDDEN event is generated but, unlike the "shown" event, it can't be vetoed and the in-place editor is dismissed unconditionally.

Note that it is an error to call this function if the current cell is read-only, use canEnableCellControl/1 to check for this precondition.

enableDragColSize(This)

-spec enableDragColSize(This) -> ok when This :: wxGrid().

Equivalent to enableDragColSize(This, []).

enableDragColSize/2

-spec enableDragColSize(This, [Option]) -> ok when This :: wxGrid(), Option :: {enable, boolean()}.

Enables or disables column sizing by dragging with the mouse.

enableDragGridSize(This)

-spec enableDragGridSize(This) -> ok when This :: wxGrid().

Equivalent to enableDragGridSize(This, []).

enableDragGridSize/2

-spec enableDragGridSize(This, [Option]) -> ok when This :: wxGrid(), Option :: {enable, boolean()}.

Enables or disables row and column resizing by dragging gridlines with the mouse.

enableDragRowSize(This)

-spec enableDragRowSize(This) -> ok when This :: wxGrid().

Equivalent to enableDragRowSize(This, []).

enableDragRowSize/2

-spec enableDragRowSize(This, [Option]) -> ok when This :: wxGrid(), Option :: {enable, boolean()}.

Enables or disables row sizing by dragging with the mouse.

enableEditing(This, Edit)

-spec enableEditing(This, Edit) -> ok when This :: wxGrid(), Edit :: boolean().

Makes the grid globally editable or read-only.

If the edit argument is false this function sets the whole grid as read-only. If the argument is true the grid is set to the default state where cells may be editable. In the default state you can set single grid cells and whole rows and columns to be editable or read-only via wxGridCellAttr:setReadOnly/2. For single cells you can also use the shortcut function setReadOnly/4.

For more information about controlling grid cell attributes see the wxGridCellAttr class and the overview_grid.

enableGridLines(This)

-spec enableGridLines(This) -> ok when This :: wxGrid().

Equivalent to enableGridLines(This, []).

enableGridLines/2

-spec enableGridLines(This, [Option]) -> ok when This :: wxGrid(), Option :: {enable, boolean()}.

Turns the drawing of grid lines on or off.

endBatch(This)

-spec endBatch(This) -> ok when This :: wxGrid().

Decrements the grid's batch count.

When the count is greater than zero repainting of the grid is suppressed. Each previous call to beginBatch/1 must be matched by a later call to endBatch/1. Code that does a lot of grid modification can be enclosed between beginBatch/1 and endBatch/1 calls to avoid screen flicker. The final endBatch/1 will cause the grid to be repainted.

fit(This)

-spec fit(This) -> ok when This :: wxGrid().

Overridden wxWindow method.

forceRefresh(This)

-spec forceRefresh(This) -> ok when This :: wxGrid().

Causes immediate repainting of the grid.

Use this instead of the usual wxWindow:refresh/2.

getBatchCount(This)

-spec getBatchCount(This) -> integer() when This :: wxGrid().

Returns the number of times that beginBatch/1 has been called without (yet) matching calls to endBatch/1.

While the grid's batch count is greater than zero the display will not be updated.

getCellAlignment(This, Row, Col)

-spec getCellAlignment(This, Row, Col) -> {Horiz :: integer(), Vert :: integer()}
                          when This :: wxGrid(), Row :: integer(), Col :: integer().

Sets the arguments to the horizontal and vertical text alignment values for the grid cell at the specified location.

Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT.

Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

getCellBackgroundColour(This, Row, Col)

-spec getCellBackgroundColour(This, Row, Col) -> wx:wx_colour4()
                                 when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the background colour of the cell at the specified location.

getCellEditor(This, Row, Col)

-spec getCellEditor(This, Row, Col) -> wxGridCellEditor:wxGridCellEditor()
                       when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns a pointer to the editor for the cell at the specified location.

See wxGridCellEditor and the overview_grid for more information about cell editors and renderers.

The caller must call DecRef() on the returned pointer.

getCellFont(This, Row, Col)

-spec getCellFont(This, Row, Col) -> wxFont:wxFont()
                     when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the font for text in the grid cell at the specified location.

getCellRenderer(This, Row, Col)

-spec getCellRenderer(This, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()
                         when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns a pointer to the renderer for the grid cell at the specified location.

See wxGridCellRenderer and the overview_grid for more information about cell editors and renderers.

The caller must call DecRef() on the returned pointer.

getCellTextColour(This, Row, Col)

-spec getCellTextColour(This, Row, Col) -> wx:wx_colour4()
                           when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the text colour for the grid cell at the specified location.

getCellValue(This, Coords)

-spec getCellValue(This, Coords) -> unicode:charlist()
                      when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Returns the string contained in the cell at the specified location.

For simple applications where a grid object automatically uses a default grid table of string values you use this function together with setCellValue/4 to access cell values. For more complex applications where you have derived your own grid table class that contains various data types (e.g. numeric, boolean or user-defined custom types) then you only use this function for those cells that contain string values.

See wxGridTableBase::CanGetValueAs() (not implemented in wx) and the overview_grid for more information.

getCellValue(This, Row, Col)

-spec getCellValue(This, Row, Col) -> unicode:charlist()
                      when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the string contained in the cell at the specified location.

For simple applications where a grid object automatically uses a default grid table of string values you use this function together with setCellValue/4 to access cell values. For more complex applications where you have derived your own grid table class that contains various data types (e.g. numeric, boolean or user-defined custom types) then you only use this function for those cells that contain string values.

See wxGridTableBase::CanGetValueAs() (not implemented in wx) and the overview_grid for more information.

getColLabelAlignment(This)

-spec getColLabelAlignment(This) -> {Horiz :: integer(), Vert :: integer()} when This :: wxGrid().

Sets the arguments to the current column label alignment values.

Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT.

Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

getColLabelSize(This)

-spec getColLabelSize(This) -> integer() when This :: wxGrid().

Returns the current height of the column labels.

getColLabelValue(This, Col)

-spec getColLabelValue(This, Col) -> unicode:charlist() when This :: wxGrid(), Col :: integer().

Returns the specified column label.

The default grid table class provides column labels of the form A,B...Z,AA,AB...ZZ,AAA... If you are using a custom grid table you can override wxGridTableBase::GetColLabelValue() (not implemented in wx) to provide your own labels.

getColMinimalAcceptableWidth(This)

-spec getColMinimalAcceptableWidth(This) -> integer() when This :: wxGrid().

Returns the minimal width to which a column may be resized.

Use setColMinimalAcceptableWidth/2 to change this value globally or setColMinimalWidth/3 to do it for individual columns.

See: getRowMinimalAcceptableHeight/1

getDefaultCellAlignment(This)

-spec getDefaultCellAlignment(This) -> {Horiz :: integer(), Vert :: integer()} when This :: wxGrid().

Returns the default cell alignment.

Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT.

Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

See: setDefaultCellAlignment/3

getDefaultCellBackgroundColour(This)

-spec getDefaultCellBackgroundColour(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the current default background colour for grid cells.

getDefaultCellFont(This)

-spec getDefaultCellFont(This) -> wxFont:wxFont() when This :: wxGrid().

Returns the current default font for grid cell text.

getDefaultCellTextColour(This)

-spec getDefaultCellTextColour(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the current default colour for grid cell text.

getDefaultColLabelSize(This)

-spec getDefaultColLabelSize(This) -> integer() when This :: wxGrid().

Returns the default height for column labels.

getDefaultColSize(This)

-spec getDefaultColSize(This) -> integer() when This :: wxGrid().

Returns the current default width for grid columns.

getDefaultEditor(This)

-spec getDefaultEditor(This) -> wxGridCellEditor:wxGridCellEditor() when This :: wxGrid().

Returns a pointer to the current default grid cell editor.

See wxGridCellEditor and the overview_grid for more information about cell editors and renderers.

getDefaultEditorForCell(This, C)

-spec getDefaultEditorForCell(This, C) -> wxGridCellEditor:wxGridCellEditor()
                                 when This :: wxGrid(), C :: {R :: integer(), C :: integer()}.

Returns the default editor for the specified cell.

The base class version returns the editor appropriate for the current cell type but this method may be overridden in the derived classes to use custom editors for some cells by default.

Notice that the same may be achieved in a usually simpler way by associating a custom editor with the given cell or cells.

The caller must call DecRef() on the returned pointer.

getDefaultEditorForCell(This, Row, Col)

-spec getDefaultEditorForCell(This, Row, Col) -> wxGridCellEditor:wxGridCellEditor()
                                 when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the default editor for the specified cell.

The base class version returns the editor appropriate for the current cell type but this method may be overridden in the derived classes to use custom editors for some cells by default.

Notice that the same may be achieved in a usually simpler way by associating a custom editor with the given cell or cells.

The caller must call DecRef() on the returned pointer.

getDefaultEditorForType(This, TypeName)

-spec getDefaultEditorForType(This, TypeName) -> wxGridCellEditor:wxGridCellEditor()
                                 when This :: wxGrid(), TypeName :: unicode:chardata().

Returns the default editor for the cells containing values of the given type.

The base class version returns the editor which was associated with the specified typeName when it was registered registerDataType/4 but this function may be overridden to return something different. This allows overriding an editor used for one of the standard types.

The caller must call DecRef() on the returned pointer.

getDefaultRenderer(This)

-spec getDefaultRenderer(This) -> wxGridCellRenderer:wxGridCellRenderer() when This :: wxGrid().

Returns a pointer to the current default grid cell renderer.

See wxGridCellRenderer and the overview_grid for more information about cell editors and renderers.

The caller must call DecRef() on the returned pointer.

getDefaultRendererForCell(This, Row, Col)

-spec getDefaultRendererForCell(This, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()
                                   when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the default renderer for the given cell.

The base class version returns the renderer appropriate for the current cell type but this method may be overridden in the derived classes to use custom renderers for some cells by default.

The caller must call DecRef() on the returned pointer.

getDefaultRendererForType(This, TypeName)

-spec getDefaultRendererForType(This, TypeName) -> wxGridCellRenderer:wxGridCellRenderer()
                                   when This :: wxGrid(), TypeName :: unicode:chardata().

Returns the default renderer for the cell containing values of the given type.

See: getDefaultEditorForType/2

getDefaultRowLabelSize(This)

-spec getDefaultRowLabelSize(This) -> integer() when This :: wxGrid().

Returns the default width for the row labels.

getDefaultRowSize(This)

-spec getDefaultRowSize(This) -> integer() when This :: wxGrid().

Returns the current default height for grid rows.

getGridColLabelWindow(This)

-spec getGridColLabelWindow(This) -> wxWindow:wxWindow() when This :: wxGrid().

Return the column labels window.

This window is not shown if the columns labels were hidden using HideColLabels() (not implemented in wx).

Depending on whether UseNativeColHeader() (not implemented in wx) was called or not this can be either a wxHeaderCtrl (not implemented in wx) or a plain wxWindow. This function returns a valid window pointer in either case but in the former case you can also use GetGridColHeader() (not implemented in wx) to access it if you need wxHeaderCtrl-specific functionality.

getGridCornerLabelWindow(This)

-spec getGridCornerLabelWindow(This) -> wxWindow:wxWindow() when This :: wxGrid().

Return the window in the top left grid corner.

This window is shown only of both columns and row labels are shown and normally doesn't contain anything. Clicking on it is handled by wxGrid however and can be used to select the entire grid.

getGridCursorCol(This)

-spec getGridCursorCol(This) -> integer() when This :: wxGrid().

Returns the current grid cell column position.

getGridCursorRow(This)

-spec getGridCursorRow(This) -> integer() when This :: wxGrid().

Returns the current grid cell row position.

getGridLineColour(This)

-spec getGridLineColour(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the colour used for grid lines.

getGridRowLabelWindow(This)

-spec getGridRowLabelWindow(This) -> wxWindow:wxWindow() when This :: wxGrid().

Return the row labels window.

This window is not shown if the row labels were hidden using HideRowLabels() (not implemented in wx).

getGridWindow(This)

-spec getGridWindow(This) -> wxWindow:wxWindow() when This :: wxGrid().

Return the main grid window containing the grid cells.

This window is always shown.

getLabelBackgroundColour(This)

-spec getLabelBackgroundColour(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the colour used for the background of row and column labels.

getLabelFont(This)

-spec getLabelFont(This) -> wxFont:wxFont() when This :: wxGrid().

Returns the font used for row and column labels.

getLabelTextColour(This)

-spec getLabelTextColour(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the colour used for row and column label text.

getNumberCols(This)

-spec getNumberCols(This) -> integer() when This :: wxGrid().

Returns the total number of grid columns.

This is the same as the number of columns in the underlying grid table.

getNumberRows(This)

-spec getNumberRows(This) -> integer() when This :: wxGrid().

Returns the total number of grid rows.

This is the same as the number of rows in the underlying grid table.

getOrCreateCellAttr(This, Row, Col)

-spec getOrCreateCellAttr(This, Row, Col) -> wxGridCellAttr:wxGridCellAttr()
                             when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns the attribute for the given cell creating one if necessary.

If the cell already has an attribute, it is returned. Otherwise a new attribute is created, associated with the cell and returned. In any case the caller must call DecRef() on the returned pointer.

Prefer to use GetOrCreateCellAttrPtr() (not implemented in wx) to avoid the need to call DecRef() on the returned pointer.

This function may only be called if CanHaveAttributes() (not implemented in wx) returns true.

getRowLabelAlignment(This)

-spec getRowLabelAlignment(This) -> {Horiz :: integer(), Vert :: integer()} when This :: wxGrid().

Returns the alignment used for row labels.

Horizontal alignment will be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT.

Vertical alignment will be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

getRowLabelSize(This)

-spec getRowLabelSize(This) -> integer() when This :: wxGrid().

Returns the current width of the row labels.

getRowLabelValue(This, Row)

-spec getRowLabelValue(This, Row) -> unicode:charlist() when This :: wxGrid(), Row :: integer().

Returns the specified row label.

The default grid table class provides numeric row labels. If you are using a custom grid table you can override wxGridTableBase::GetRowLabelValue() (not implemented in wx) to provide your own labels.

getRowMinimalAcceptableHeight(This)

-spec getRowMinimalAcceptableHeight(This) -> integer() when This :: wxGrid().

Returns the minimal size to which rows can be resized.

Use setRowMinimalAcceptableHeight/2 to change this value globally or setRowMinimalHeight/3 to do it for individual cells.

See: getColMinimalAcceptableWidth/1

getRowSize(This, Row)

-spec getRowSize(This, Row) -> integer() when This :: wxGrid(), Row :: integer().

Returns the height of the specified row.

getScrollLineX(This)

-spec getScrollLineX(This) -> integer() when This :: wxGrid().

Returns the number of pixels per horizontal scroll increment.

The default is 15.

See:

getScrollLineY/1

setScrollLineX/2

setScrollLineY/2

getScrollLineY(This)

-spec getScrollLineY(This) -> integer() when This :: wxGrid().

Returns the number of pixels per vertical scroll increment.

The default is 15.

See:

getScrollLineX/1

setScrollLineX/2

setScrollLineY/2

getSelectedCells(This)

-spec getSelectedCells(This) -> [{R :: integer(), C :: integer()}] when This :: wxGrid().

Returns an array of individually selected cells.

Notice that this array does not contain all the selected cells in general as it doesn't include the cells selected as part of column, row or block selection. You must use this method, getSelectedCols/1, getSelectedRows/1 and getSelectionBlockTopLeft/1 and getSelectionBlockBottomRight/1 methods to obtain the entire selection in general.

Please notice this behaviour is by design and is needed in order to support grids of arbitrary size (when an entire column is selected in a grid with a million of columns, we don't want to create an array with a million of entries in this function, instead it returns an empty array and getSelectedCols/1 returns an array containing one element).

The function can be slow for the big grids, use GetSelectedBlocks() (not implemented in wx) in the new code.

getSelectedCols(This)

-spec getSelectedCols(This) -> [integer()] when This :: wxGrid().

Returns an array of selected columns.

Please notice that this method alone is not sufficient to find all the selected columns as it contains only the columns which were individually selected but not those being part of the block selection or being selected in virtue of all of their cells being selected individually, please see getSelectedCells/1 for more details.

The function can be slow for the big grids, use GetSelectedBlocks() (not implemented in wx) in the new code.

getSelectedRows(This)

-spec getSelectedRows(This) -> [integer()] when This :: wxGrid().

Returns an array of selected rows.

Please notice that this method alone is not sufficient to find all the selected rows as it contains only the rows which were individually selected but not those being part of the block selection or being selected in virtue of all of their cells being selected individually, please see getSelectedCells/1 for more details.

The function can be slow for the big grids, use GetSelectedBlocks() (not implemented in wx) in the new code.

getSelectionBackground(This)

-spec getSelectionBackground(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the colour used for drawing the selection background.

getSelectionBlockBottomRight(This)

-spec getSelectionBlockBottomRight(This) -> [{R :: integer(), C :: integer()}] when This :: wxGrid().

Returns an array of the bottom right corners of blocks of selected cells.

Please see getSelectedCells/1 for more information about the selection representation in wxGrid.

The function can be slow for the big grids, use GetSelectedBlocks() (not implemented in wx) in the new code.

See: getSelectionBlockTopLeft/1

getSelectionBlockTopLeft(This)

-spec getSelectionBlockTopLeft(This) -> [{R :: integer(), C :: integer()}] when This :: wxGrid().

Returns an array of the top left corners of blocks of selected cells.

Please see getSelectedCells/1 for more information about the selection representation in wxGrid.

The function can be slow for the big grids, use GetSelectedBlocks() (not implemented in wx) in the new code.

See: getSelectionBlockBottomRight/1

getSelectionForeground(This)

-spec getSelectionForeground(This) -> wx:wx_colour4() when This :: wxGrid().

Returns the colour used for drawing the selection foreground.

gridLinesEnabled(This)

-spec gridLinesEnabled(This) -> boolean() when This :: wxGrid().

Returns true if drawing of grid lines is turned on, false otherwise.

hideCellEditControl(This)

-spec hideCellEditControl(This) -> ok when This :: wxGrid().

Hides the in-place cell edit control.

insertCols(This)

-spec insertCols(This) -> boolean() when This :: wxGrid().

Equivalent to insertCols(This, []).

insertCols/2

-spec insertCols(This, [Option]) -> boolean()
                    when
                        This :: wxGrid(),
                        Option :: {pos, integer()} | {numCols, integer()} | {updateLabels, boolean()}.

Inserts one or more new columns into a grid with the first new column at the specified position.

Notice that inserting the columns in the grid requires grid table cooperation: when this method is called, grid object begins by requesting the underlying grid table to insert new columns. If this is successful the table notifies the grid and the grid updates the display. For a default grid (one where you have called createGrid/4) this process is automatic. If you are using a custom grid table (specified with SetTable() (not implemented in wx) or AssignTable() (not implemented in wx)) then you must override wxGridTableBase::InsertCols() (not implemented in wx) in your derived table class.

Return: true if the columns were successfully inserted, false if an error occurred (most likely the table couldn't be updated).

insertRows(This)

-spec insertRows(This) -> boolean() when This :: wxGrid().

Equivalent to insertRows(This, []).

insertRows/2

-spec insertRows(This, [Option]) -> boolean()
                    when
                        This :: wxGrid(),
                        Option :: {pos, integer()} | {numRows, integer()} | {updateLabels, boolean()}.

Inserts one or more new rows into a grid with the first new row at the specified position.

Notice that you must implement wxGridTableBase::InsertRows() (not implemented in wx) if you use a grid with a custom table, please see insertCols/2 for more information.

Return: true if the rows were successfully inserted, false if an error occurred (most likely the table couldn't be updated).

isCellEditControlEnabled(This)

-spec isCellEditControlEnabled(This) -> boolean() when This :: wxGrid().

Returns true if the in-place edit control is currently enabled.

isCurrentCellReadOnly(This)

-spec isCurrentCellReadOnly(This) -> boolean() when This :: wxGrid().

Returns true if the current cell is read-only.

See:

setReadOnly/4

isReadOnly/3

isEditable(This)

-spec isEditable(This) -> boolean() when This :: wxGrid().

Returns false if the whole grid has been set as read-only or true otherwise.

See enableEditing/2 for more information about controlling the editing status of grid cells.

isInSelection(This, Coords)

-spec isInSelection(This, Coords) -> boolean()
                       when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Returns true if the given cell is selected.

isInSelection(This, Row, Col)

-spec isInSelection(This, Row, Col) -> boolean()
                       when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns true if the given cell is selected.

isReadOnly(This, Row, Col)

-spec isReadOnly(This, Row, Col) -> boolean() when This :: wxGrid(), Row :: integer(), Col :: integer().

Returns true if the cell at the specified location can't be edited.

See:

setReadOnly/4

isCurrentCellReadOnly/1

isSelection(This)

-spec isSelection(This) -> boolean() when This :: wxGrid().

Returns true if there are currently any selected cells, rows, columns or blocks.

isVisible(This, Coords)

-spec isVisible(This, Coords) -> boolean()
                   when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Equivalent to isVisible(This, Coords, []).

isVisible/3

-spec isVisible(This, Row, Col) -> boolean() when This :: wxGrid(), Row :: integer(), Col :: integer();
               (This, Coords, [Option]) -> boolean()
                   when
                       This :: wxGrid(),
                       Coords :: {R :: integer(), C :: integer()},
                       Option :: {wholeCellVisible, boolean()}.

Returns true if a cell is either entirely or at least partially visible in the grid window.

By default, the cell must be entirely visible for this function to return true but if wholeCellVisible is false, the function returns true even if the cell is only partially visible.

isVisible/4

-spec isVisible(This, Row, Col, [Option]) -> boolean()
                   when
                       This :: wxGrid(),
                       Row :: integer(),
                       Col :: integer(),
                       Option :: {wholeCellVisible, boolean()}.

Returns true if a cell is either entirely or at least partially visible in the grid window.

By default, the cell must be entirely visible for this function to return true but if wholeCellVisible is false, the function returns true even if the cell is only partially visible.

makeCellVisible(This, Coords)

-spec makeCellVisible(This, Coords) -> ok
                         when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Brings the specified cell into the visible grid cell area with minimal scrolling.

Does nothing if the cell is already visible.

makeCellVisible(This, Row, Col)

-spec makeCellVisible(This, Row, Col) -> ok when This :: wxGrid(), Row :: integer(), Col :: integer().

Brings the specified cell into the visible grid cell area with minimal scrolling.

Does nothing if the cell is already visible.

moveCursorDown(This, ExpandSelection)

-spec moveCursorDown(This, ExpandSelection) -> boolean()
                        when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor down by one row.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorDownBlock(This, ExpandSelection)

-spec moveCursorDownBlock(This, ExpandSelection) -> boolean()
                             when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor down in the current column such that it skips to the beginning or end of a block of non-empty cells.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorLeft(This, ExpandSelection)

-spec moveCursorLeft(This, ExpandSelection) -> boolean()
                        when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor left by one column.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorLeftBlock(This, ExpandSelection)

-spec moveCursorLeftBlock(This, ExpandSelection) -> boolean()
                             when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor left in the current row such that it skips to the beginning or end of a block of non-empty cells.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorRight(This, ExpandSelection)

-spec moveCursorRight(This, ExpandSelection) -> boolean()
                         when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor right by one column.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorRightBlock(This, ExpandSelection)

-spec moveCursorRightBlock(This, ExpandSelection) -> boolean()
                              when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor right in the current row such that it skips to the beginning or end of a block of non-empty cells.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorUp(This, ExpandSelection)

-spec moveCursorUp(This, ExpandSelection) -> boolean()
                      when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor up by one row.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

moveCursorUpBlock(This, ExpandSelection)

-spec moveCursorUpBlock(This, ExpandSelection) -> boolean()
                           when This :: wxGrid(), ExpandSelection :: boolean().

Moves the grid cursor up in the current column such that it skips to the beginning or end of a block of non-empty cells.

If a block of cells was previously selected it will expand if the argument is true or be cleared if the argument is false.

movePageDown(This)

-spec movePageDown(This) -> boolean() when This :: wxGrid().

Moves the grid cursor down by some number of rows so that the previous bottom visible row becomes the top visible row.

movePageUp(This)

-spec movePageUp(This) -> boolean() when This :: wxGrid().

Moves the grid cursor up by some number of rows so that the previous top visible row becomes the bottom visible row.

new()

-spec new() -> wxGrid().

Default constructor.

You must call Create() (not implemented in wx) to really create the grid window and also call createGrid/4 or SetTable() (not implemented in wx) or AssignTable() (not implemented in wx) to initialize its contents.

new(Parent, Id)

-spec new(Parent, Id) -> wxGrid() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxGrid()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor creating the grid window.

You must call either createGrid/4 or SetTable() (not implemented in wx) or AssignTable() (not implemented in wx) to initialize the grid contents before using it.

registerDataType(This, TypeName, Renderer, Editor)

-spec registerDataType(This, TypeName, Renderer, Editor) -> ok
                          when
                              This :: wxGrid(),
                              TypeName :: unicode:chardata(),
                              Renderer :: wxGridCellRenderer:wxGridCellRenderer(),
                              Editor :: wxGridCellEditor:wxGridCellEditor().

Register a new data type.

The data types allow to naturally associate specific renderers and editors to the cells containing values of the given type. For example, the grid automatically registers a data type with the name wxGRID_VALUE_STRING which uses wxGridCellStringRenderer and wxGridCellTextEditor as its renderer and editor respectively - this is the data type used by all the cells of the default wxGridStringTable (not implemented in wx), so this renderer and editor are used by default for all grid cells.

However if a custom table returns wxGRID_VALUE_BOOL from its wxGridTableBase::GetTypeName() (not implemented in wx) method, then wxGridCellBoolRenderer and wxGridCellBoolEditor are used for it because the grid also registers a boolean data type with this name.

And as this mechanism is completely generic, you may register your own data types using your own custom renderers and editors. Just remember that the table must identify a cell as being of the given type for them to be used for this cell.

saveEditControlValue(This)

-spec saveEditControlValue(This) -> ok when This :: wxGrid().

Sets the value of the current grid cell to the current in-place edit control value.

This is called automatically when the grid cursor moves from the current cell to a new cell. It is also a good idea to call this function when closing a grid since any edits to the final cell location will not be saved otherwise.

selectAll(This)

-spec selectAll(This) -> ok when This :: wxGrid().

Selects all cells in the grid.

selectBlock(This, TopLeft, BottomRight)

-spec selectBlock(This, TopLeft, BottomRight) -> ok
                     when
                         This :: wxGrid(),
                         TopLeft :: {R :: integer(), C :: integer()},
                         BottomRight :: {R :: integer(), C :: integer()}.

Equivalent to selectBlock(This, TopLeft, BottomRight, []).

selectBlock/4

-spec selectBlock(This, TopLeft, BottomRight, [Option]) -> ok
                     when
                         This :: wxGrid(),
                         TopLeft :: {R :: integer(), C :: integer()},
                         BottomRight :: {R :: integer(), C :: integer()},
                         Option :: {addToSelected, boolean()}.

Selects a rectangular block of cells.

If addToSelected is false then any existing selection will be deselected; if true the column will be added to the existing selection.

selectBlock(This, TopRow, LeftCol, BottomRow, RightCol)

-spec selectBlock(This, TopRow, LeftCol, BottomRow, RightCol) -> ok
                     when
                         This :: wxGrid(),
                         TopRow :: integer(),
                         LeftCol :: integer(),
                         BottomRow :: integer(),
                         RightCol :: integer().

Equivalent to selectBlock(This, TopRow, LeftCol, BottomRow, RightCol, []).

selectBlock/6

-spec selectBlock(This, TopRow, LeftCol, BottomRow, RightCol, [Option]) -> ok
                     when
                         This :: wxGrid(),
                         TopRow :: integer(),
                         LeftCol :: integer(),
                         BottomRow :: integer(),
                         RightCol :: integer(),
                         Option :: {addToSelected, boolean()}.

Selects a rectangular block of cells.

If addToSelected is false then any existing selection will be deselected; if true the column will be added to the existing selection.

selectCol(This, Col)

-spec selectCol(This, Col) -> ok when This :: wxGrid(), Col :: integer().

Equivalent to selectCol(This, Col, []).

selectCol/3

-spec selectCol(This, Col, [Option]) -> ok
                   when This :: wxGrid(), Col :: integer(), Option :: {addToSelected, boolean()}.

Selects the specified column.

If addToSelected is false then any existing selection will be deselected; if true the column will be added to the existing selection.

This method won't select anything if the current selection mode is wxGridSelectRows.

selectRow(This, Row)

-spec selectRow(This, Row) -> ok when This :: wxGrid(), Row :: integer().

Equivalent to selectRow(This, Row, []).

selectRow/3

-spec selectRow(This, Row, [Option]) -> ok
                   when This :: wxGrid(), Row :: integer(), Option :: {addToSelected, boolean()}.

Selects the specified row.

If addToSelected is false then any existing selection will be deselected; if true the row will be added to the existing selection.

This method won't select anything if the current selection mode is wxGridSelectColumns.

setCellAlignment(This, Row, Col, Horiz, Vert)

-spec setCellAlignment(This, Row, Col, Horiz, Vert) -> ok
                          when
                              This :: wxGrid(),
                              Row :: integer(),
                              Col :: integer(),
                              Horiz :: integer(),
                              Vert :: integer().

Sets the horizontal and vertical alignment for grid cell text at the specified location.

Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT.

Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

setCellBackgroundColour(This, Row, Col, Colour)

-spec setCellBackgroundColour(This, Row, Col, Colour) -> ok
                                 when
                                     This :: wxGrid(),
                                     Row :: integer(),
                                     Col :: integer(),
                                     Colour :: wx:wx_colour().

Set the background colour for the given cell or all cells by default.

setCellEditor(This, Row, Col, Editor)

-spec setCellEditor(This, Row, Col, Editor) -> ok
                       when
                           This :: wxGrid(),
                           Row :: integer(),
                           Col :: integer(),
                           Editor :: wxGridCellEditor:wxGridCellEditor().

Sets the editor for the grid cell at the specified location.

The grid will take ownership of the pointer.

See wxGridCellEditor and the overview_grid for more information about cell editors and renderers.

setCellFont(This, Row, Col, Font)

-spec setCellFont(This, Row, Col, Font) -> ok
                     when This :: wxGrid(), Row :: integer(), Col :: integer(), Font :: wxFont:wxFont().

Sets the font for text in the grid cell at the specified location.

setCellRenderer(This, Row, Col, Renderer)

-spec setCellRenderer(This, Row, Col, Renderer) -> ok
                         when
                             This :: wxGrid(),
                             Row :: integer(),
                             Col :: integer(),
                             Renderer :: wxGridCellRenderer:wxGridCellRenderer().

Sets the renderer for the grid cell at the specified location.

The grid will take ownership of the pointer.

See wxGridCellRenderer and the overview_grid for more information about cell editors and renderers.

setCellTextColour(This, Row, Col, Colour)

-spec setCellTextColour(This, Row, Col, Colour) -> ok
                           when
                               This :: wxGrid(),
                               Row :: integer(),
                               Col :: integer(),
                               Colour :: wx:wx_colour().

Sets the text colour for the given cell.

setCellValue(This, Coords, S)

-spec setCellValue(This, Coords, S) -> ok
                      when
                          This :: wxGrid(),
                          Coords :: {R :: integer(), C :: integer()},
                          S :: unicode:chardata().

Sets the string value for the cell at the specified location.

For simple applications where a grid object automatically uses a default grid table of string values you use this function together with getCellValue/3 to access cell values. For more complex applications where you have derived your own grid table class that contains various data types (e.g. numeric, boolean or user-defined custom types) then you only use this function for those cells that contain string values.

See wxGridTableBase::CanSetValueAs() (not implemented in wx) and the overview_grid for more information.

setCellValue(This, Row, Col, S)

-spec setCellValue(This, Row, Col, S) -> ok
                      when This :: wxGrid(), Row :: integer(), Col :: integer(), S :: unicode:chardata().

Sets the string value for the cell at the specified location.

For simple applications where a grid object automatically uses a default grid table of string values you use this function together with getCellValue/3 to access cell values. For more complex applications where you have derived your own grid table class that contains various data types (e.g. numeric, boolean or user-defined custom types) then you only use this function for those cells that contain string values.

See wxGridTableBase::CanSetValueAs() (not implemented in wx) and the overview_grid for more information.

setColAttr(This, Col, Attr)

-spec setColAttr(This, Col, Attr) -> ok
                    when This :: wxGrid(), Col :: integer(), Attr :: wxGridCellAttr:wxGridCellAttr().

Sets the cell attributes for all cells in the specified column.

For more information about controlling grid cell attributes see the wxGridCellAttr cell attribute class and the overview_grid.

setColFormatBool(This, Col)

-spec setColFormatBool(This, Col) -> ok when This :: wxGrid(), Col :: integer().

Sets the specified column to display boolean values.

See: setColFormatCustom/3

setColFormatCustom(This, Col, TypeName)

-spec setColFormatCustom(This, Col, TypeName) -> ok
                            when This :: wxGrid(), Col :: integer(), TypeName :: unicode:chardata().

Sets the specified column to display data in a custom format.

This method provides an alternative to defining a custom grid table which would return typeName from its GetTypeName() method for the cells in this column: while it doesn't really change the type of the cells in this column, it does associate the renderer and editor used for the cells of the specified type with them.

See the overview_grid for more information on working with custom data types.

setColFormatFloat(This, Col)

-spec setColFormatFloat(This, Col) -> ok when This :: wxGrid(), Col :: integer().

Equivalent to setColFormatFloat(This, Col, []).

setColFormatFloat/3

-spec setColFormatFloat(This, Col, [Option]) -> ok
                           when
                               This :: wxGrid(),
                               Col :: integer(),
                               Option :: {width, integer()} | {precision, integer()}.

Sets the specified column to display floating point values with the given width and precision.

See: setColFormatCustom/3

setColFormatNumber(This, Col)

-spec setColFormatNumber(This, Col) -> ok when This :: wxGrid(), Col :: integer().

Sets the specified column to display integer values.

See: setColFormatCustom/3

setColLabelAlignment(This, Horiz, Vert)

-spec setColLabelAlignment(This, Horiz, Vert) -> ok
                              when This :: wxGrid(), Horiz :: integer(), Vert :: integer().

Sets the horizontal and vertical alignment of column label text.

Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

setColLabelSize(This, Height)

-spec setColLabelSize(This, Height) -> ok when This :: wxGrid(), Height :: integer().

Sets the height of the column labels.

If height equals to wxGRID_AUTOSIZE then height is calculated automatically so that no label is truncated. Note that this could be slow for a large table.

setColLabelValue(This, Col, Value)

-spec setColLabelValue(This, Col, Value) -> ok
                          when This :: wxGrid(), Col :: integer(), Value :: unicode:chardata().

Set the value for the given column label.

If you are using a custom grid table you must override wxGridTableBase::SetColLabelValue() (not implemented in wx) for this to have any effect.

setColMinimalAcceptableWidth(This, Width)

-spec setColMinimalAcceptableWidth(This, Width) -> ok when This :: wxGrid(), Width :: integer().

Sets the minimal width to which the user can resize columns.

See: getColMinimalAcceptableWidth/1

setColMinimalWidth(This, Col, Width)

-spec setColMinimalWidth(This, Col, Width) -> ok
                            when This :: wxGrid(), Col :: integer(), Width :: integer().

Sets the minimal width for the specified column col.

It is usually best to call this method during grid creation as calling it later will not resize the column to the given minimal width even if it is currently narrower than it.

width must be greater than the minimal acceptable column width as returned by getColMinimalAcceptableWidth/1.

setColSize(This, Col, Width)

-spec setColSize(This, Col, Width) -> ok when This :: wxGrid(), Col :: integer(), Width :: integer().

Sets the width of the specified column.

setDefaultCellAlignment(This, Horiz, Vert)

-spec setDefaultCellAlignment(This, Horiz, Vert) -> ok
                                 when This :: wxGrid(), Horiz :: integer(), Vert :: integer().

Sets the default horizontal and vertical alignment for grid cell text.

Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

setDefaultCellBackgroundColour(This, Colour)

-spec setDefaultCellBackgroundColour(This, Colour) -> ok when This :: wxGrid(), Colour :: wx:wx_colour().

Sets the default background colour for grid cells.

setDefaultCellFont(This, Font)

-spec setDefaultCellFont(This, Font) -> ok when This :: wxGrid(), Font :: wxFont:wxFont().

Sets the default font to be used for grid cell text.

setDefaultCellTextColour(This, Colour)

-spec setDefaultCellTextColour(This, Colour) -> ok when This :: wxGrid(), Colour :: wx:wx_colour().

Sets the current default colour for grid cell text.

setDefaultColSize(This, Width)

-spec setDefaultColSize(This, Width) -> ok when This :: wxGrid(), Width :: integer().

Equivalent to setDefaultColSize(This, Width, []).

setDefaultColSize/3

-spec setDefaultColSize(This, Width, [Option]) -> ok
                           when
                               This :: wxGrid(),
                               Width :: integer(),
                               Option :: {resizeExistingCols, boolean()}.

Sets the default width for columns in the grid.

This will only affect columns subsequently added to the grid unless resizeExistingCols is true.

If width is less than getColMinimalAcceptableWidth/1, then the minimal acceptable width is used instead of it.

setDefaultEditor(This, Editor)

-spec setDefaultEditor(This, Editor) -> ok
                          when This :: wxGrid(), Editor :: wxGridCellEditor:wxGridCellEditor().

Sets the default editor for grid cells.

The grid will take ownership of the pointer.

See wxGridCellEditor and the overview_grid for more information about cell editors and renderers.

setDefaultRenderer(This, Renderer)

-spec setDefaultRenderer(This, Renderer) -> ok
                            when This :: wxGrid(), Renderer :: wxGridCellRenderer:wxGridCellRenderer().

Sets the default renderer for grid cells.

The grid will take ownership of the pointer.

See wxGridCellRenderer and the overview_grid for more information about cell editors and renderers.

setDefaultRowSize(This, Height)

-spec setDefaultRowSize(This, Height) -> ok when This :: wxGrid(), Height :: integer().

Equivalent to setDefaultRowSize(This, Height, []).

setDefaultRowSize/3

-spec setDefaultRowSize(This, Height, [Option]) -> ok
                           when
                               This :: wxGrid(),
                               Height :: integer(),
                               Option :: {resizeExistingRows, boolean()}.

Sets the default height for rows in the grid.

This will only affect rows subsequently added to the grid unless resizeExistingRows is true.

If height is less than getRowMinimalAcceptableHeight/1, then the minimal acceptable height is used instead of it.

setGridCursor(This, Coords)

-spec setGridCursor(This, Coords) -> ok
                       when This :: wxGrid(), Coords :: {R :: integer(), C :: integer()}.

Set the grid cursor to the specified cell.

The grid cursor indicates the current cell and can be moved by the user using the arrow keys or the mouse.

Calling this function generates a wxEVT_GRID_SELECT_CELL event and if the event handler vetoes this event, the cursor is not moved.

This function doesn't make the target call visible, use GoToCell() (not implemented in wx) to do this.

setGridCursor(This, Row, Col)

-spec setGridCursor(This, Row, Col) -> ok when This :: wxGrid(), Row :: integer(), Col :: integer().

Set the grid cursor to the specified cell.

The grid cursor indicates the current cell and can be moved by the user using the arrow keys or the mouse.

Calling this function generates a wxEVT_GRID_SELECT_CELL event and if the event handler vetoes this event, the cursor is not moved.

This function doesn't make the target call visible, use GoToCell() (not implemented in wx) to do this.

setGridLineColour(This, Colour)

-spec setGridLineColour(This, Colour) -> ok when This :: wxGrid(), Colour :: wx:wx_colour().

Sets the colour used to draw grid lines.

setLabelBackgroundColour(This, Colour)

-spec setLabelBackgroundColour(This, Colour) -> ok when This :: wxGrid(), Colour :: wx:wx_colour().

Sets the background colour for row and column labels.

setLabelFont(This, Font)

-spec setLabelFont(This, Font) -> ok when This :: wxGrid(), Font :: wxFont:wxFont().

Sets the font for row and column labels.

setLabelTextColour(This, Colour)

-spec setLabelTextColour(This, Colour) -> ok when This :: wxGrid(), Colour :: wx:wx_colour().

Sets the colour for row and column label text.

setMargins(This, ExtraWidth, ExtraHeight)

-spec setMargins(This, ExtraWidth, ExtraHeight) -> ok
                    when This :: wxGrid(), ExtraWidth :: integer(), ExtraHeight :: integer().

Sets the extra margins used around the grid area.

A grid may occupy more space than needed for its data display and this function allows setting how big this extra space is

setReadOnly(This, Row, Col)

-spec setReadOnly(This, Row, Col) -> ok when This :: wxGrid(), Row :: integer(), Col :: integer().

Equivalent to setReadOnly(This, Row, Col, []).

setReadOnly/4

-spec setReadOnly(This, Row, Col, [Option]) -> ok
                     when
                         This :: wxGrid(),
                         Row :: integer(),
                         Col :: integer(),
                         Option :: {isReadOnly, boolean()}.

Makes the cell at the specified location read-only or editable.

See: isReadOnly/3

setRowAttr(This, Row, Attr)

-spec setRowAttr(This, Row, Attr) -> ok
                    when This :: wxGrid(), Row :: integer(), Attr :: wxGridCellAttr:wxGridCellAttr().

Sets the cell attributes for all cells in the specified row.

The grid takes ownership of the attribute pointer.

See the wxGridCellAttr class for more information about controlling cell attributes.

setRowLabelAlignment(This, Horiz, Vert)

-spec setRowLabelAlignment(This, Horiz, Vert) -> ok
                              when This :: wxGrid(), Horiz :: integer(), Vert :: integer().

Sets the horizontal and vertical alignment of row label text.

Horizontal alignment should be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT. Vertical alignment should be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

setRowLabelSize(This, Width)

-spec setRowLabelSize(This, Width) -> ok when This :: wxGrid(), Width :: integer().

Sets the width of the row labels.

If width equals wxGRID_AUTOSIZE then width is calculated automatically so that no label is truncated. Note that this could be slow for a large table.

setRowLabelValue(This, Row, Value)

-spec setRowLabelValue(This, Row, Value) -> ok
                          when This :: wxGrid(), Row :: integer(), Value :: unicode:chardata().

Sets the value for the given row label.

If you are using a derived grid table you must override wxGridTableBase::SetRowLabelValue() (not implemented in wx) for this to have any effect.

setRowMinimalAcceptableHeight(This, Height)

-spec setRowMinimalAcceptableHeight(This, Height) -> ok when This :: wxGrid(), Height :: integer().

Sets the minimal row height used by default.

See setColMinimalAcceptableWidth/2 for more information.

setRowMinimalHeight(This, Row, Height)

-spec setRowMinimalHeight(This, Row, Height) -> ok
                             when This :: wxGrid(), Row :: integer(), Height :: integer().

Sets the minimal height for the specified row.

See setColMinimalWidth/3 for more information.

setRowSize(This, Row, Height)

-spec setRowSize(This, Row, Height) -> ok when This :: wxGrid(), Row :: integer(), Height :: integer().

Sets the height of the specified row.

See setColSize/3 for more information.

setScrollLineX(This, X)

-spec setScrollLineX(This, X) -> ok when This :: wxGrid(), X :: integer().

Sets the number of pixels per horizontal scroll increment.

The default is 15.

See:

getScrollLineX/1

getScrollLineY/1

setScrollLineY/2

setScrollLineY(This, Y)

-spec setScrollLineY(This, Y) -> ok when This :: wxGrid(), Y :: integer().

Sets the number of pixels per vertical scroll increment.

The default is 15.

See:

getScrollLineX/1

getScrollLineY/1

setScrollLineX/2

setSelectionBackground(This, C)

-spec setSelectionBackground(This, C) -> ok when This :: wxGrid(), C :: wx:wx_colour().

Set the colour to be used for drawing the selection background.

setSelectionForeground(This, C)

-spec setSelectionForeground(This, C) -> ok when This :: wxGrid(), C :: wx:wx_colour().

Set the colour to be used for drawing the selection foreground.

setSelectionMode(This, Selmode)

-spec setSelectionMode(This, Selmode) -> ok when This :: wxGrid(), Selmode :: wx:wx_enum().

Set the selection behaviour of the grid.

The existing selection is converted to conform to the new mode if possible and discarded otherwise (e.g. any individual selected cells are deselected if the new mode allows only the selection of the entire rows or columns).

showCellEditControl(This)

-spec showCellEditControl(This) -> ok when This :: wxGrid().

Displays the active in-place cell edit control for the current cell after it was hidden.

This method should only be called after calling hideCellEditControl/1, to start editing the current grid cell use enableCellEditControl/2 instead.

xToCol(This, X)

-spec xToCol(This, X) -> integer() when This :: wxGrid(), X :: integer().

Equivalent to xToCol(This, X, []).

xToCol/3

-spec xToCol(This, X, [Option]) -> integer()
                when This :: wxGrid(), X :: integer(), Option :: {clipToMinMax, boolean()}.

Returns the column at the given pixel position depending on the window.

Return: The column index or wxNOT_FOUND.

xToEdgeOfCol(This, X)

-spec xToEdgeOfCol(This, X) -> integer() when This :: wxGrid(), X :: integer().

Returns the column whose right hand edge is close to the given logical x position.

If no column edge is near to this position wxNOT_FOUND is returned.

yToEdgeOfRow(This, Y)

-spec yToEdgeOfRow(This, Y) -> integer() when This :: wxGrid(), Y :: integer().

Returns the row whose bottom edge is close to the given logical y position.

If no row edge is near to this position wxNOT_FOUND is returned.

yToRow(This, Y)

-spec yToRow(This, Y) -> integer() when This :: wxGrid(), Y :: integer().

Equivalent to yToRow(This, Y, []).

yToRow/3

-spec yToRow(This, Y, [Option]) -> integer()
                when This :: wxGrid(), Y :: integer(), Option :: {clipToMinMax, boolean()}.

Returns the grid row that corresponds to the logical y coordinate.

The parameter gridWindow is new since wxWidgets 3.1.3. If it is specified, i.e. non-NULL, only the cells of this window are considered, i.e. the function returns wxNOT_FOUND if y is out of bounds.

If gridWindow is NULL, the function returns wxNOT_FOUND only if there is no row at all at the y position.

wxGridBagSizer

A wxSizer that can lay out items in a virtual grid like a wxFlexGridSizer but in this case explicit positioning of the items is allowed using wxGBPosition (not implemented in wx), and items can optionally span more than one row and/or column using wxGBSpan (not implemented in wx).

This class is derived, and can use functions, from:

wxFlexGridSizer

wxGridSizer

wxSizer

wxWidgets docs: wxGridBagSizer

Summary

Types

wxGridBagSizer()

Functions

add(This, Item)

add(This, Window, Pos)

Equivalent to add(This, Window, Pos, []).

add/4

Adds the given item to the given position.

add/5

Adds a spacer to the given position.

calcMin(This)

Called when the managed size of the sizer is needed or when layout needs done.

checkForIntersection(This, Item)

Equivalent to checkForIntersection(This, Item, []).

checkForIntersection/3

Look at all items and see if any intersect (or would overlap) the given item.

checkForIntersection/4

destroy(This)

Destroys the object

findItem(This, Window)

Find the sizer item for the given window or subsizer, returns NULL if not found.

findItemAtPoint(This, Pt)

Return the sizer item located at the point given in pt, or NULL if there is no item at that point.

findItemAtPosition(This, Pos)

Return the sizer item for the given grid cell, or NULL if there is no item at that position.

findItemWithData(This, UserData)

Return the sizer item that has a matching user data (it only compares pointer values) or NULL if not found.

getCellSize(This, Row, Col)

Get the size of the specified cell, including hgap and vgap.

getEmptyCellSize(This)

Get the size used for cells in the grid with no item.

getItemPosition/2

getItemSpan/2

new()

Equivalent to new([]).

new(Options)

Constructor, with optional parameters to specify the gap between the rows and columns.

setEmptyCellSize(This, Sz)

Set the size used for cells in the grid with no item.

setItemPosition/3

setItemSpan/3

Types

wxGridBagSizer()

-type wxGridBagSizer() :: wx:wx_object().

Functions

add(This, Item)

-spec add(This, Item) -> wxSizerItem:wxSizerItem()
             when This :: wxGridBagSizer(), Item :: wxGBSizerItem:wxGBSizerItem().

add(This, Window, Pos)

-spec add(This, Window, Pos) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxGridBagSizer(),
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                 Pos :: {R :: integer(), C :: integer()}.

Equivalent to add(This, Window, Pos, []).

add/4

-spec add(This, Width, Height, Pos) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxGridBagSizer(),
                 Width :: integer(),
                 Height :: integer(),
                 Pos :: {R :: integer(), C :: integer()};
         (This, Window, Pos, [Option]) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxGridBagSizer(),
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                 Pos :: {R :: integer(), C :: integer()},
                 Option ::
                     {span, {RS :: integer(), CS :: integer()}} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()}.

Adds the given item to the given position.

Return: A valid pointer if the item was successfully placed at the given position, or NULL if something was already there.

add/5

-spec add(This, Width, Height, Pos, [Option]) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxGridBagSizer(),
                 Width :: integer(),
                 Height :: integer(),
                 Pos :: {R :: integer(), C :: integer()},
                 Option ::
                     {span, {RS :: integer(), CS :: integer()}} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()}.

Adds a spacer to the given position.

width and height specify the dimension of the spacer to be added.

Return: A valid pointer if the spacer was successfully placed at the given position, or NULL if something was already there.

calcMin(This)

-spec calcMin(This) -> {W :: integer(), H :: integer()} when This :: wxGridBagSizer().

Called when the managed size of the sizer is needed or when layout needs done.

checkForIntersection(This, Item)

-spec checkForIntersection(This, Item) -> boolean()
                              when This :: wxGridBagSizer(), Item :: wxGBSizerItem:wxGBSizerItem().

Equivalent to checkForIntersection(This, Item, []).

checkForIntersection/3

-spec checkForIntersection(This, Pos, Span) -> boolean()
                              when
                                  This :: wxGridBagSizer(),
                                  Pos :: {R :: integer(), C :: integer()},
                                  Span :: {RS :: integer(), CS :: integer()};
                          (This, Item, [Option]) -> boolean()
                              when
                                  This :: wxGridBagSizer(),
                                  Item :: wxGBSizerItem:wxGBSizerItem(),
                                  Option :: {excludeItem, wxGBSizerItem:wxGBSizerItem()}.

Look at all items and see if any intersect (or would overlap) the given item.

Returns true if so, false if there would be no overlap. If an excludeItem is given then it will not be checked for intersection, for example it may be the item we are checking the position of.

checkForIntersection/4

-spec checkForIntersection(This, Pos, Span, [Option]) -> boolean()
                              when
                                  This :: wxGridBagSizer(),
                                  Pos :: {R :: integer(), C :: integer()},
                                  Span :: {RS :: integer(), CS :: integer()},
                                  Option :: {excludeItem, wxGBSizerItem:wxGBSizerItem()}.

destroy(This)

-spec destroy(This :: wxGridBagSizer()) -> ok.

Destroys the object

findItem(This, Window)

-spec findItem(This, Window) -> wxGBSizerItem:wxGBSizerItem()
                  when This :: wxGridBagSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer().

Find the sizer item for the given window or subsizer, returns NULL if not found.

(non-recursive)

findItemAtPoint(This, Pt)

-spec findItemAtPoint(This, Pt) -> wxGBSizerItem:wxGBSizerItem()
                         when This :: wxGridBagSizer(), Pt :: {X :: integer(), Y :: integer()}.

Return the sizer item located at the point given in pt, or NULL if there is no item at that point.

The (x,y) coordinates in pt correspond to the client coordinates of the window using the sizer for layout. (non-recursive)

findItemAtPosition(This, Pos)

-spec findItemAtPosition(This, Pos) -> wxGBSizerItem:wxGBSizerItem()
                            when This :: wxGridBagSizer(), Pos :: {R :: integer(), C :: integer()}.

Return the sizer item for the given grid cell, or NULL if there is no item at that position.

(non-recursive)

findItemWithData(This, UserData)

-spec findItemWithData(This, UserData) -> wxGBSizerItem:wxGBSizerItem()
                          when This :: wxGridBagSizer(), UserData :: wx:wx_object().

Return the sizer item that has a matching user data (it only compares pointer values) or NULL if not found.

(non-recursive)

getCellSize(This, Row, Col)

-spec getCellSize(This, Row, Col) -> {W :: integer(), H :: integer()}
                     when This :: wxGridBagSizer(), Row :: integer(), Col :: integer().

Get the size of the specified cell, including hgap and vgap.

Only valid after window layout has been performed.

getEmptyCellSize(This)

-spec getEmptyCellSize(This) -> {W :: integer(), H :: integer()} when This :: wxGridBagSizer().

Get the size used for cells in the grid with no item.

getItemPosition/2

-spec getItemPosition(This, Window) -> {R :: integer(), C :: integer()}
                         when
                             This :: wxGridBagSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
                     (This, Index) -> {R :: integer(), C :: integer()}
                         when This :: wxGridBagSizer(), Index :: integer().

getItemSpan/2

-spec getItemSpan(This, Window) -> {RS :: integer(), CS :: integer()}
                     when This :: wxGridBagSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
                 (This, Index) -> {RS :: integer(), CS :: integer()}
                     when This :: wxGridBagSizer(), Index :: integer().

new()

-spec new() -> wxGridBagSizer().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGridBagSizer() when Option :: {vgap, integer()} | {hgap, integer()}.

Constructor, with optional parameters to specify the gap between the rows and columns.

setEmptyCellSize(This, Sz)

-spec setEmptyCellSize(This, Sz) -> ok
                          when This :: wxGridBagSizer(), Sz :: {W :: integer(), H :: integer()}.

Set the size used for cells in the grid with no item.

setItemPosition/3

-spec setItemPosition(This, Window, Pos) -> boolean()
                         when
                             This :: wxGridBagSizer(),
                             Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                             Pos :: {R :: integer(), C :: integer()};
                     (This, Index, Pos) -> boolean()
                         when
                             This :: wxGridBagSizer(),
                             Index :: integer(),
                             Pos :: {R :: integer(), C :: integer()}.

setItemSpan/3

-spec setItemSpan(This, Window, Span) -> boolean()
                     when
                         This :: wxGridBagSizer(),
                         Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                         Span :: {RS :: integer(), CS :: integer()};
                 (This, Index, Span) -> boolean()
                     when
                         This :: wxGridBagSizer(),
                         Index :: integer(),
                         Span :: {RS :: integer(), CS :: integer()}.

wxGridCellAttr

This class can be used to alter the cells' appearance in the grid by changing their attributes from the defaults.

An object of this class may be returned by wxGridTableBase::GetAttr() (not implemented in wx).

Note that objects of this class are reference-counted and it's recommended to use wxGridCellAttrPtr smart pointer class when working with them to avoid memory leaks.

wxWidgets docs: wxGridCellAttr

Summary

Types

wxGridCellAttr()

Functions

getAlignment(This)

Get the alignment to use for the cell with the given attribute.

getBackgroundColour(This)

Returns the background colour.

getEditor(This, Grid, Row, Col)

Returns the cell editor.

getFont(This)

Returns the font.

getRenderer(This, Grid, Row, Col)

Returns the cell renderer.

getTextColour(This)

Returns the text colour.

hasAlignment(This)

Returns true if this attribute has a valid alignment set.

hasBackgroundColour(This)

Returns true if this attribute has a valid background colour set.

hasEditor(This)

Returns true if this attribute has a valid cell editor set.

hasFont(This)

Returns true if this attribute has a valid font set.

hasRenderer(This)

Returns true if this attribute has a valid cell renderer set.

hasTextColour(This)

Returns true if this attribute has a valid text colour set.

isReadOnly(This)

Returns true if this cell is set as read-only.

setAlignment(This, HAlign, VAlign)

Sets the alignment.

setBackgroundColour(This, ColBack)

Sets the background colour.

setDefAttr(This, DefAttr)

setEditor(This, Editor)

Sets the editor to be used with the cells with this attribute.

setFont(This, Font)

Sets the font.

setReadOnly(This)

Equivalent to setReadOnly(This, []).

setReadOnly/2

Sets the cell as read-only.

setRenderer(This, Renderer)

Sets the renderer to be used for cells with this attribute.

setTextColour(This, ColText)

Sets the text colour.

Types

wxGridCellAttr()

-type wxGridCellAttr() :: wx:wx_object().

Functions

getAlignment(This)

-spec getAlignment(This) -> {HAlign :: integer(), VAlign :: integer()} when This :: wxGridCellAttr().

Get the alignment to use for the cell with the given attribute.

If this attribute doesn't specify any alignment, the default attribute alignment is used (which can be changed using wxGrid:setDefaultCellAlignment/3 but is left and top by default).

Notice that hAlign and vAlign values are always overwritten by this function, use GetNonDefaultAlignment() (not implemented in wx) if this is not desirable.

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().

Returns the background colour.

getEditor(This, Grid, Row, Col)

-spec getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor()
                   when
                       This :: wxGridCellAttr(),
                       Grid :: wxGrid:wxGrid(),
                       Row :: integer(),
                       Col :: integer().

Returns the cell editor.

The caller is responsible for calling DecRef() (not implemented in wx) on the returned pointer, use GetEditorPtr() (not implemented in wx) to do it automatically.

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxGridCellAttr().

Returns the font.

getRenderer(This, Grid, Row, Col)

-spec getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer()
                     when
                         This :: wxGridCellAttr(),
                         Grid :: wxGrid:wxGrid(),
                         Row :: integer(),
                         Col :: integer().

Returns the cell renderer.

The caller is responsible for calling DecRef() (not implemented in wx) on the returned pointer, use GetRendererPtr() (not implemented in wx) to do it automatically.

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxGridCellAttr().

Returns the text colour.

hasAlignment(This)

-spec hasAlignment(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid alignment set.

hasBackgroundColour(This)

-spec hasBackgroundColour(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid background colour set.

hasEditor(This)

-spec hasEditor(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid cell editor set.

hasFont(This)

-spec hasFont(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid font set.

hasRenderer(This)

-spec hasRenderer(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid cell renderer set.

hasTextColour(This)

-spec hasTextColour(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this attribute has a valid text colour set.

isReadOnly(This)

-spec isReadOnly(This) -> boolean() when This :: wxGridCellAttr().

Returns true if this cell is set as read-only.

setAlignment(This, HAlign, VAlign)

-spec setAlignment(This, HAlign, VAlign) -> ok
                      when This :: wxGridCellAttr(), HAlign :: integer(), VAlign :: integer().

Sets the alignment.

hAlign can be one of wxALIGN_LEFT, wxALIGN_CENTRE or wxALIGN_RIGHT and vAlign can be one of wxALIGN_TOP, wxALIGN_CENTRE or wxALIGN_BOTTOM.

setBackgroundColour(This, ColBack)

-spec setBackgroundColour(This, ColBack) -> ok when This :: wxGridCellAttr(), ColBack :: wx:wx_colour().

Sets the background colour.

setDefAttr(This, DefAttr)

-spec setDefAttr(This, DefAttr) -> ok when This :: wxGridCellAttr(), DefAttr :: wxGridCellAttr().

setEditor(This, Editor)

-spec setEditor(This, Editor) -> ok
                   when This :: wxGridCellAttr(), Editor :: wxGridCellEditor:wxGridCellEditor().

Sets the editor to be used with the cells with this attribute.

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxGridCellAttr(), Font :: wxFont:wxFont().

Sets the font.

setReadOnly(This)

-spec setReadOnly(This) -> ok when This :: wxGridCellAttr().

Equivalent to setReadOnly(This, []).

setReadOnly/2

-spec setReadOnly(This, [Option]) -> ok when This :: wxGridCellAttr(), Option :: {isReadOnly, boolean()}.

Sets the cell as read-only.

setRenderer(This, Renderer)

-spec setRenderer(This, Renderer) -> ok
                     when This :: wxGridCellAttr(), Renderer :: wxGridCellRenderer:wxGridCellRenderer().

Sets the renderer to be used for cells with this attribute.

Takes ownership of the pointer.

setTextColour(This, ColText)

-spec setTextColour(This, ColText) -> ok when This :: wxGridCellAttr(), ColText :: wx:wx_colour().

Sets the text colour.

wxGridCellBoolEditor

Grid cell editor for boolean data.

See:

wxGridCellEditor

wxGridCellChoiceEditor

wxGridCellFloatEditor

wxGridCellNumberEditor

wxGridCellTextEditor

This class is derived, and can use functions, from:

wxGridCellEditor

wxWidgets docs: wxGridCellBoolEditor

Summary

Types

wxGridCellBoolEditor()

Functions

destroy(This)

Destroys the object

isTrueValue(Value)

Returns true if the given value is equal to the string representation of the truth value we currently use (see useStringValues/1).

new()

Default constructor.

useStringValues()

Equivalent to useStringValues([]).

useStringValues(Options)

This method allows you to customize the values returned by wxGridCellNumberEditor:getValue/1 for the cell using this editor.

Types

wxGridCellBoolEditor()

-type wxGridCellBoolEditor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellBoolEditor()) -> ok.

Destroys the object

isTrueValue(Value)

-spec isTrueValue(Value) -> boolean() when Value :: unicode:chardata().

Returns true if the given value is equal to the string representation of the truth value we currently use (see useStringValues/1).

new()

-spec new() -> wxGridCellBoolEditor().

Default constructor.

useStringValues()

-spec useStringValues() -> ok.

Equivalent to useStringValues([]).

useStringValues(Options)

-spec useStringValues([Option]) -> ok
                         when
                             Option ::
                                 {valueTrue, unicode:chardata()} | {valueFalse, unicode:chardata()}.

This method allows you to customize the values returned by wxGridCellNumberEditor:getValue/1 for the cell using this editor.

By default, the default values of the arguments are used, i.e. "1" is returned if the cell is checked and an empty string otherwise.

wxGridCellBoolRenderer

This class may be used to format boolean data in a cell.

See:

wxGridCellRenderer

wxGridCellFloatRenderer

wxGridCellNumberRenderer

wxGridCellStringRenderer

This class is derived, and can use functions, from:

wxGridCellRenderer

wxWidgets docs: wxGridCellBoolRenderer

Summary

Types

wxGridCellBoolRenderer()

Functions

destroy(This)

Destroys the object

new()

Types

wxGridCellBoolRenderer()

-type wxGridCellBoolRenderer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellBoolRenderer()) -> ok.

Destroys the object

new()

-spec new() -> wxGridCellBoolRenderer().

wxGridCellChoiceEditor

Grid cell editor for string data providing the user a choice from a list of strings.

See:

wxGridCellEditor

wxGridCellBoolEditor

wxGridCellFloatEditor

wxGridCellNumberEditor

wxGridCellTextEditor

This class is derived, and can use functions, from:

wxGridCellEditor

wxWidgets docs: wxGridCellChoiceEditor

Summary

Types

wxGridCellChoiceEditor()

Functions

destroy(This)

Destroys the object

new(Choices)

Equivalent to new(Choices, []).

new(Choices, Options)

Choice cell renderer ctor.

setParameters(This, Params)

Parameters string format is "item1[,item2[...,itemN]]".

Types

wxGridCellChoiceEditor()

-type wxGridCellChoiceEditor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellChoiceEditor()) -> ok.

Destroys the object

new(Choices)

-spec new(Choices) -> wxGridCellChoiceEditor() when Choices :: [unicode:chardata()].

Equivalent to new(Choices, []).

new(Choices, Options)

-spec new(Choices, [Option]) -> wxGridCellChoiceEditor()
             when Choices :: [unicode:chardata()], Option :: {allowOthers, boolean()}.

Choice cell renderer ctor.

setParameters(This, Params)

-spec setParameters(This, Params) -> ok
                       when This :: wxGridCellChoiceEditor(), Params :: unicode:chardata().

Parameters string format is "item1[,item2[...,itemN]]".

This method can be called before the editor is used for the first time, or later, in which case it replaces the previously specified strings with the new ones.

wxGridCellEditor

This class is responsible for providing and manipulating the in-place edit controls for the grid.

Instances of wxGridCellEditor (actually, instances of derived classes since it is an abstract class) can be associated with the cell attributes for individual cells, rows, columns, or even for the entire grid.

Normally wxGridCellEditor shows some UI control allowing the user to edit the cell, but starting with wxWidgets 3.1.4 it's also possible to define "activatable" cell editors, that change the value of the cell directly when it's activated (typically by pressing Space key or clicking on it), see TryActivate() (not implemented in wx) method. Note that when implementing an editor which is always activatable, i.e. never shows any in-place editor, it is more convenient to derive its class from wxGridCellActivatableEditor (not implemented in wx) than from wxGridCellEditor itself.

See:

wxGridCellBoolEditor

wxGridCellChoiceEditor

wxGridCellFloatEditor

wxGridCellNumberEditor

wxGridCellTextEditor

wxWidgets docs: wxGridCellEditor

Summary

Types

wxGridCellEditor()

Functions

create(This, Parent, Id, EvtHandler)

Creates the actual edit control.

handleReturn(This, Event)

Some types of controls on some platforms may need some help with the Return key.

isCreated(This)

Returns true if the edit control has been created.

reset(This)

Reset the value in the control back to its starting value.

setSize(This, Rect)

Size and position the edit control.

show(This, Show)

Equivalent to show(This, Show, []).

show/3

Show or hide the edit control, use the specified attributes to set colours/fonts for it.

startingClick(This)

If the editor is enabled by clicking on the cell, this method will be called.

startingKey(This, Event)

If the editor is enabled by pressing keys on the grid, this will be called to let the editor do something about that first key if desired.

Types

wxGridCellEditor()

-type wxGridCellEditor() :: wx:wx_object().

Functions

create(This, Parent, Id, EvtHandler)

-spec create(This, Parent, Id, EvtHandler) -> ok
                when
                    This :: wxGridCellEditor(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    EvtHandler :: wxEvtHandler:wxEvtHandler().

Creates the actual edit control.

handleReturn(This, Event)

-spec handleReturn(This, Event) -> ok when This :: wxGridCellEditor(), Event :: wxKeyEvent:wxKeyEvent().

Some types of controls on some platforms may need some help with the Return key.

isCreated(This)

-spec isCreated(This) -> boolean() when This :: wxGridCellEditor().

Returns true if the edit control has been created.

reset(This)

-spec reset(This) -> ok when This :: wxGridCellEditor().

Reset the value in the control back to its starting value.

setSize(This, Rect)

-spec setSize(This, Rect) -> ok
                 when
                     This :: wxGridCellEditor(),
                     Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Size and position the edit control.

show(This, Show)

-spec show(This, Show) -> ok when This :: wxGridCellEditor(), Show :: boolean().

Equivalent to show(This, Show, []).

show/3

-spec show(This, Show, [Option]) -> ok
              when
                  This :: wxGridCellEditor(),
                  Show :: boolean(),
                  Option :: {attr, wxGridCellAttr:wxGridCellAttr()}.

Show or hide the edit control, use the specified attributes to set colours/fonts for it.

startingClick(This)

-spec startingClick(This) -> ok when This :: wxGridCellEditor().

If the editor is enabled by clicking on the cell, this method will be called.

startingKey(This, Event)

-spec startingKey(This, Event) -> ok when This :: wxGridCellEditor(), Event :: wxKeyEvent:wxKeyEvent().

If the editor is enabled by pressing keys on the grid, this will be called to let the editor do something about that first key if desired.

wxGridCellFloatEditor

The editor for floating point numbers data.

See:

wxGridCellEditor

wxGridCellBoolEditor

wxGridCellChoiceEditor

wxGridCellNumberEditor

wxGridCellTextEditor

This class is derived, and can use functions, from:

wxGridCellEditor

wxWidgets docs: wxGridCellFloatEditor

Summary

Types

wxGridCellFloatEditor()

Functions

destroy(This)

Destroys the object

new()

Equivalent to new([]).

new(Options)

Float cell editor ctor.

setParameters(This, Params)

The parameters string format is "width[,precision[,format]]" where format should be chosen between f|e|g|E|G (f is used by default)

Types

wxGridCellFloatEditor()

-type wxGridCellFloatEditor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellFloatEditor()) -> ok.

Destroys the object

new()

-spec new() -> wxGridCellFloatEditor().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGridCellFloatEditor()
             when Option :: {width, integer()} | {precision, integer()} | {format, integer()}.

Float cell editor ctor.

setParameters(This, Params)

-spec setParameters(This, Params) -> ok
                       when This :: wxGridCellFloatEditor(), Params :: unicode:chardata().

The parameters string format is "width[,precision[,format]]" where format should be chosen between f|e|g|E|G (f is used by default)

wxGridCellFloatRenderer

This class may be used to format floating point data in a cell.

See:

wxGridCellRenderer

wxGridCellBoolRenderer

wxGridCellNumberRenderer

wxGridCellStringRenderer

This class is derived, and can use functions, from:

wxGridCellStringRenderer

wxGridCellRenderer

wxWidgets docs: wxGridCellFloatRenderer

Summary

Types

wxGridCellFloatRenderer()

Functions

destroy(This)

Destroys the object

getPrecision(This)

Returns the precision.

getWidth(This)

Returns the width.

new()

Equivalent to new([]).

new(Options)

Float cell renderer ctor.

setParameters(This, Params)

The parameters string format is "width[,precision[,format]]" where format should be chosen between f|e|g|E|G (f is used by default)

setPrecision(This, Precision)

Sets the precision.

setWidth(This, Width)

Sets the width.

Types

wxGridCellFloatRenderer()

-type wxGridCellFloatRenderer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellFloatRenderer()) -> ok.

Destroys the object

getPrecision(This)

-spec getPrecision(This) -> integer() when This :: wxGridCellFloatRenderer().

Returns the precision.

getWidth(This)

-spec getWidth(This) -> integer() when This :: wxGridCellFloatRenderer().

Returns the width.

new()

-spec new() -> wxGridCellFloatRenderer().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGridCellFloatRenderer()
             when Option :: {width, integer()} | {precision, integer()} | {format, integer()}.

Float cell renderer ctor.

setParameters(This, Params)

-spec setParameters(This, Params) -> ok
                       when This :: wxGridCellFloatRenderer(), Params :: unicode:chardata().

The parameters string format is "width[,precision[,format]]" where format should be chosen between f|e|g|E|G (f is used by default)

setPrecision(This, Precision)

-spec setPrecision(This, Precision) -> ok when This :: wxGridCellFloatRenderer(), Precision :: integer().

Sets the precision.

setWidth(This, Width)

-spec setWidth(This, Width) -> ok when This :: wxGridCellFloatRenderer(), Width :: integer().

Sets the width.

wxGridCellNumberEditor

Grid cell editor for numeric integer data.

See:

wxGridCellEditor

wxGridCellBoolEditor

wxGridCellChoiceEditor

wxGridCellFloatEditor

wxGridCellTextEditor

This class is derived, and can use functions, from:

wxGridCellTextEditor

wxGridCellEditor

wxWidgets docs: wxGridCellNumberEditor

Summary

Types

wxGridCellNumberEditor()

Functions

destroy(This)

Destroys the object

getValue(This)

Returns the value currently in the editor control.

new()

Equivalent to new([]).

new(Options)

Allows you to specify the range for acceptable data.

setParameters(This, Params)

Parameters string format is "min,max".

Types

wxGridCellNumberEditor()

-type wxGridCellNumberEditor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellNumberEditor()) -> ok.

Destroys the object

getValue(This)

-spec getValue(This) -> unicode:charlist() when This :: wxGridCellNumberEditor().

Returns the value currently in the editor control.

new()

-spec new() -> wxGridCellNumberEditor().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGridCellNumberEditor() when Option :: {min, integer()} | {max, integer()}.

Allows you to specify the range for acceptable data.

Values equal to -1 for both min and max indicate that no range checking should be done.

setParameters(This, Params)

-spec setParameters(This, Params) -> ok
                       when This :: wxGridCellNumberEditor(), Params :: unicode:chardata().

Parameters string format is "min,max".

wxGridCellNumberRenderer

This class may be used to format integer data in a cell.

See:

wxGridCellRenderer

wxGridCellBoolRenderer

wxGridCellFloatRenderer

wxGridCellStringRenderer

This class is derived, and can use functions, from:

wxGridCellStringRenderer

wxGridCellRenderer

wxWidgets docs: wxGridCellNumberRenderer

Summary

Types

wxGridCellNumberRenderer()

Functions

destroy(This)

Destroys the object

new()

Default constructor.

Types

wxGridCellNumberRenderer()

-type wxGridCellNumberRenderer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellNumberRenderer()) -> ok.

Destroys the object

new()

-spec new() -> wxGridCellNumberRenderer().

Default constructor.

wxGridCellRenderer

This class is responsible for actually drawing the cell in the grid.

You may pass it to the wxGridCellAttr (below) to change the format of one given cell or to wxGrid:setDefaultRenderer/2 to change the view of all cells. This is an abstract class, and you will normally use one of the predefined derived classes or derive your own class from it.

See:

wxGridCellBoolRenderer

wxGridCellFloatRenderer

wxGridCellNumberRenderer

wxGridCellStringRenderer

wxWidgets docs: wxGridCellRenderer

Summary

Types

wxGridCellRenderer()

Functions

draw(This, Grid, Attr, Dc, Rect, Row, Col, IsSelected)

Draw the given cell on the provided DC inside the given rectangle using the style specified by the attribute and the default or selected state corresponding to the isSelected value.

getBestSize(This, Grid, Attr, Dc, Row, Col)

Get the preferred size of the cell for its contents.

Types

wxGridCellRenderer()

-type wxGridCellRenderer() :: wx:wx_object().

Functions

draw(This, Grid, Attr, Dc, Rect, Row, Col, IsSelected)

-spec draw(This, Grid, Attr, Dc, Rect, Row, Col, IsSelected) -> ok
              when
                  This :: wxGridCellRenderer(),
                  Grid :: wxGrid:wxGrid(),
                  Attr :: wxGridCellAttr:wxGridCellAttr(),
                  Dc :: wxDC:wxDC(),
                  Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                  Row :: integer(),
                  Col :: integer(),
                  IsSelected :: boolean().

Draw the given cell on the provided DC inside the given rectangle using the style specified by the attribute and the default or selected state corresponding to the isSelected value.

This pure virtual function has a default implementation which will prepare the DC using the given attribute: it will draw the rectangle with the background colour from attr and set the text colour and font.

getBestSize(This, Grid, Attr, Dc, Row, Col)

-spec getBestSize(This, Grid, Attr, Dc, Row, Col) -> {W :: integer(), H :: integer()}
                     when
                         This :: wxGridCellRenderer(),
                         Grid :: wxGrid:wxGrid(),
                         Attr :: wxGridCellAttr:wxGridCellAttr(),
                         Dc :: wxDC:wxDC(),
                         Row :: integer(),
                         Col :: integer().

Get the preferred size of the cell for its contents.

This method must be overridden in the derived classes to return the minimal fitting size for displaying the content of the given grid cell.

wxGridCellStringRenderer

This class may be used to format string data in a cell; it is the default for string cells.

See:

wxGridCellRenderer

wxGridCellBoolRenderer

wxGridCellFloatRenderer

wxGridCellNumberRenderer

This class is derived, and can use functions, from:

wxGridCellRenderer

wxWidgets docs: wxGridCellStringRenderer

Summary

Types

wxGridCellStringRenderer()

Functions

destroy(This)

Destroys the object

new()

Types

wxGridCellStringRenderer()

-type wxGridCellStringRenderer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellStringRenderer()) -> ok.

Destroys the object

new()

-spec new() -> wxGridCellStringRenderer().

wxGridCellTextEditor

Grid cell editor for string/text data.

See:

wxGridCellEditor

wxGridCellBoolEditor

wxGridCellChoiceEditor

wxGridCellFloatEditor

wxGridCellNumberEditor

This class is derived, and can use functions, from:

wxGridCellEditor

wxWidgets docs: wxGridCellTextEditor

Summary

Types

wxGridCellTextEditor()

Functions

destroy(This)

Destroys the object

new()

Equivalent to new([]).

new(Options)

Text cell editor constructor.

setParameters(This, Params)

The parameters string format is "n" where n is a number representing the maximum width.

Types

wxGridCellTextEditor()

-type wxGridCellTextEditor() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridCellTextEditor()) -> ok.

Destroys the object

new()

-spec new() -> wxGridCellTextEditor().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxGridCellTextEditor() when Option :: {maxChars, integer()}.

Text cell editor constructor.

setParameters(This, Params)

-spec setParameters(This, Params) -> ok
                       when This :: wxGridCellTextEditor(), Params :: unicode:chardata().

The parameters string format is "n" where n is a number representing the maximum width.

wxGridEvent

This event class contains information about various grid events.

Notice that all grid event table macros are available in two versions: EVT_GRID_XXX and EVT_GRID_CMD_XXX. The only difference between the two is that the former doesn't allow to specify the grid window identifier and so takes a single parameter, the event handler, but is not suitable if there is more than one grid control in the window where the event table is used (as it would catch the events from all the grids). The version with CMD takes the id as first argument and the event handler as the second one and so can be used with multiple grids as well. Otherwise there are no difference between the two and only the versions without the id are documented below for brevity.

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxGridEvent

Events

Use wxEvtHandler:connect/3 with wxGridEventType to subscribe to events of this type.

Summary

Types

wxGrid()

wxGridEvent()

wxGridEventType()

Functions

altDown(This)

Returns true if the Alt key was down at the time of the event.

controlDown(This)

Returns true if the Control key was down at the time of the event.

getCol(This)

Column at which the event occurred.

getPosition(This)

Position in pixels at which the event occurred.

getRow(This)

Row at which the event occurred.

metaDown(This)

Returns true if the Meta key was down at the time of the event.

selecting(This)

Returns true if the user is selecting grid cells, or false if deselecting.

shiftDown(This)

Returns true if the Shift key was down at the time of the event.

Types

wxGrid()

-type wxGrid() ::
          #wxGrid{type :: wxGridEvent:wxGridEventType(),
                  row :: integer(),
                  col :: integer(),
                  pos :: {X :: integer(), Y :: integer()},
                  selecting :: boolean(),
                  control :: boolean(),
                  meta :: boolean(),
                  shift :: boolean(),
                  alt :: boolean()}.

wxGridEvent()

-type wxGridEvent() :: wx:wx_object().

wxGridEventType()

-type wxGridEventType() ::
          grid_cell_left_click | grid_cell_right_click | grid_cell_left_dclick |
          grid_cell_right_dclick | grid_label_left_click | grid_label_right_click |
          grid_label_left_dclick | grid_label_right_dclick | grid_cell_changed | grid_select_cell |
          grid_cell_begin_drag | grid_editor_shown | grid_editor_hidden | grid_col_move |
          grid_col_sort | grid_tabbing.

Functions

altDown(This)

-spec altDown(This) -> boolean() when This :: wxGridEvent().

Returns true if the Alt key was down at the time of the event.

controlDown(This)

-spec controlDown(This) -> boolean() when This :: wxGridEvent().

Returns true if the Control key was down at the time of the event.

getCol(This)

-spec getCol(This) -> integer() when This :: wxGridEvent().

Column at which the event occurred.

Notice that for a wxEVT_GRID_SELECT_CELL event this column is the column of the newly selected cell while the previously selected cell can be retrieved using wxGrid:getGridCursorCol/1.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxGridEvent().

Position in pixels at which the event occurred.

getRow(This)

-spec getRow(This) -> integer() when This :: wxGridEvent().

Row at which the event occurred.

Notice that for a wxEVT_GRID_SELECT_CELL event this row is the row of the newly selected cell while the previously selected cell can be retrieved using wxGrid:getGridCursorRow/1.

metaDown(This)

-spec metaDown(This) -> boolean() when This :: wxGridEvent().

Returns true if the Meta key was down at the time of the event.

selecting(This)

-spec selecting(This) -> boolean() when This :: wxGridEvent().

Returns true if the user is selecting grid cells, or false if deselecting.

shiftDown(This)

-spec shiftDown(This) -> boolean() when This :: wxGridEvent().

Returns true if the Shift key was down at the time of the event.

wxGridSizer

A grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields having the same size, i.e.

the width of each field is the width of the widest child, the height of each field is the height of the tallest child.

See:

wxSizer

Overview sizer

This class is derived, and can use functions, from:

wxSizer

wxWidgets docs: wxGridSizer

Summary

Types

wxGridSizer()

Functions

destroy(This)

Destroys the object

getCols(This)

Returns the number of columns that has been specified for the sizer.

getHGap(This)

Returns the horizontal gap (in pixels) between cells in the sizer.

getRows(This)

Returns the number of rows that has been specified for the sizer.

getVGap(This)

Returns the vertical gap (in pixels) between the cells in the sizer.

new(Cols)

Equivalent to new(Cols, []).

new(Cols, Options)

new/3

new(Rows, Cols, Vgap, Hgap)

setCols(This, Cols)

Sets the number of columns in the sizer.

setHGap(This, Gap)

Sets the horizontal gap (in pixels) between cells in the sizer.

setRows(This, Rows)

Sets the number of rows in the sizer.

setVGap(This, Gap)

Sets the vertical gap (in pixels) between the cells in the sizer.

Types

wxGridSizer()

-type wxGridSizer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxGridSizer()) -> ok.

Destroys the object

getCols(This)

-spec getCols(This) -> integer() when This :: wxGridSizer().

Returns the number of columns that has been specified for the sizer.

Returns zero if the sizer is automatically adjusting the number of columns depending on number of its children. To get the effective number of columns or rows being currently used, see GetEffectiveColsCount() (not implemented in wx)

getHGap(This)

-spec getHGap(This) -> integer() when This :: wxGridSizer().

Returns the horizontal gap (in pixels) between cells in the sizer.

getRows(This)

-spec getRows(This) -> integer() when This :: wxGridSizer().

Returns the number of rows that has been specified for the sizer.

Returns zero if the sizer is automatically adjusting the number of rows depending on number of its children. To get the effective number of columns or rows being currently used, see GetEffectiveRowsCount() (not implemented in wx).

getVGap(This)

-spec getVGap(This) -> integer() when This :: wxGridSizer().

Returns the vertical gap (in pixels) between the cells in the sizer.

new(Cols)

-spec new(Cols) -> wxGridSizer() when Cols :: integer().

Equivalent to new(Cols, []).

new(Cols, Options)

-spec new(Cols, [Option]) -> wxGridSizer()
             when Cols :: integer(), Option :: {gap, {W :: integer(), H :: integer()}}.

new/3

-spec new(Cols, Vgap, Hgap) -> wxGridSizer()
             when Cols :: integer(), Vgap :: integer(), Hgap :: integer();
         (Rows, Cols, Gap) -> wxGridSizer()
             when Rows :: integer(), Cols :: integer(), Gap :: {W :: integer(), H :: integer()}.

new(Rows, Cols, Vgap, Hgap)

-spec new(Rows, Cols, Vgap, Hgap) -> wxGridSizer()
             when Rows :: integer(), Cols :: integer(), Vgap :: integer(), Hgap :: integer().

setCols(This, Cols)

-spec setCols(This, Cols) -> ok when This :: wxGridSizer(), Cols :: integer().

Sets the number of columns in the sizer.

setHGap(This, Gap)

-spec setHGap(This, Gap) -> ok when This :: wxGridSizer(), Gap :: integer().

Sets the horizontal gap (in pixels) between cells in the sizer.

setRows(This, Rows)

-spec setRows(This, Rows) -> ok when This :: wxGridSizer(), Rows :: integer().

Sets the number of rows in the sizer.

setVGap(This, Gap)

-spec setVGap(This, Gap) -> ok when This :: wxGridSizer(), Gap :: integer().

Sets the vertical gap (in pixels) between the cells in the sizer.

wxHelpEvent

A help event is sent when the user has requested context-sensitive help.

This can either be caused by the application requesting context-sensitive help mode via wxContextHelp (not implemented in wx), or (on MS Windows) by the system generating a WM_HELP message when the user pressed F1 or clicked on the query button in a dialog caption.

A help event is sent to the window that the user clicked on, and is propagated up the window hierarchy until the event is processed or there are no more event handlers.

The application should call wxEvent:getId/1 to check the identity of the clicked-on window, and then either show some suitable help or call wxEvent:skip/2 if the identifier is unrecognised.

Calling Skip is important because it allows wxWidgets to generate further events for ancestors of the clicked-on window. Otherwise it would be impossible to show help for container windows, since processing would stop after the first window found.

See:

wxDialog

Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxHelpEvent

Events

Use wxEvtHandler:connect/3 with wxHelpEventType to subscribe to events of this type.

Summary

Types

wxHelp()

wxHelpEvent()

wxHelpEventType()

Functions

getOrigin(This)

Returns the origin of the help event which is one of the wxHelpEvent::Origin (not implemented in wx) values.

getPosition(This)

Returns the left-click position of the mouse, in screen coordinates.

setOrigin(This, Origin)

Set the help event origin, only used internally by wxWidgets normally.

setPosition(This, Pt)

Sets the left-click position of the mouse, in screen coordinates.

Types

wxHelp()

-type wxHelp() :: #wxHelp{type :: wxHelpEvent:wxHelpEventType()}.

wxHelpEvent()

-type wxHelpEvent() :: wx:wx_object().

wxHelpEventType()

-type wxHelpEventType() :: help | detailed_help.

Functions

getOrigin(This)

-spec getOrigin(This) -> wx:wx_enum() when This :: wxHelpEvent().

Returns the origin of the help event which is one of the wxHelpEvent::Origin (not implemented in wx) values.

The application may handle events generated using the keyboard or mouse differently, e.g. by using wx_misc:getMousePosition/0 for the mouse events.

See: setOrigin/2

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxHelpEvent().

Returns the left-click position of the mouse, in screen coordinates.

This allows the application to position the help appropriately.

setOrigin(This, Origin)

-spec setOrigin(This, Origin) -> ok when This :: wxHelpEvent(), Origin :: wx:wx_enum().

Set the help event origin, only used internally by wxWidgets normally.

See: getOrigin/1

setPosition(This, Pt)

-spec setPosition(This, Pt) -> ok when This :: wxHelpEvent(), Pt :: {X :: integer(), Y :: integer()}.

Sets the left-click position of the mouse, in screen coordinates.

wxHtmlEasyPrinting

This class provides very simple interface to printing architecture.

It allows you to print HTML documents using only a few commands.

Note: Do not create this class on the stack only. You should create an instance on app startup and use this instance for all printing operations. The reason is that this class stores various settings in it.

wxWidgets docs: wxHtmlEasyPrinting

Summary

Types

wxHtmlEasyPrinting()

Functions

destroy(This)

Destroys the object

getPageSetupData(This)

Returns a pointer to wxPageSetupDialogData instance used by this class.

getPrintData(This)

Returns pointer to wxPrintData instance used by this class.

new()

Equivalent to new([]).

new(Options)

Constructor.

pageSetup(This)

Display page setup dialog and allows the user to modify settings.

previewFile(This, Htmlfile)

Preview HTML file.

previewText(This, Htmltext)

Equivalent to previewText(This, Htmltext, []).

previewText/3

Preview HTML text (not file!).

printFile(This, Htmlfile)

Print HTML file.

printText(This, Htmltext)

Equivalent to printText(This, Htmltext, []).

printText/3

Print HTML text (not file!).

setFonts(This, Normal_face, Fixed_face)

Equivalent to setFonts(This, Normal_face, Fixed_face, []).

setFonts/4

Sets fonts.

setFooter(This, Footer)

Equivalent to setFooter(This, Footer, []).

setFooter/3

Set page footer.

setHeader(This, Header)

Equivalent to setHeader(This, Header, []).

setHeader/3

Set page header.

Types

wxHtmlEasyPrinting()

-type wxHtmlEasyPrinting() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxHtmlEasyPrinting()) -> ok.

Destroys the object

getPageSetupData(This)

-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData()
                          when This :: wxHtmlEasyPrinting().

Returns a pointer to wxPageSetupDialogData instance used by this class.

You can set its parameters (via SetXXXX methods).

getPrintData(This)

-spec getPrintData(This) -> wxPrintData:wxPrintData() when This :: wxHtmlEasyPrinting().

Returns pointer to wxPrintData instance used by this class.

You can set its parameters (via SetXXXX methods).

new()

-spec new() -> wxHtmlEasyPrinting().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxHtmlEasyPrinting()
             when Option :: {name, unicode:chardata()} | {parentWindow, wxWindow:wxWindow()}.

Constructor.

pageSetup(This)

-spec pageSetup(This) -> ok when This :: wxHtmlEasyPrinting().

Display page setup dialog and allows the user to modify settings.

previewFile(This, Htmlfile)

-spec previewFile(This, Htmlfile) -> boolean()
                     when This :: wxHtmlEasyPrinting(), Htmlfile :: unicode:chardata().

Preview HTML file.

Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.

previewText(This, Htmltext)

-spec previewText(This, Htmltext) -> boolean()
                     when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

Equivalent to previewText(This, Htmltext, []).

previewText/3

-spec previewText(This, Htmltext, [Option]) -> boolean()
                     when
                         This :: wxHtmlEasyPrinting(),
                         Htmltext :: unicode:chardata(),
                         Option :: {basepath, unicode:chardata()}.

Preview HTML text (not file!).

Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.

printFile(This, Htmlfile)

-spec printFile(This, Htmlfile) -> boolean()
                   when This :: wxHtmlEasyPrinting(), Htmlfile :: unicode:chardata().

Print HTML file.

Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.

printText(This, Htmltext)

-spec printText(This, Htmltext) -> boolean()
                   when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

Equivalent to printText(This, Htmltext, []).

printText/3

-spec printText(This, Htmltext, [Option]) -> boolean()
                   when
                       This :: wxHtmlEasyPrinting(),
                       Htmltext :: unicode:chardata(),
                       Option :: {basepath, unicode:chardata()}.

Print HTML text (not file!).

Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.

setFonts(This, Normal_face, Fixed_face)

-spec setFonts(This, Normal_face, Fixed_face) -> ok
                  when
                      This :: wxHtmlEasyPrinting(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata().

Equivalent to setFonts(This, Normal_face, Fixed_face, []).

setFonts/4

-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok
                  when
                      This :: wxHtmlEasyPrinting(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata(),
                      Option :: {sizes, [integer()]}.

Sets fonts.

See wxHtmlDCRenderer::SetFonts (not implemented in wx) for detailed description.

setFooter(This, Footer)

-spec setFooter(This, Footer) -> ok when This :: wxHtmlEasyPrinting(), Footer :: unicode:chardata().

Equivalent to setFooter(This, Footer, []).

setFooter/3

-spec setFooter(This, Footer, [Option]) -> ok
                   when
                       This :: wxHtmlEasyPrinting(),
                       Footer :: unicode:chardata(),
                       Option :: {pg, integer()}.

Set page footer.

The following macros can be used inside it: @DATE@ is replaced by the current date in default format @PAGENUM@ is replaced by page number @PAGESCNT@ is replaced by total number of pages @TIME@ is replaced by the current time in default format @TITLE@ is replaced with the title of the document

setHeader(This, Header)

-spec setHeader(This, Header) -> ok when This :: wxHtmlEasyPrinting(), Header :: unicode:chardata().

Equivalent to setHeader(This, Header, []).

setHeader/3

-spec setHeader(This, Header, [Option]) -> ok
                   when
                       This :: wxHtmlEasyPrinting(),
                       Header :: unicode:chardata(),
                       Option :: {pg, integer()}.

Set page header.

The following macros can be used inside it:

@DATE@ is replaced by the current date in default format

@PAGENUM@ is replaced by page number

@PAGESCNT@ is replaced by total number of pages

@TIME@ is replaced by the current time in default format

@TITLE@ is replaced with the title of the document

wxHtmlLinkEvent

This event class is used for the events generated by wxHtmlWindow.

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxHtmlLinkEvent

Events

Use wxEvtHandler:connect/3 with wxHtmlLinkEventType to subscribe to events of this type.

Summary

Types

wxHtmlLink()

wxHtmlLinkEvent()

wxHtmlLinkEventType()

Functions

getLinkInfo(This)

Returns the wx_wxHtmlLinkInfo() which contains info about the cell clicked and the hyperlink it contains.

Types

wxHtmlLink()

-type wxHtmlLink() ::
          #wxHtmlLink{type :: wxHtmlLinkEvent:wxHtmlLinkEventType(), linkInfo :: wx:wx_wxHtmlLinkInfo()}.

wxHtmlLinkEvent()

-type wxHtmlLinkEvent() :: wx:wx_object().

wxHtmlLinkEventType()

-type wxHtmlLinkEventType() :: command_html_link_clicked | html_cell_clicked | html_cell_hover.

Functions

getLinkInfo(This)

-spec getLinkInfo(This) -> wx:wx_wxHtmlLinkInfo() when This :: wxHtmlLinkEvent().

Returns the wx_wxHtmlLinkInfo() which contains info about the cell clicked and the hyperlink it contains.

wxHtmlWindow

wxHtmlWindow is probably the only class you will directly use unless you want to do something special (like adding new tag handlers or MIME filters).

The purpose of this class is to display rich content pages (either local file or downloaded via HTTP protocol) in a window based on a subset of the HTML standard. The width of the window is constant, given in the constructor and virtual height is changed dynamically depending on page size. Once the window is created you can set its content by calling setPage/2 with raw HTML, loadPage/2 with a wxFileSystem (not implemented in wx) location or loadFile/2 with a filename.

Note: If you want complete HTML/CSS support as well as a Javascript engine, consider using wxWebView instead.

wxHtmlWindow uses the wxImage class for displaying images, so you need to initialize the handlers for any image formats you use before loading a page. See ?wxInitAllImageHandlers and wxImage::AddHandler (not implemented in wx).

Styles

This class supports the following styles:

wxHW_SCROLLBAR_NEVER: Never display scrollbars, not even when the page is larger than the window.

wxHW_SCROLLBAR_AUTO: Display scrollbars only if page's size exceeds window's size.

wxHW_NO_SELECTION: Don't allow the user to select text.

See: wxHtmlLinkEvent

This class is derived, and can use functions, from:

wxScrolledWindow

wxPanel

wxWindow

wxEvtHandler

wxWidgets docs: wxHtmlWindow

Events

Event types emitted from this class:

html_cell_clicked

html_cell_hover

command_html_link_clicked

Summary

Types

wxHtmlWindow()

Functions

appendToPage(This, Source)

Appends HTML fragment to currently displayed text and refreshes the window.

destroy(This)

Destroys the object

getOpenedAnchor(This)

Returns anchor within currently opened page (see getOpenedPage/1).

getOpenedPage(This)

Returns full location of the opened page.

getOpenedPageTitle(This)

Returns title of the opened page or wxEmptyString if the current page does not contain <TITLE> tag.

getRelatedFrame(This)

Returns the related frame.

historyBack(This)

Moves back to the previous page.

historyCanBack(This)

Returns true if it is possible to go back in the history i.e.

historyCanForward(This)

Returns true if it is possible to go forward in the history i.e.

historyClear(This)

Clears history.

historyForward(This)

Moves to next page in history.

loadFile(This, Filename)

Loads an HTML page from a file and displays it.

loadPage(This, Location)

Unlike setPage/2 this function first loads the HTML page from location and then displays it.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

selectAll(This)

Selects all text in the window.

selectionToText(This)

Returns the current selection as plain text.

selectLine(This, Pos)

Selects the line of text that pos points at.

selectWord(This, Pos)

Selects the word at position pos.

setBorders(This, B)

This function sets the space between border of window and HTML contents.

setFonts(This, Normal_face, Fixed_face)

Equivalent to setFonts(This, Normal_face, Fixed_face, []).

setFonts/4

This function sets font sizes and faces.

setPage(This, Source)

Sets the source of a page and displays it, for example

setRelatedFrame(This, Frame, Format)

Sets the frame in which page title will be displayed.

setRelatedStatusBar/2

After calling setRelatedFrame/3, this sets statusbar slot where messages will be displayed.

setRelatedStatusBar/3

Sets the associated statusbar where messages will be displayed.

toText(This)

Returns content of currently displayed page as plain text.

Types

wxHtmlWindow()

-type wxHtmlWindow() :: wx:wx_object().

Functions

appendToPage(This, Source)

-spec appendToPage(This, Source) -> boolean() when This :: wxHtmlWindow(), Source :: unicode:chardata().

Appends HTML fragment to currently displayed text and refreshes the window.

Return: false if an error occurred, true otherwise.

destroy(This)

-spec destroy(This :: wxHtmlWindow()) -> ok.

Destroys the object

getOpenedAnchor(This)

-spec getOpenedAnchor(This) -> unicode:charlist() when This :: wxHtmlWindow().

Returns anchor within currently opened page (see getOpenedPage/1).

If no page is opened or if the displayed page wasn't produced by call to loadPage/2, empty string is returned.

getOpenedPage(This)

-spec getOpenedPage(This) -> unicode:charlist() when This :: wxHtmlWindow().

Returns full location of the opened page.

If no page is opened or if the displayed page wasn't produced by call to loadPage/2, empty string is returned.

getOpenedPageTitle(This)

-spec getOpenedPageTitle(This) -> unicode:charlist() when This :: wxHtmlWindow().

Returns title of the opened page or wxEmptyString if the current page does not contain <TITLE> tag.

getRelatedFrame(This)

-spec getRelatedFrame(This) -> wxFrame:wxFrame() when This :: wxHtmlWindow().

Returns the related frame.

historyBack(This)

-spec historyBack(This) -> boolean() when This :: wxHtmlWindow().

Moves back to the previous page.

Only pages displayed using loadPage/2 are stored in history list.

historyCanBack(This)

-spec historyCanBack(This) -> boolean() when This :: wxHtmlWindow().

Returns true if it is possible to go back in the history i.e.

historyBack/1 won't fail.

historyCanForward(This)

-spec historyCanForward(This) -> boolean() when This :: wxHtmlWindow().

Returns true if it is possible to go forward in the history i.e.

historyForward/1 won't fail.

historyClear(This)

-spec historyClear(This) -> ok when This :: wxHtmlWindow().

Clears history.

historyForward(This)

-spec historyForward(This) -> boolean() when This :: wxHtmlWindow().

Moves to next page in history.

Only pages displayed using loadPage/2 are stored in history list.

loadFile(This, Filename)

-spec loadFile(This, Filename) -> boolean() when This :: wxHtmlWindow(), Filename :: unicode:chardata().

Loads an HTML page from a file and displays it.

Return: false if an error occurred, true otherwise

See: loadPage/2

loadPage(This, Location)

-spec loadPage(This, Location) -> boolean() when This :: wxHtmlWindow(), Location :: unicode:chardata().

Unlike setPage/2 this function first loads the HTML page from location and then displays it.

Return: false if an error occurred, true otherwise

See: loadFile/2

new()

-spec new() -> wxHtmlWindow().

Default ctor.

new(Parent)

-spec new(Parent) -> wxHtmlWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxHtmlWindow()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

The parameters are the same as wxScrolled::wxScrolled() (not implemented in wx) constructor.

selectAll(This)

-spec selectAll(This) -> ok when This :: wxHtmlWindow().

Selects all text in the window.

See:

selectLine/2

selectWord/2

selectionToText(This)

-spec selectionToText(This) -> unicode:charlist() when This :: wxHtmlWindow().

Returns the current selection as plain text.

Returns an empty string if no text is currently selected.

selectLine(This, Pos)

-spec selectLine(This, Pos) -> ok when This :: wxHtmlWindow(), Pos :: {X :: integer(), Y :: integer()}.

Selects the line of text that pos points at.

Note that pos is relative to the top of displayed page, not to window's origin, use wxScrolledWindow:calcUnscrolledPosition/3 to convert physical coordinate.

See:

selectAll/1

selectWord/2

selectWord(This, Pos)

-spec selectWord(This, Pos) -> ok when This :: wxHtmlWindow(), Pos :: {X :: integer(), Y :: integer()}.

Selects the word at position pos.

Note that pos is relative to the top of displayed page, not to window's origin, use wxScrolledWindow:calcUnscrolledPosition/3 to convert physical coordinate.

See:

selectAll/1

selectLine/2

setBorders(This, B)

-spec setBorders(This, B) -> ok when This :: wxHtmlWindow(), B :: integer().

This function sets the space between border of window and HTML contents.

See image:

setFonts(This, Normal_face, Fixed_face)

-spec setFonts(This, Normal_face, Fixed_face) -> ok
                  when
                      This :: wxHtmlWindow(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata().

Equivalent to setFonts(This, Normal_face, Fixed_face, []).

setFonts/4

-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok
                  when
                      This :: wxHtmlWindow(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata(),
                      Option :: {sizes, [integer()]}.

This function sets font sizes and faces.

See wxHtmlDCRenderer::SetFonts (not implemented in wx) for detailed description.

setPage(This, Source)

-spec setPage(This, Source) -> boolean() when This :: wxHtmlWindow(), Source :: unicode:chardata().

Sets the source of a page and displays it, for example:

If you want to load a document from some location use loadPage/2 instead.

Return: false if an error occurred, true otherwise.

setRelatedFrame(This, Frame, Format)

-spec setRelatedFrame(This, Frame, Format) -> ok
                         when
                             This :: wxHtmlWindow(),
                             Frame :: wxFrame:wxFrame(),
                             Format :: unicode:chardata().

Sets the frame in which page title will be displayed.

format is the format of the frame title, e.g. "HtmlHelp : %s". It must contain exactly one s. This s is substituted with HTML page title.

setRelatedStatusBar/2

-spec setRelatedStatusBar(This, Statusbar) -> ok
                             when This :: wxHtmlWindow(), Statusbar :: wxStatusBar:wxStatusBar();
                         (This, Index) -> ok when This :: wxHtmlWindow(), Index :: integer().

After calling setRelatedFrame/3, this sets statusbar slot where messages will be displayed.

(Default is -1 = no messages.)

setRelatedStatusBar/3

-spec setRelatedStatusBar(This, Statusbar, [Option]) -> ok
                             when
                                 This :: wxHtmlWindow(),
                                 Statusbar :: wxStatusBar:wxStatusBar(),
                                 Option :: {index, integer()}.

Sets the associated statusbar where messages will be displayed.

Call this instead of setRelatedFrame/3 if you want statusbar updates only, no changing of the frame title.

Since: 2.9.0

toText(This)

-spec toText(This) -> unicode:charlist() when This :: wxHtmlWindow().

Returns content of currently displayed page as plain text.

wxIcon

An icon is a small rectangular bitmap usually used for denoting a minimized application.

It differs from a wxBitmap in always having a mask associated with it for transparent drawing. On some platforms, icons and bitmaps are implemented identically, since there is no real distinction between a wxBitmap with a mask and an icon; and there is no specific icon format on some platforms (X-based applications usually standardize on XPMs for small bitmaps and icons). However, some platforms (such as Windows) make the distinction, so a separate class is provided.

Remark: It is usually desirable to associate a pertinent icon with a frame. Icons can also be used for other purposes, for example with wxTreeCtrl and wxListCtrl. Icons have different formats on different platforms therefore separate icons will usually be created for the different environments. Platform-specific methods for creating a wxIcon structure are catered for, and this is an occasion where conditional compilation will probably be required. Note that a new icon must be created for every time the icon is to be used for a new window. In Windows, the icon will not be reloaded if it has already been used. An icon allocated to a frame will be deleted when the frame is deleted. For more information please see overview_bitmap.

Predefined objects (include wx.hrl): ?wxNullIcon

See:

Overview bitmap

Overview bitmap

wxIconBundle

wxDC:drawIcon/3

wxCursor

This class is derived, and can use functions, from:

wxBitmap

wxWidgets docs: wxIcon

Summary

Types

wxIcon()

Functions

copyFromBitmap(This, Bmp)

Copies bmp bitmap to this icon.

destroy(This)

Destroys the object

new()

Default ctor.

new/1

Copy ctor.

new(Name, Options)

Loads an icon from a file or resource.

Types

wxIcon()

-type wxIcon() :: wx:wx_object().

Functions

copyFromBitmap(This, Bmp)

-spec copyFromBitmap(This, Bmp) -> ok when This :: wxIcon(), Bmp :: wxBitmap:wxBitmap().

Copies bmp bitmap to this icon.

Under MS Windows the bitmap must have mask colour set.

See: wxBitmap:loadFile/3

destroy(This)

-spec destroy(This :: wxIcon()) -> ok.

Destroys the object

new()

-spec new() -> wxIcon().

Default ctor.

Constructs an icon object with no data; an assignment or another member function such as wxBitmap:loadFile/3 must be called subsequently.

new/1

-spec new(Name) -> wxIcon() when Name :: unicode:chardata();
         (Icon) -> wxIcon() when Icon :: wxIcon().

Copy ctor.

new(Name, Options)

-spec new(Name, [Option]) -> wxIcon()
             when
                 Name :: unicode:chardata(),
                 Option :: {type, wx:wx_enum()} | {desiredWidth, integer()} | {desiredHeight, integer()}.

Loads an icon from a file or resource.

See: wxBitmap:loadFile/3

wxIconBundle

This class contains multiple copies of an icon in different sizes.

It is typically used in wxDialog::SetIcons (not implemented in wx) and wxTopLevelWindow:setIcons/2.

Predefined objects (include wx.hrl): ?wxNullIconBundle

wxWidgets docs: wxIconBundle

Summary

Types

wxIconBundle()

Functions

addIcon/2

Adds the icon to the collection; if the collection already contains an icon with the same width and height, it is replaced by the new one.

addIcon(This, File, Type)

destroy(This)

Destroys the object

getIcon(This)

Equivalent to getIcon(This, []).

getIcon/2

Same as.

getIcon/3

Returns the icon with the given size.

new()

Default ctor.

new/1

Initializes the bundle with the icon(s) found in the file.

new(File, Type)

Types

wxIconBundle()

-type wxIconBundle() :: wx:wx_object().

Functions

addIcon/2

-spec addIcon(This, File) -> ok when This :: wxIconBundle(), File :: unicode:chardata();
             (This, Icon) -> ok when This :: wxIconBundle(), Icon :: wxIcon:wxIcon().

Adds the icon to the collection; if the collection already contains an icon with the same width and height, it is replaced by the new one.

addIcon(This, File, Type)

-spec addIcon(This, File, Type) -> ok
                 when This :: wxIconBundle(), File :: unicode:chardata(), Type :: wx:wx_enum().

destroy(This)

-spec destroy(This :: wxIconBundle()) -> ok.

Destroys the object

getIcon(This)

-spec getIcon(This) -> wxIcon:wxIcon() when This :: wxIconBundle().

Equivalent to getIcon(This, []).

getIcon/2

-spec getIcon(This, Size) -> wxIcon:wxIcon()
                 when This :: wxIconBundle(), Size :: {W :: integer(), H :: integer()};
             (This, [Option]) -> wxIcon:wxIcon()
                 when This :: wxIconBundle(), Option :: {size, integer()} | {flags, integer()}.

Same as.

.

getIcon/3

-spec getIcon(This, Size, [Option]) -> wxIcon:wxIcon()
                 when
                     This :: wxIconBundle(),
                     Size :: {W :: integer(), H :: integer()},
                     Option :: {flags, integer()}.

Returns the icon with the given size.

If size is ?wxDefaultSize, it is interpreted as the standard system icon size, i.e. the size returned by wxSystemSettings:getMetric/2 for wxSYS_ICON_X and wxSYS_ICON_Y.

If the bundle contains an icon with exactly the requested size, it's always returned. Otherwise, the behaviour depends on the flags. If only wxIconBundle::FALLBACK_NONE (not implemented in wx) is given, the function returns an invalid icon. If wxIconBundle::FALLBACK_SYSTEM (not implemented in wx) is given, it tries to find the icon of standard system size, regardless of the size passed as parameter. Otherwise, or if the icon system size is not found neither, but wxIconBundle::FALLBACK_NEAREST_LARGER (not implemented in wx) flag is specified, the function returns the smallest icon of the size larger than the requested one or, if this fails too, just the icon closest to the specified size.

The flags parameter is available only since wxWidgets 2.9.4.

new()

-spec new() -> wxIconBundle().

Default ctor.

new/1

-spec new(Ic) -> wxIconBundle() when Ic :: wxIconBundle:wxIconBundle() | wxIcon:wxIcon();
         (File) -> wxIconBundle() when File :: unicode:chardata().

Initializes the bundle with the icon(s) found in the file.

new(File, Type)

-spec new(File, Type) -> wxIconBundle() when File :: unicode:chardata(), Type :: wx:wx_enum().

wxIconizeEvent

An event being sent when the frame is iconized (minimized) or restored.

See:

Overview events

wxTopLevelWindow:iconize/2

wxTopLevelWindow:isIconized/1

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxIconizeEvent

Events

Use wxEvtHandler:connect/3 with wxIconizeEventType to subscribe to events of this type.

Summary

Types

wxIconize()

wxIconizeEvent()

wxIconizeEventType()

Functions

isIconized(This)

Returns true if the frame has been iconized, false if it has been restored.

Types

wxIconize()

-type wxIconize() :: #wxIconize{type :: wxIconizeEvent:wxIconizeEventType(), iconized :: boolean()}.

wxIconizeEvent()

-type wxIconizeEvent() :: wx:wx_object().

wxIconizeEventType()

-type wxIconizeEventType() :: iconize.

Functions

isIconized(This)

-spec isIconized(This) -> boolean() when This :: wxIconizeEvent().

Returns true if the frame has been iconized, false if it has been restored.

wxIdleEvent

This class is used for idle events, which are generated when the system becomes idle.

Note that, unless you do something specifically, the idle events are not sent if the system remains idle once it has become it, e.g. only a single idle event will be generated until something else resulting in more normal events happens and only then is the next idle event sent again.

If you need to ensure a continuous stream of idle events, you can either use requestMore/2 method in your handler or call ?wxWakeUpIdle() periodically (for example from a timer event handler), but note that both of these approaches (and especially the first one) increase the system load and so should be avoided if possible.

By default, idle events are sent to all windows, including even the hidden ones because they may be shown if some condition is met from their wxEVT_IDLE (or related wxEVT_UPDATE_UI) handler. The children of hidden windows do not receive idle events however as they can't change their state in any way noticeable by the user. Finally, the global wxApp (not implemented in wx) object also receives these events, as usual, so it can be used for any global idle time processing.

If sending idle events to all windows is causing a significant overhead in your application, you can call setMode/1 with the value wxIDLE_PROCESS_SPECIFIED, and set the wxWS_EX_PROCESS_IDLE extra window style for every window which should receive idle events, all the other ones will not receive them in this case.

Delayed Action Mechanism

wxIdleEvent can be used to perform some action "at slightly later time". This can be necessary in several circumstances when, for whatever reason, something can't be done in the current event handler. For example, if a mouse event handler is called with the mouse button pressed, the mouse can be currently captured and some operations with it - notably capturing it again - might be impossible or lead to undesirable results. If you still want to capture it, you can do it from wxEVT_IDLE handler when it is called the next time instead of doing it immediately.

This can be achieved in two different ways: when using static event tables, you will need a flag indicating to the (always connected) idle event handler whether the desired action should be performed. The originally called handler would then set it to indicate that it should indeed be done and the idle handler itself would reset it to prevent it from doing the same action again.

Using dynamically connected event handlers things are even simpler as the original event handler can simply wxEvtHandler::Connect() (not implemented in wx) or wxEvtHandler::Bind() (not implemented in wx) the idle event handler which would only be executed then and could wxEvtHandler::Disconnect() (not implemented in wx) or wxEvtHandler::Unbind() (not implemented in wx) itself.

See:

Overview events

wxUpdateUIEvent

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxIdleEvent

Events

Use wxEvtHandler:connect/3 with wxIdleEventType to subscribe to events of this type.

Summary

Types

wxIdle()

wxIdleEvent()

wxIdleEventType()

Functions

getMode()

Static function returning a value specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.

moreRequested(This)

Returns true if the OnIdle function processing this event requested more processing time.

requestMore(This)

Equivalent to requestMore(This, []).

requestMore/2

Tells wxWidgets that more processing is required.

setMode(Mode)

Static function for specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.

Types

wxIdle()

-type wxIdle() :: #wxIdle{type :: wxIdleEvent:wxIdleEventType()}.

wxIdleEvent()

-type wxIdleEvent() :: wx:wx_object().

wxIdleEventType()

-type wxIdleEventType() :: idle.

Functions

getMode()

-spec getMode() -> wx:wx_enum().

Static function returning a value specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.

See: setMode/1

moreRequested(This)

-spec moreRequested(This) -> boolean() when This :: wxIdleEvent().

Returns true if the OnIdle function processing this event requested more processing time.

See: requestMore/2

requestMore(This)

-spec requestMore(This) -> ok when This :: wxIdleEvent().

Equivalent to requestMore(This, []).

requestMore/2

-spec requestMore(This, [Option]) -> ok when This :: wxIdleEvent(), Option :: {needMore, boolean()}.

Tells wxWidgets that more processing is required.

This function can be called by an OnIdle handler for a window or window event handler to indicate that wxApp::OnIdle should forward the OnIdle event once more to the application windows.

If no window calls this function during OnIdle, then the application will remain in a passive event loop (not calling OnIdle) until a new event is posted to the application by the windowing system.

See: moreRequested/1

setMode(Mode)

-spec setMode(Mode) -> ok when Mode :: wx:wx_enum().

Static function for specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events.

wxImage

This class encapsulates a platform-independent image.

An image can be created from data, or using wxBitmap:convertToImage/1. An image can be loaded from a file in a variety of formats, and is extensible to new formats via image format handlers. Functions are available to set and get image bits, so it can be used for basic image manipulation.

A wxImage cannot (currently) be drawn directly to a wxDC. Instead, a platform-specific wxBitmap object must be created from it using the wxBitmap::wxBitmap(wxImage,int depth) constructor. This bitmap can then be drawn in a device context, using wxDC:drawBitmap/4.

More on the difference between wxImage and wxBitmap: wxImage is just a buffer of RGB bytes with an optional buffer for the alpha bytes. It is all generic, platform independent and image file format independent code. It includes generic code for scaling, resizing, clipping, and other manipulations of the image data. OTOH, wxBitmap is intended to be a wrapper of whatever is the native image format that is quickest/easiest to draw to a DC or to be the target of the drawing operations performed on a wxMemoryDC. By splitting the responsibilities between wxImage/wxBitmap like this then it's easier to use generic code shared by all platforms and image types for generic operations and platform specific code where performance or compatibility is needed.

One colour value of the image may be used as a mask colour which will lead to the automatic creation of a wxMask object associated to the bitmap object.

Alpha channel support

Starting from wxWidgets 2.5.0 wxImage supports alpha channel data, that is in addition to a byte for the red, green and blue colour components for each pixel it also stores a byte representing the pixel opacity.

An alpha value of 0 corresponds to a transparent pixel (null opacity) while a value of 255 means that the pixel is 100% opaque. The constants ?wxIMAGE_ALPHA_TRANSPARENT and ?wxIMAGE_ALPHA_OPAQUE can be used to indicate those values in a more readable form.

While all images have RGB data, not all images have an alpha channel. Before using getAlpha/3 you should check if this image contains an alpha channel with hasAlpha/1. Currently the BMP, PNG, TGA, and TIFF format handlers have full alpha channel support for loading so if you want to use alpha you have to use one of these formats. If you initialize the image alpha channel yourself using setAlpha/4, you should save it in either PNG, TGA, or TIFF format to avoid losing it as these are the only handlers that currently support saving with alpha.

Available image handlers

The following image handlers are available. wxBMPHandler is always installed by default. To use other image formats, install the appropriate handler with wxImage::AddHandler (not implemented in wx) or call ?wxInitAllImageHandlers().

wxBMPHandler: For loading (including alpha support) and saving, always installed.

wxPNGHandler (not implemented in wx): For loading and saving. Includes alpha support.

wxJPEGHandler (not implemented in wx): For loading and saving.

wxGIFHandler (not implemented in wx): For loading and saving (see below).

wxPCXHandler (not implemented in wx): For loading and saving (see below).

wxPNMHandler (not implemented in wx): For loading and saving (see below).

wxTIFFHandler (not implemented in wx): For loading and saving. Includes alpha support.

wxTGAHandler (not implemented in wx): For loading and saving. Includes alpha support.

wxIFFHandler (not implemented in wx): For loading only.

wxXPMHandler (not implemented in wx): For loading and saving.

wxICOHandler: For loading and saving.

wxCURHandler: For loading and saving.

wxANIHandler: For loading only.

When saving in PCX format, wxPCXHandler (not implemented in wx) will count the number of different colours in the image; if there are 256 or less colours, it will save as 8 bit, else it will save as 24 bit.

Loading PNMs only works for ASCII or raw RGB images. When saving in PNM format, wxPNMHandler (not implemented in wx) will always save as raw RGB.

Saving GIFs requires images of maximum 8 bpp (see wxQuantize (not implemented in wx)), and the alpha channel converted to a mask (see convertAlphaToMask/5). Saving an animated GIF requires images of the same size (see wxGIFHandler::SaveAnimation (not implemented in wx))

Predefined objects (include wx.hrl): ?wxNullImage

See:

wxBitmap

?wxInitAllImageHandlers()

wxWidgets docs: wxImage

Summary

Types

wxImage()

Functions

blur(This, BlurRadius)

Blurs the image in both horizontal and vertical directions by the specified pixel blurRadius.

blurHorizontal(This, BlurRadius)

Blurs the image in the horizontal direction only.

blurVertical(This, BlurRadius)

Blurs the image in the vertical direction only.

convertAlphaToMask(This)

Equivalent to convertAlphaToMask(This, []).

convertAlphaToMask/2

If the image has alpha channel, this method converts it to mask.

convertAlphaToMask(This, Mr, Mg, Mb)

Equivalent to convertAlphaToMask(This, Mr, Mg, Mb, []).

convertAlphaToMask/5

If the image has alpha channel, this method converts it to mask using the specified colour as the mask colour.

convertToGreyscale(This)

Returns a greyscale version of the image.

convertToGreyscale(This, Weight_r, Weight_g, Weight_b)

Returns a greyscale version of the image.

convertToMono(This, R, G, B)

Returns monochromatic version of the image.

copy(This)

Returns an identical copy of this image.

create(This, Sz)

Equivalent to create(This, Sz, []).

create/3

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create/4

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create(This, Width, Height, Data, Alpha)

Creates a fresh image.

'Destroy'(This)

Destroys the image data.

destroy(This)

Destroys the object

findFirstUnusedColour(This)

Equivalent to findFirstUnusedColour(This, []).

findFirstUnusedColour/2

Finds the first colour that is never used in the image.

getAlpha(This)

Returns pointer to the array storing the alpha values for this image.

getAlpha(This, X, Y)

Return alpha value at given pixel location.

getBlue(This, X, Y)

Returns the blue intensity at the given coordinate.

getData(This)

Returns the image data as an array.

getGreen(This, X, Y)

Returns the green intensity at the given coordinate.

getHeight(This)

Gets the height of the image in pixels.

getImageCount(Filename)

Equivalent to getImageCount(Filename, []).

getImageCount(Filename, Options)

If the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.

getImageExtWildcard()

Iterates all registered wxImageHandler (not implemented in wx) objects, and returns a string containing file extension masks suitable for passing to file open/save dialog boxes.

getMaskBlue(This)

Gets the blue value of the mask colour.

getMaskGreen(This)

Gets the green value of the mask colour.

getMaskRed(This)

Gets the red value of the mask colour.

getOption(This, Name)

Gets a user-defined string-valued option.

getOptionInt(This, Name)

Gets a user-defined integer-valued option.

getOrFindMaskColour(This)

Get the current mask colour or find a suitable unused colour that could be used as a mask colour.

getPalette(This)

Returns the palette associated with the image.

getRed(This, X, Y)

Returns the red intensity at the given coordinate.

getSubImage(This, Rect)

Returns a sub image of the current one as long as the rect belongs entirely to the image.

getWidth(This)

Gets the width of the image in pixels.

hasAlpha(This)

Returns true if this image has alpha channel, false otherwise.

hasMask(This)

Returns true if there is a mask active, false otherwise.

hasOption(This, Name)

Returns true if the given option is present.

initAlpha(This)

Initializes the image alpha channel data.

initStandardHandlers()

Internal use only.

isOk(This)

Returns true if image data is present.

isTransparent(This, X, Y)

Equivalent to isTransparent(This, X, Y, []).

isTransparent/4

Returns true if the given pixel is transparent, i.e. either has the mask colour if this image has a mask or if this image has alpha channel and alpha value of this pixel is strictly less than threshold.

loadFile(This, Name)

Equivalent to loadFile(This, Name, []).

loadFile/3

Loads an image from a file.

loadFile/4

Loads an image from a file.

mirror(This)

Equivalent to mirror(This, []).

mirror/2

Returns a mirrored copy of the image.

new()

Creates an empty wxImage object without an alpha channel.

new/1

Equivalent to: new/2

new/2

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

new/3

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

new(Width, Height, Data, Alpha)

Creates an image from data in memory.

ok(This)

Equivalent to: isOk/1

removeHandler(Name)

Finds the handler with the given name, and removes it.

replace(This, R1, G1, B1, R2, G2, B2)

Replaces the colour specified by r1,g1,b1 by the colour r2,g2,b2.

rescale(This, Width, Height)

Equivalent to rescale(This, Width, Height, []).

rescale/4

Changes the size of the image in-place by scaling it: after a call to this function,the image will have the given width and height.

resize(This, Size, Pos)

Equivalent to resize(This, Size, Pos, []).

resize/4

Changes the size of the image in-place without scaling it by adding either a border with the given colour or cropping as necessary.

rotate90(This)

Equivalent to rotate90(This, []).

rotate90/2

Returns a copy of the image rotated 90 degrees in the direction indicated by clockwise.

rotate(This, Angle, RotationCentre)

Equivalent to rotate(This, Angle, RotationCentre, []).

rotate/4

Rotates the image about the given point, by angle radians.

rotateHue(This, Angle)

Rotates the hue of each pixel in the image by angle, which is a double in the range of -1.0 to +1.0, where -1.0 corresponds to -360 degrees and +1.0 corresponds to +360 degrees.

saveFile(This, Name)

Saves an image in the named file.

saveFile/3

Saves an image in the named file.

scale(This, Width, Height)

Equivalent to scale(This, Width, Height, []).

scale/4

Returns a scaled version of the image.

setAlpha(This, Alpha)

This function is similar to setData/4 and has similar restrictions.

setAlpha(This, X, Y, Alpha)

Sets the alpha value for the given pixel.

setData(This, Data)

Sets the image data without performing checks.

setData(This, Data, New_width, New_height)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setMask(This)

Equivalent to setMask(This, []).

setMask/2

Specifies whether there is a mask or not.

setMaskColour(This, Red, Green, Blue)

Sets the mask colour for this image (and tells the image to use the mask).

setMaskFromImage(This, Mask, Mr, Mg, Mb)

Sets image's mask so that the pixels that have RGB value of mr,mg,mb in mask will be masked in the image.

setOption/3

Sets a user-defined option.

setPalette(This, Palette)

Associates a palette with the image.

setRGB(This, Rect, Red, Green, Blue)

Sets the colour of the pixels within the given rectangle.

setRGB(This, X, Y, R, G, B)

Set the color of the pixel at the given x and y coordinate.

size(This, Size, Pos)

Equivalent to size(This, Size, Pos, []).

size/4

Returns a resized version of this image without scaling it by adding either a border with the given colour or cropping as necessary.

Types

wxImage()

-type wxImage() :: wx:wx_object().

Functions

blur(This, BlurRadius)

-spec blur(This, BlurRadius) -> wxImage() when This :: wxImage(), BlurRadius :: integer().

Blurs the image in both horizontal and vertical directions by the specified pixel blurRadius.

This should not be used when using a single mask colour for transparency.

See:

blurHorizontal/2

blurVertical/2

blurHorizontal(This, BlurRadius)

-spec blurHorizontal(This, BlurRadius) -> wxImage() when This :: wxImage(), BlurRadius :: integer().

Blurs the image in the horizontal direction only.

This should not be used when using a single mask colour for transparency.

See:

blur/2

blurVertical/2

blurVertical(This, BlurRadius)

-spec blurVertical(This, BlurRadius) -> wxImage() when This :: wxImage(), BlurRadius :: integer().

Blurs the image in the vertical direction only.

This should not be used when using a single mask colour for transparency.

See:

blur/2

blurHorizontal/2

convertAlphaToMask(This)

-spec convertAlphaToMask(This) -> boolean() when This :: wxImage().

Equivalent to convertAlphaToMask(This, []).

convertAlphaToMask/2

-spec convertAlphaToMask(This, [Option]) -> boolean()
                            when This :: wxImage(), Option :: {threshold, integer()}.

If the image has alpha channel, this method converts it to mask.

If the image has an alpha channel, all pixels with alpha value less than threshold are replaced with the mask colour and the alpha channel is removed. Otherwise nothing is done.

The mask colour is chosen automatically using findFirstUnusedColour/2, see the overload below if this is not appropriate.

Return: Returns true on success, false on error.

convertAlphaToMask(This, Mr, Mg, Mb)

-spec convertAlphaToMask(This, Mr, Mg, Mb) -> boolean()
                            when This :: wxImage(), Mr :: integer(), Mg :: integer(), Mb :: integer().

Equivalent to convertAlphaToMask(This, Mr, Mg, Mb, []).

convertAlphaToMask/5

-spec convertAlphaToMask(This, Mr, Mg, Mb, [Option]) -> boolean()
                            when
                                This :: wxImage(),
                                Mr :: integer(),
                                Mg :: integer(),
                                Mb :: integer(),
                                Option :: {threshold, integer()}.

If the image has alpha channel, this method converts it to mask using the specified colour as the mask colour.

If the image has an alpha channel, all pixels with alpha value less than threshold are replaced with the mask colour and the alpha channel is removed. Otherwise nothing is done.

Since: 2.9.0

Return: Returns true on success, false on error.

convertToGreyscale(This)

-spec convertToGreyscale(This) -> wxImage() when This :: wxImage().

Returns a greyscale version of the image.

Since: 2.9.0

convertToGreyscale(This, Weight_r, Weight_g, Weight_b)

-spec convertToGreyscale(This, Weight_r, Weight_g, Weight_b) -> wxImage()
                            when
                                This :: wxImage(),
                                Weight_r :: number(),
                                Weight_g :: number(),
                                Weight_b :: number().

Returns a greyscale version of the image.

The returned image uses the luminance component of the original to calculate the greyscale. Defaults to using the standard ITU-T BT.601 when converting to YUV, where every pixel equals (R weight_r) + (G weight_g) + (B * weight_b).

convertToMono(This, R, G, B)

-spec convertToMono(This, R, G, B) -> wxImage()
                       when This :: wxImage(), R :: integer(), G :: integer(), B :: integer().

Returns monochromatic version of the image.

The returned image has white colour where the original has (r,g,b) colour and black colour everywhere else.

copy(This)

-spec copy(This) -> wxImage() when This :: wxImage().

Returns an identical copy of this image.

create(This, Sz)

-spec create(This, Sz) -> boolean() when This :: wxImage(), Sz :: {W :: integer(), H :: integer()}.

Equivalent to create(This, Sz, []).

create/3

-spec create(This, Width, Height) -> boolean()
                when This :: wxImage(), Width :: integer(), Height :: integer();
            (This, Sz, Data) -> boolean()
                when This :: wxImage(), Sz :: {W :: integer(), H :: integer()}, Data :: binary();
            (This, Sz, [Option]) -> boolean()
                when
                    This :: wxImage(),
                    Sz :: {W :: integer(), H :: integer()},
                    Option :: {clear, boolean()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create/4

-spec create(This, Width, Height, Data) -> boolean()
                when This :: wxImage(), Width :: integer(), Height :: integer(), Data :: binary();
            (This, Width, Height, [Option]) -> boolean()
                when
                    This :: wxImage(),
                    Width :: integer(),
                    Height :: integer(),
                    Option :: {clear, boolean()};
            (This, Sz, Data, Alpha) -> boolean()
                when
                    This :: wxImage(),
                    Sz :: {W :: integer(), H :: integer()},
                    Data :: binary(),
                    Alpha :: binary().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create(This, Width, Height, Data, Alpha)

-spec create(This, Width, Height, Data, Alpha) -> boolean()
                when
                    This :: wxImage(),
                    Width :: integer(),
                    Height :: integer(),
                    Data :: binary(),
                    Alpha :: binary().

Creates a fresh image.

See new/4 for more info.

Return: true if the call succeeded, false otherwise.

'Destroy'(This)

-spec 'Destroy'(This) -> ok when This :: wxImage().

Destroys the image data.

destroy(This)

-spec destroy(This :: wxImage()) -> ok.

Destroys the object

findFirstUnusedColour(This)

-spec findFirstUnusedColour(This) -> Result
                               when
                                   Result ::
                                       {Res :: boolean(),
                                        R :: integer(),
                                        G :: integer(),
                                        B :: integer()},
                                   This :: wxImage().

Equivalent to findFirstUnusedColour(This, []).

findFirstUnusedColour/2

-spec findFirstUnusedColour(This, [Option]) -> Result
                               when
                                   Result ::
                                       {Res :: boolean(),
                                        R :: integer(),
                                        G :: integer(),
                                        B :: integer()},
                                   This :: wxImage(),
                                   Option ::
                                       {startR, integer()} | {startG, integer()} | {startB, integer()}.

Finds the first colour that is never used in the image.

The search begins at given initial colour and continues by increasing R, G and B components (in this order) by 1 until an unused colour is found or the colour space exhausted.

The parameters r, g, b are pointers to variables to save the colour.

The parameters startR, startG, startB define the initial values of the colour. The returned colour will have RGB values equal to or greater than these.

Return: Returns false if there is no unused colour left, true on success.

Note: This method involves computing the histogram, which is a computationally intensive operation.

getAlpha(This)

-spec getAlpha(This) -> binary() when This :: wxImage().

Returns pointer to the array storing the alpha values for this image.

This pointer is NULL for the images without the alpha channel. If the image does have it, this pointer may be used to directly manipulate the alpha values which are stored as the RGB ones.

getAlpha(This, X, Y)

-spec getAlpha(This, X, Y) -> integer() when This :: wxImage(), X :: integer(), Y :: integer().

Return alpha value at given pixel location.

getBlue(This, X, Y)

-spec getBlue(This, X, Y) -> integer() when This :: wxImage(), X :: integer(), Y :: integer().

Returns the blue intensity at the given coordinate.

getData(This)

-spec getData(This) -> binary() when This :: wxImage().

Returns the image data as an array.

This is most often used when doing direct image manipulation. The return value points to an array of characters in RGBRGBRGB... format in the top-to-bottom, left-to-right order, that is the first RGB triplet corresponds to the first pixel of the first row, the second one - to the second pixel of the first row and so on until the end of the first row, with second row following after it and so on.

You should not delete the returned pointer nor pass it to setData/4.

getGreen(This, X, Y)

-spec getGreen(This, X, Y) -> integer() when This :: wxImage(), X :: integer(), Y :: integer().

Returns the green intensity at the given coordinate.

getHeight(This)

-spec getHeight(This) -> integer() when This :: wxImage().

Gets the height of the image in pixels.

See: getWidth/1

getImageCount(Filename)

-spec getImageCount(Filename) -> integer() when Filename :: unicode:chardata().

Equivalent to getImageCount(Filename, []).

getImageCount(Filename, Options)

-spec getImageCount(Filename, [Option]) -> integer()
                       when Filename :: unicode:chardata(), Option :: {type, wx:wx_enum()}.

If the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.

For the overload taking the parameter filename, that's the name of the file to query. For the overload taking the parameter stream, that's the opened input stream with image data.

See wxImageHandler::GetImageCount() (not implemented in wx) for more info.

The parameter type may be one of the following values:

wxBITMAP_TYPE_BMP: Load a Windows bitmap file.

wxBITMAP_TYPE_GIF: Load a GIF bitmap file.

wxBITMAP_TYPE_JPEG: Load a JPEG bitmap file.

wxBITMAP_TYPE_PNG: Load a PNG bitmap file.

wxBITMAP_TYPE_PCX: Load a PCX bitmap file.

wxBITMAP_TYPE_PNM: Load a PNM bitmap file.

wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file.

wxBITMAP_TYPE_TGA: Load a TGA bitmap file.

wxBITMAP_TYPE_XPM: Load a XPM bitmap file.

wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO).

wxBITMAP_TYPE_CUR: Load a Windows cursor file (CUR).

wxBITMAP_TYPE_ANI: Load a Windows animated cursor file (ANI).

wxBITMAP_TYPE_ANY: Will try to autodetect the format.

Return: Number of available images. For most image handlers, this is 1 (exceptions are TIFF and ICO formats as well as animated GIFs for which this function returns the number of frames in the animation).

getImageExtWildcard()

-spec getImageExtWildcard() -> unicode:charlist().

Iterates all registered wxImageHandler (not implemented in wx) objects, and returns a string containing file extension masks suitable for passing to file open/save dialog boxes.

Return: The format of the returned string is "(*.ext1;*.ext2)|*.ext1;*.ext2". It is usually a good idea to prepend a description before passing the result to the dialog. Example:

getMaskBlue(This)

-spec getMaskBlue(This) -> integer() when This :: wxImage().

Gets the blue value of the mask colour.

getMaskGreen(This)

-spec getMaskGreen(This) -> integer() when This :: wxImage().

Gets the green value of the mask colour.

getMaskRed(This)

-spec getMaskRed(This) -> integer() when This :: wxImage().

Gets the red value of the mask colour.

getOption(This, Name)

-spec getOption(This, Name) -> unicode:charlist() when This :: wxImage(), Name :: unicode:chardata().

Gets a user-defined string-valued option.

Generic options:

wxIMAGE_OPTION_FILENAME: The name of the file from which the image was loaded.

Options specific to wxGIFHandler (not implemented in wx):

wxIMAGE_OPTION_GIF_COMMENT: The comment text that is read from or written to the GIF file. In an animated GIF each frame can have its own comment. If there is only a comment in the first frame of a GIF it will not be repeated in other frames.

Return: The value of the option or an empty string if not found. Use hasOption/2 if an empty string can be a valid option value.

See:

setOption/3

getOptionInt/2

hasOption/2

getOptionInt(This, Name)

-spec getOptionInt(This, Name) -> integer() when This :: wxImage(), Name :: unicode:chardata().

Gets a user-defined integer-valued option.

The function is case-insensitive to name. If the given option is not present, the function returns 0. Use hasOption/2 if 0 is a possibly valid value for the option.

Generic options:

wxIMAGE_OPTION_MAX_WIDTH and wxIMAGE_OPTION_MAX_HEIGHT: If either of these options is specified, the loaded image will be scaled down (preserving its aspect ratio) so that its width is less than the max width given if it is not 0 and its height is less than the max height given if it is not 0. This is typically used for loading thumbnails and the advantage of using these options compared to calling rescale/4 after loading is that some handlers (only JPEG one right now) support rescaling the image during loading which is vastly more efficient than loading the entire huge image and rescaling it later (if these options are not supported by the handler, this is still what happens however). These options must be set before calling loadFile/4 to have any effect.

wxIMAGE_OPTION_ORIGINAL_WIDTH and wxIMAGE_OPTION_ORIGINAL_HEIGHT: These options will return the original size of the image if either wxIMAGE_OPTION_MAX_WIDTH or wxIMAGE_OPTION_MAX_HEIGHT is specified.

Since: 2.9.3

wxIMAGE_OPTION_QUALITY: JPEG quality used when saving. This is an integer in 0..100 range with 0 meaning very poor and 100 excellent (but very badly compressed). This option is currently ignored for the other formats.

wxIMAGE_OPTION_RESOLUTIONUNIT: The value of this option determines whether the resolution of the image is specified in centimetres or inches, see wxImageResolution enum elements.

wxIMAGE_OPTION_RESOLUTION, wxIMAGE_OPTION_RESOLUTIONX and wxIMAGE_OPTION_RESOLUTIONY: These options define the resolution of the image in the units corresponding to wxIMAGE_OPTION_RESOLUTIONUNIT options value. The first option can be set before saving the image to set both horizontal and vertical resolution to the same value. The X and Y options are set by the image handlers if they support the image resolution (currently BMP, JPEG and TIFF handlers do) and the image provides the resolution information and can be queried after loading the image.

Options specific to wxPNGHandler (not implemented in wx):

wxIMAGE_OPTION_PNG_FORMAT: Format for saving a PNG file, see wxImagePNGType for the supported values.

wxIMAGE_OPTION_PNG_BITDEPTH: Bit depth for every channel (R/G/B/A).

wxIMAGE_OPTION_PNG_FILTER: Filter for saving a PNG file, see libpng (http://www.libpng.org/pub/png/libpng-1.2.5-manual.html) for possible values (e.g. PNG_FILTER_NONE, PNG_FILTER_SUB, PNG_FILTER_UP, etc).

wxIMAGE_OPTION_PNG_COMPRESSION_LEVEL: Compression level (0..9) for saving a PNG file. An high value creates smaller-but-slower PNG file. Note that unlike other formats (e.g. JPEG) the PNG format is always lossless and thus this compression level doesn't tradeoff the image quality.

wxIMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL: Compression memory usage level (1..9) for saving a PNG file. An high value means the saving process consumes more memory, but may create smaller PNG file.

wxIMAGE_OPTION_PNG_COMPRESSION_STRATEGY: Possible values are 0 for default strategy, 1 for filter, and 2 for Huffman-only. You can use OptiPNG (http://optipng.sourceforge.net/) to get a suitable value for your application.

wxIMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE: Internal buffer size (in bytes) for saving a PNG file. Ideally this should be as big as the resulting PNG file. Use this option if your application produces images with small size variation.

Options specific to wxTIFFHandler (not implemented in wx):

wxIMAGE_OPTION_TIFF_BITSPERSAMPLE: Number of bits per sample (channel). Currently values of 1 and 8 are supported. A value of 1 results in a black and white image. A value of 8 (the default) can mean greyscale or RGB, depending on the value of wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL.

wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL: Number of samples (channels) per pixel. Currently values of 1 and 3 are supported. A value of 1 results in either a greyscale (by default) or black and white image, depending on the value of wxIMAGE_OPTION_TIFF_BITSPERSAMPLE. A value of 3 (the default) will result in an RGB image.

wxIMAGE_OPTION_TIFF_COMPRESSION: Compression type. By default it is set to 1 (COMPRESSION_NONE). Typical other values are 5 (COMPRESSION_LZW) and 7 (COMPRESSION_JPEG). See tiff.h for more options.

wxIMAGE_OPTION_TIFF_PHOTOMETRIC: Specifies the photometric interpretation. By default it is set to 2 (PHOTOMETRIC_RGB) for RGB images and 0 (PHOTOMETRIC_MINISWHITE) for greyscale or black and white images. It can also be set to 1 (PHOTOMETRIC_MINISBLACK) to treat the lowest value as black and highest as white. If you want a greyscale image it is also sufficient to only specify wxIMAGE_OPTION_TIFF_PHOTOMETRIC and set it to either PHOTOMETRIC_MINISWHITE or PHOTOMETRIC_MINISBLACK. The other values are taken care of.

Options specific to wxGIFHandler (not implemented in wx):

wxIMAGE_OPTION_GIF_TRANSPARENCY: How to deal with transparent pixels. By default, the color of transparent pixels is changed to bright pink, so that if the image is accidentally drawn without transparency, it will be obvious. Normally, this would not be noticed, as these pixels will not be rendered. But in some cases it might be useful to load a GIF without making any modifications to its colours. Use wxIMAGE_OPTION_GIF_TRANSPARENCY_UNCHANGED to keep the colors correct. Use wxIMAGE_OPTION_GIF_TRANSPARENCY_HIGHLIGHT to convert transparent pixels to pink (default). This option has been added in wxWidgets 3.1.1.

Note: Be careful when combining the options wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL, wxIMAGE_OPTION_TIFF_BITSPERSAMPLE, and wxIMAGE_OPTION_TIFF_PHOTOMETRIC. While some measures are taken to prevent illegal combinations and/or values, it is still easy to abuse them and come up with invalid results in the form of either corrupted images or crashes.

Return: The value of the option or 0 if not found. Use hasOption/2 if 0 can be a valid option value.

See:

setOption/3

getOption/2

getOrFindMaskColour(This)

-spec getOrFindMaskColour(This) -> Result
                             when
                                 Result ::
                                     {Res :: boolean(), R :: integer(), G :: integer(), B :: integer()},
                                 This :: wxImage().

Get the current mask colour or find a suitable unused colour that could be used as a mask colour.

Returns true if the image currently has a mask.

getPalette(This)

-spec getPalette(This) -> wxPalette:wxPalette() when This :: wxImage().

Returns the palette associated with the image.

Currently the palette is only used when converting to wxBitmap under Windows.

Some of the wxImage handlers have been modified to set the palette if one exists in the image file (usually 256 or less colour images in GIF or PNG format).

getRed(This, X, Y)

-spec getRed(This, X, Y) -> integer() when This :: wxImage(), X :: integer(), Y :: integer().

Returns the red intensity at the given coordinate.

getSubImage(This, Rect)

-spec getSubImage(This, Rect) -> wxImage()
                     when
                         This :: wxImage(),
                         Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Returns a sub image of the current one as long as the rect belongs entirely to the image.

getWidth(This)

-spec getWidth(This) -> integer() when This :: wxImage().

Gets the width of the image in pixels.

See: getHeight/1

hasAlpha(This)

-spec hasAlpha(This) -> boolean() when This :: wxImage().

Returns true if this image has alpha channel, false otherwise.

See:

getAlpha/3

setAlpha/4

hasMask(This)

-spec hasMask(This) -> boolean() when This :: wxImage().

Returns true if there is a mask active, false otherwise.

hasOption(This, Name)

-spec hasOption(This, Name) -> boolean() when This :: wxImage(), Name :: unicode:chardata().

Returns true if the given option is present.

The function is case-insensitive to name.

The lists of the currently supported options are in getOption/2 and getOptionInt/2 function docs.

See:

setOption/3

getOption/2

getOptionInt/2

initAlpha(This)

-spec initAlpha(This) -> ok when This :: wxImage().

Initializes the image alpha channel data.

It is an error to call it if the image already has alpha data. If it doesn't, alpha data will be by default initialized to all pixels being fully opaque. But if the image has a mask colour, all mask pixels will be completely transparent.

initStandardHandlers()

-spec initStandardHandlers() -> ok.

Internal use only.

Adds standard image format handlers. It only install wxBMPHandler for the time being, which is used by wxBitmap.

This function is called by wxWidgets on startup, and shouldn't be called by the user.

See: ?wxInitAllImageHandlers()

isOk(This)

-spec isOk(This) -> boolean() when This :: wxImage().

Returns true if image data is present.

isTransparent(This, X, Y)

-spec isTransparent(This, X, Y) -> boolean() when This :: wxImage(), X :: integer(), Y :: integer().

Equivalent to isTransparent(This, X, Y, []).

isTransparent/4

-spec isTransparent(This, X, Y, [Option]) -> boolean()
                       when
                           This :: wxImage(),
                           X :: integer(),
                           Y :: integer(),
                           Option :: {threshold, integer()}.

Returns true if the given pixel is transparent, i.e. either has the mask colour if this image has a mask or if this image has alpha channel and alpha value of this pixel is strictly less than threshold.

loadFile(This, Name)

-spec loadFile(This, Name) -> boolean() when This :: wxImage(), Name :: unicode:chardata().

Equivalent to loadFile(This, Name, []).

loadFile/3

-spec loadFile(This, Name, [Option]) -> boolean()
                  when
                      This :: wxImage(),
                      Name :: unicode:chardata(),
                      Option :: {type, wx:wx_enum()} | {index, integer()}.

Loads an image from a file.

If no handler type is provided, the library will try to autodetect the format.

loadFile/4

-spec loadFile(This, Name, Mimetype, [Option]) -> boolean()
                  when
                      This :: wxImage(),
                      Name :: unicode:chardata(),
                      Mimetype :: unicode:chardata(),
                      Option :: {index, integer()}.

Loads an image from a file.

If no handler type is provided, the library will try to autodetect the format.

mirror(This)

-spec mirror(This) -> wxImage() when This :: wxImage().

Equivalent to mirror(This, []).

mirror/2

-spec mirror(This, [Option]) -> wxImage() when This :: wxImage(), Option :: {horizontally, boolean()}.

Returns a mirrored copy of the image.

The parameter horizontally indicates the orientation.

new()

-spec new() -> wxImage().

Creates an empty wxImage object without an alpha channel.

new/1

-spec new(Name) -> wxImage() when Name :: unicode:chardata();
         (Sz) -> wxImage() when Sz :: {W :: integer(), H :: integer()}.

Equivalent to: new/2

new/2

-spec new(Width, Height) -> wxImage() when Width :: integer(), Height :: integer();
         (Name, [Option]) -> wxImage()
             when Name :: unicode:chardata(), Option :: {type, wx:wx_enum()} | {index, integer()};
         (Sz, Data) -> wxImage() when Sz :: {W :: integer(), H :: integer()}, Data :: binary();
         (Sz, [Option]) -> wxImage()
             when Sz :: {W :: integer(), H :: integer()}, Option :: {clear, boolean()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

new/3

-spec new(Width, Height, Data) -> wxImage()
             when Width :: integer(), Height :: integer(), Data :: binary();
         (Width, Height, [Option]) -> wxImage()
             when Width :: integer(), Height :: integer(), Option :: {clear, boolean()};
         (Name, Mimetype, [Option]) -> wxImage()
             when
                 Name :: unicode:chardata(),
                 Mimetype :: unicode:chardata(),
                 Option :: {index, integer()};
         (Sz, Data, Alpha) -> wxImage()
             when Sz :: {W :: integer(), H :: integer()}, Data :: binary(), Alpha :: binary().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

new(Width, Height, Data, Alpha)

-spec new(Width, Height, Data, Alpha) -> wxImage()
             when Width :: integer(), Height :: integer(), Data :: binary(), Alpha :: binary().

Creates an image from data in memory.

If static_data is false then the wxImage will take ownership of the data and free it afterwards. For this, it has to be allocated with malloc.

ok(This)

-spec ok(This) -> boolean() when This :: wxImage().

Equivalent to: isOk/1

removeHandler(Name)

-spec removeHandler(Name) -> boolean() when Name :: unicode:chardata().

Finds the handler with the given name, and removes it.

The handler is also deleted.

Return: true if the handler was found and removed, false otherwise.

replace(This, R1, G1, B1, R2, G2, B2)

-spec replace(This, R1, G1, B1, R2, G2, B2) -> ok
                 when
                     This :: wxImage(),
                     R1 :: integer(),
                     G1 :: integer(),
                     B1 :: integer(),
                     R2 :: integer(),
                     G2 :: integer(),
                     B2 :: integer().

Replaces the colour specified by r1,g1,b1 by the colour r2,g2,b2.

rescale(This, Width, Height)

-spec rescale(This, Width, Height) -> wxImage()
                 when This :: wxImage(), Width :: integer(), Height :: integer().

Equivalent to rescale(This, Width, Height, []).

rescale/4

-spec rescale(This, Width, Height, [Option]) -> wxImage()
                 when
                     This :: wxImage(),
                     Width :: integer(),
                     Height :: integer(),
                     Option :: {quality, wx:wx_enum()}.

Changes the size of the image in-place by scaling it: after a call to this function,the image will have the given width and height.

For a description of the quality parameter, see the scale/4 function. Returns the (modified) image itself.

See: scale/4

resize(This, Size, Pos)

-spec resize(This, Size, Pos) -> wxImage()
                when
                    This :: wxImage(),
                    Size :: {W :: integer(), H :: integer()},
                    Pos :: {X :: integer(), Y :: integer()}.

Equivalent to resize(This, Size, Pos, []).

resize/4

-spec resize(This, Size, Pos, [Option]) -> wxImage()
                when
                    This :: wxImage(),
                    Size :: {W :: integer(), H :: integer()},
                    Pos :: {X :: integer(), Y :: integer()},
                    Option :: {r, integer()} | {g, integer()} | {b, integer()}.

Changes the size of the image in-place without scaling it by adding either a border with the given colour or cropping as necessary.

The image is pasted into a new image with the given size and background colour at the position pos relative to the upper left of the new image.

If red = green = blue = -1 then use either the current mask colour if set or find, use, and set a suitable mask colour for any newly exposed areas.

Return: The (modified) image itself.

See: size/4

rotate90(This)

-spec rotate90(This) -> wxImage() when This :: wxImage().

Equivalent to rotate90(This, []).

rotate90/2

-spec rotate90(This, [Option]) -> wxImage() when This :: wxImage(), Option :: {clockwise, boolean()}.

Returns a copy of the image rotated 90 degrees in the direction indicated by clockwise.

rotate(This, Angle, RotationCentre)

-spec rotate(This, Angle, RotationCentre) -> wxImage()
                when
                    This :: wxImage(),
                    Angle :: number(),
                    RotationCentre :: {X :: integer(), Y :: integer()}.

Equivalent to rotate(This, Angle, RotationCentre, []).

rotate/4

-spec rotate(This, Angle, RotationCentre, [Option]) -> wxImage()
                when
                    This :: wxImage(),
                    Angle :: number(),
                    RotationCentre :: {X :: integer(), Y :: integer()},
                    Option ::
                        {interpolating, boolean()} |
                        {offset_after_rotation, {X :: integer(), Y :: integer()}}.

Rotates the image about the given point, by angle radians.

Passing true to interpolating results in better image quality, but is slower.

If the image has a mask, then the mask colour is used for the uncovered pixels in the rotated image background. Else, black (rgb 0, 0, 0) will be used.

Returns the rotated image, leaving this image intact.

rotateHue(This, Angle)

-spec rotateHue(This, Angle) -> ok when This :: wxImage(), Angle :: number().

Rotates the hue of each pixel in the image by angle, which is a double in the range of -1.0 to +1.0, where -1.0 corresponds to -360 degrees and +1.0 corresponds to +360 degrees.

saveFile(This, Name)

-spec saveFile(This, Name) -> boolean() when This :: wxImage(), Name :: unicode:chardata().

Saves an image in the named file.

File type is determined from the extension of the file name. Note that this function may fail if the extension is not recognized! You can use one of the forms above to save images to files with non-standard extensions.

saveFile/3

-spec saveFile(This, Name, Type) -> boolean()
                  when This :: wxImage(), Name :: unicode:chardata(), Type :: wx:wx_enum();
              (This, Name, Mimetype) -> boolean()
                  when This :: wxImage(), Name :: unicode:chardata(), Mimetype :: unicode:chardata().

Saves an image in the named file.

scale(This, Width, Height)

-spec scale(This, Width, Height) -> wxImage()
               when This :: wxImage(), Width :: integer(), Height :: integer().

Equivalent to scale(This, Width, Height, []).

scale/4

-spec scale(This, Width, Height, [Option]) -> wxImage()
               when
                   This :: wxImage(),
                   Width :: integer(),
                   Height :: integer(),
                   Option :: {quality, wx:wx_enum()}.

Returns a scaled version of the image.

This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a wxMemoryDC into another wxMemoryDC.

The parameter quality determines what method to use for resampling the image, see wxImageResizeQuality documentation.

It should be noted that although using wxIMAGE_QUALITY_HIGH produces much nicer looking results it is a slower method. Downsampling will use the box averaging method which seems to operate very fast. If you are upsampling larger images using this method you will most likely notice that it is a bit slower and in extreme cases it will be quite substantially slower as the bicubic algorithm has to process a lot of data.

It should also be noted that the high quality scaling may not work as expected when using a single mask colour for transparency, as the scaling will blur the image and will therefore remove the mask partially. Using the alpha channel will work.

Example:

See: rescale/4

setAlpha(This, Alpha)

-spec setAlpha(This, Alpha) -> ok when This :: wxImage(), Alpha :: binary().

This function is similar to setData/4 and has similar restrictions.

The pointer passed to it may however be NULL in which case the function will allocate the alpha array internally - this is useful to add alpha channel data to an image which doesn't have any.

If the pointer is not NULL, it must have one byte for each image pixel and be allocated with malloc(). wxImage takes ownership of the pointer and will free it unless static_data parameter is set to true - in this case the caller should do it.

setAlpha(This, X, Y, Alpha)

-spec setAlpha(This, X, Y, Alpha) -> ok
                  when This :: wxImage(), X :: integer(), Y :: integer(), Alpha :: integer().

Sets the alpha value for the given pixel.

This function should only be called if the image has alpha channel data, use hasAlpha/1 to check for this.

setData(This, Data)

-spec setData(This, Data) -> ok when This :: wxImage(), Data :: binary().

Sets the image data without performing checks.

The data given must have the size (widthheight3) or results will be unexpected. Don't use this method if you aren't sure you know what you are doing.

The data must have been allocated with malloc(), NOT with operator new.

If static_data is false, after this call the pointer to the data is owned by the wxImage object, that will be responsible for deleting it. Do not pass to this function a pointer obtained through getData/1.

setData(This, Data, New_width, New_height)

-spec setData(This, Data, New_width, New_height) -> ok
                 when
                     This :: wxImage(),
                     Data :: binary(),
                     New_width :: integer(),
                     New_height :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setMask(This)

-spec setMask(This) -> ok when This :: wxImage().

Equivalent to setMask(This, []).

setMask/2

-spec setMask(This, [Option]) -> ok when This :: wxImage(), Option :: {mask, boolean()}.

Specifies whether there is a mask or not.

The area of the mask is determined by the current mask colour.

setMaskColour(This, Red, Green, Blue)

-spec setMaskColour(This, Red, Green, Blue) -> ok
                       when This :: wxImage(), Red :: integer(), Green :: integer(), Blue :: integer().

Sets the mask colour for this image (and tells the image to use the mask).

setMaskFromImage(This, Mask, Mr, Mg, Mb)

-spec setMaskFromImage(This, Mask, Mr, Mg, Mb) -> boolean()
                          when
                              This :: wxImage(),
                              Mask :: wxImage(),
                              Mr :: integer(),
                              Mg :: integer(),
                              Mb :: integer().

Sets image's mask so that the pixels that have RGB value of mr,mg,mb in mask will be masked in the image.

This is done by first finding an unused colour in the image, setting this colour as the mask colour and then using this colour to draw all pixels in the image who corresponding pixel in mask has given RGB value.

The parameter mask is the mask image to extract mask shape from. It must have the same dimensions as the image.

The parameters mr, mg, mb are the RGB values of the pixels in mask that will be used to create the mask.

Return: Returns false if mask does not have same dimensions as the image or if there is no unused colour left. Returns true if the mask was successfully applied.

Note: Note that this method involves computing the histogram, which is a computationally intensive operation.

setOption/3

-spec setOption(This, Name, Value) -> ok
                   when This :: wxImage(), Name :: unicode:chardata(), Value :: integer();
               (This, Name, Value) -> ok
                   when This :: wxImage(), Name :: unicode:chardata(), Value :: unicode:chardata().

Sets a user-defined option.

The function is case-insensitive to name.

For example, when saving as a JPEG file, the option quality is used, which is a number between 0 and 100 (0 is terrible, 100 is very good).

The lists of the currently supported options are in getOption/2 and getOptionInt/2 function docs.

See:

getOption/2

getOptionInt/2

hasOption/2

setPalette(This, Palette)

-spec setPalette(This, Palette) -> ok when This :: wxImage(), Palette :: wxPalette:wxPalette().

Associates a palette with the image.

The palette may be used when converting wxImage to wxBitmap (MSW only at present) or in file save operations (none as yet).

setRGB(This, Rect, Red, Green, Blue)

-spec setRGB(This, Rect, Red, Green, Blue) -> ok
                when
                    This :: wxImage(),
                    Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                    Red :: integer(),
                    Green :: integer(),
                    Blue :: integer().

Sets the colour of the pixels within the given rectangle.

This routine performs bounds-checks for the coordinate so it can be considered a safe way to manipulate the data.

setRGB(This, X, Y, R, G, B)

-spec setRGB(This, X, Y, R, G, B) -> ok
                when
                    This :: wxImage(),
                    X :: integer(),
                    Y :: integer(),
                    R :: integer(),
                    G :: integer(),
                    B :: integer().

Set the color of the pixel at the given x and y coordinate.

size(This, Size, Pos)

-spec size(This, Size, Pos) -> wxImage()
              when
                  This :: wxImage(),
                  Size :: {W :: integer(), H :: integer()},
                  Pos :: {X :: integer(), Y :: integer()}.

Equivalent to size(This, Size, Pos, []).

size/4

-spec size(This, Size, Pos, [Option]) -> wxImage()
              when
                  This :: wxImage(),
                  Size :: {W :: integer(), H :: integer()},
                  Pos :: {X :: integer(), Y :: integer()},
                  Option :: {r, integer()} | {g, integer()} | {b, integer()}.

Returns a resized version of this image without scaling it by adding either a border with the given colour or cropping as necessary.

The image is pasted into a new image with the given size and background colour at the position pos relative to the upper left of the new image.

If red = green = blue = -1 then the areas of the larger image not covered by this image are made transparent by filling them with the image mask colour (which will be allocated automatically if it isn't currently set).

Otherwise, the areas will be filled with the colour with the specified RGB components.

See: resize/4

wxImageList

A wxImageList contains a list of images, which are stored in an unspecified form.

Images can have masks for transparent drawing, and can be made from a variety of sources including bitmaps and icons.

wxImageList is used principally in conjunction with wxTreeCtrl and wxListCtrl classes.

See:

wxTreeCtrl

wxListCtrl

wxWidgets docs: wxImageList

Summary

Types

wxImageList()

Functions

add(This, Icon)

Adds a new image using an icon.

add/3

Adds a new image or images using a bitmap and mask colour.

create(This, Width, Height)

Equivalent to create(This, Width, Height, []).

create/4

Initializes the list.

destroy(This)

Destroys the object

draw(This, Index, Dc, X, Y)

Equivalent to draw(This, Index, Dc, X, Y, []).

draw/6

Draws a specified image onto a device context.

getBitmap(This, Index)

Returns the bitmap corresponding to the given index.

getIcon(This, Index)

Returns the icon corresponding to the given index.

getImageCount(This)

Returns the number of images in the list.

getSize(This, Index)

Retrieves the size of the images in the list.

new()

Default ctor.

new(Width, Height)

Equivalent to new(Width, Height, []).

new(Width, Height, Options)

Constructor specifying the image size, whether image masks should be created, and the initial size of the list.

remove(This, Index)

Removes the image at the given position.

removeAll(This)

Removes all the images in the list.

replace(This, Index, Icon)

Replaces the existing image with the new image.

replace(This, Index, Bitmap, Mask)

Replaces the existing image with the new image.

Types

wxImageList()

-type wxImageList() :: wx:wx_object().

Functions

add(This, Icon)

-spec add(This, Icon) -> integer()
             when This :: wxImageList(), Icon :: wxIcon:wxIcon() | wxBitmap:wxBitmap().

Adds a new image using an icon.

Return: The new zero-based image index.

Remark: The original bitmap or icon is not affected by the add/3 operation, and can be deleted afterwards. If the bitmap is wider than the images in the list, then the bitmap will automatically be split into smaller images, each matching the dimensions of the image list. This does not apply when adding icons.

Only for:wxmsw,wxosx

add/3

-spec add(This, Bitmap, Mask) -> integer()
             when This :: wxImageList(), Bitmap :: wxBitmap:wxBitmap(), Mask :: wxBitmap:wxBitmap();
         (This, Bitmap, MaskColour) -> integer()
             when This :: wxImageList(), Bitmap :: wxBitmap:wxBitmap(), MaskColour :: wx:wx_colour().

Adds a new image or images using a bitmap and mask colour.

Return: The new zero-based image index.

Remark: The original bitmap or icon is not affected by the add/3 operation, and can be deleted afterwards. If the bitmap is wider than the images in the list, then the bitmap will automatically be split into smaller images, each matching the dimensions of the image list. This does not apply when adding icons.

create(This, Width, Height)

-spec create(This, Width, Height) -> boolean()
                when This :: wxImageList(), Width :: integer(), Height :: integer().

Equivalent to create(This, Width, Height, []).

create/4

-spec create(This, Width, Height, [Option]) -> boolean()
                when
                    This :: wxImageList(),
                    Width :: integer(),
                    Height :: integer(),
                    Option :: {mask, boolean()} | {initialCount, integer()}.

Initializes the list.

See new/3 for details.

destroy(This)

-spec destroy(This :: wxImageList()) -> ok.

Destroys the object

draw(This, Index, Dc, X, Y)

-spec draw(This, Index, Dc, X, Y) -> boolean()
              when
                  This :: wxImageList(),
                  Index :: integer(),
                  Dc :: wxDC:wxDC(),
                  X :: integer(),
                  Y :: integer().

Equivalent to draw(This, Index, Dc, X, Y, []).

draw/6

-spec draw(This, Index, Dc, X, Y, [Option]) -> boolean()
              when
                  This :: wxImageList(),
                  Index :: integer(),
                  Dc :: wxDC:wxDC(),
                  X :: integer(),
                  Y :: integer(),
                  Option :: {flags, integer()} | {solidBackground, boolean()}.

Draws a specified image onto a device context.

getBitmap(This, Index)

-spec getBitmap(This, Index) -> wxBitmap:wxBitmap() when This :: wxImageList(), Index :: integer().

Returns the bitmap corresponding to the given index.

getIcon(This, Index)

-spec getIcon(This, Index) -> wxIcon:wxIcon() when This :: wxImageList(), Index :: integer().

Returns the icon corresponding to the given index.

getImageCount(This)

-spec getImageCount(This) -> integer() when This :: wxImageList().

Returns the number of images in the list.

getSize(This, Index)

-spec getSize(This, Index) -> Result
                 when
                     Result :: {Res :: boolean(), Width :: integer(), Height :: integer()},
                     This :: wxImageList(),
                     Index :: integer().

Retrieves the size of the images in the list.

Currently, the index parameter is ignored as all images in the list have the same size.

Return: true if the function succeeded, false if it failed (for example, if the image list was not yet initialized).

new()

-spec new() -> wxImageList().

Default ctor.

new(Width, Height)

-spec new(Width, Height) -> wxImageList() when Width :: integer(), Height :: integer().

Equivalent to new(Width, Height, []).

new(Width, Height, Options)

-spec new(Width, Height, [Option]) -> wxImageList()
             when
                 Width :: integer(),
                 Height :: integer(),
                 Option :: {mask, boolean()} | {initialCount, integer()}.

Constructor specifying the image size, whether image masks should be created, and the initial size of the list.

See: create/4

remove(This, Index)

-spec remove(This, Index) -> boolean() when This :: wxImageList(), Index :: integer().

Removes the image at the given position.

removeAll(This)

-spec removeAll(This) -> boolean() when This :: wxImageList().

Removes all the images in the list.

replace(This, Index, Icon)

-spec replace(This, Index, Icon) -> boolean()
                 when
                     This :: wxImageList(),
                     Index :: integer(),
                     Icon :: wxIcon:wxIcon() | wxBitmap:wxBitmap().

Replaces the existing image with the new image.

Return: true if the replacement was successful, false otherwise.

Remark: The original bitmap or icon is not affected by the replace/4 operation, and can be deleted afterwards.

Only for:wxmsw,wxosx

replace(This, Index, Bitmap, Mask)

-spec replace(This, Index, Bitmap, Mask) -> boolean()
                 when
                     This :: wxImageList(),
                     Index :: integer(),
                     Bitmap :: wxBitmap:wxBitmap(),
                     Mask :: wxBitmap:wxBitmap().

Replaces the existing image with the new image.

Windows only.

Return: true if the replacement was successful, false otherwise.

Remark: The original bitmap or icon is not affected by the replace/4 operation, and can be deleted afterwards.

wxInitDialogEvent

A wxInitDialogEvent is sent as a dialog or panel is being initialised.

Handlers for this event can transfer data to the window.

The default handler calls wxWindow:transferDataToWindow/1.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxInitDialogEvent

Events

Use wxEvtHandler:connect/3 with wxInitDialogEventType to subscribe to events of this type.

Summary

Types

wxInitDialog()

wxInitDialogEvent()

wxInitDialogEventType()

Types

wxInitDialog()

-type wxInitDialog() :: #wxInitDialog{type :: wxInitDialogEvent:wxInitDialogEventType()}.

wxInitDialogEvent()

-type wxInitDialogEvent() :: wx:wx_object().

wxInitDialogEventType()

-type wxInitDialogEventType() :: init_dialog.

wxJoystickEvent

This event class contains information about joystick events, particularly events received by windows.

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxJoystickEvent

Events

Use wxEvtHandler:connect/3 with wxJoystickEventType to subscribe to events of this type.

Summary

Types

wxJoystick()

wxJoystickEvent()

wxJoystickEventType()

Functions

buttonDown(This)

Equivalent to buttonDown(This, []).

buttonDown/2

Returns true if the event was a down event from the specified button (or any button).

buttonIsDown(This)

Equivalent to buttonIsDown(This, []).

buttonIsDown/2

Returns true if the specified button (or any button) was in a down state.

buttonUp(This)

Equivalent to buttonUp(This, []).

buttonUp/2

Returns true if the event was an up event from the specified button (or any button).

getButtonChange(This)

Returns the identifier of the button changing state.

getButtonState(This)

Returns the down state of the buttons.

getJoystick(This)

Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2.

getPosition(This)

Returns the x, y position of the joystick event.

getZPosition(This)

Returns the z position of the joystick event.

isButton(This)

Returns true if this was a button up or down event (not 'is any button down?').

isMove(This)

Returns true if this was an x, y move event.

isZMove(This)

Returns true if this was a z move event.

Types

wxJoystick()

-type wxJoystick() ::
          #wxJoystick{type :: wxJoystickEvent:wxJoystickEventType(),
                      pos :: {X :: integer(), Y :: integer()},
                      zPosition :: integer(),
                      buttonChange :: integer(),
                      buttonState :: integer(),
                      joyStick :: integer()}.

wxJoystickEvent()

-type wxJoystickEvent() :: wx:wx_object().

wxJoystickEventType()

-type wxJoystickEventType() :: joy_button_down | joy_button_up | joy_move | joy_zmove.

Functions

buttonDown(This)

-spec buttonDown(This) -> boolean() when This :: wxJoystickEvent().

Equivalent to buttonDown(This, []).

buttonDown/2

-spec buttonDown(This, [Option]) -> boolean() when This :: wxJoystickEvent(), Option :: {but, integer()}.

Returns true if the event was a down event from the specified button (or any button).

buttonIsDown(This)

-spec buttonIsDown(This) -> boolean() when This :: wxJoystickEvent().

Equivalent to buttonIsDown(This, []).

buttonIsDown/2

-spec buttonIsDown(This, [Option]) -> boolean()
                      when This :: wxJoystickEvent(), Option :: {but, integer()}.

Returns true if the specified button (or any button) was in a down state.

buttonUp(This)

-spec buttonUp(This) -> boolean() when This :: wxJoystickEvent().

Equivalent to buttonUp(This, []).

buttonUp/2

-spec buttonUp(This, [Option]) -> boolean() when This :: wxJoystickEvent(), Option :: {but, integer()}.

Returns true if the event was an up event from the specified button (or any button).

getButtonChange(This)

-spec getButtonChange(This) -> integer() when This :: wxJoystickEvent().

Returns the identifier of the button changing state.

The return value is where n is the index of the button changing state, which can also be retrieved using GetButtonOrdinal() (not implemented in wx).

Note that for n equal to 1, 2, 3 or 4 there are predefined wxJOY_BUTTONn constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four.

getButtonState(This)

-spec getButtonState(This) -> integer() when This :: wxJoystickEvent().

Returns the down state of the buttons.

This is a wxJOY_BUTTONn identifier, where n is one of 1, 2, 3, 4.

getJoystick(This)

-spec getJoystick(This) -> integer() when This :: wxJoystickEvent().

Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxJoystickEvent().

Returns the x, y position of the joystick event.

These coordinates are valid for all the events except wxEVT_JOY_ZMOVE.

getZPosition(This)

-spec getZPosition(This) -> integer() when This :: wxJoystickEvent().

Returns the z position of the joystick event.

This method can only be used for wxEVT_JOY_ZMOVE events.

isButton(This)

-spec isButton(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was a button up or down event (not 'is any button down?').

isMove(This)

-spec isMove(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was an x, y move event.

isZMove(This)

-spec isZMove(This) -> boolean() when This :: wxJoystickEvent().

Returns true if this was a z move event.

wxKeyEvent

This event class contains information about key press and release events.

The main information carried by this event is the key being pressed or released. It can be accessed using either getKeyCode/1 function or getUnicodeKey/1. For the printable characters, the latter should be used as it works for any keys, including non-Latin-1 characters that can be entered when using national keyboard layouts. getKeyCode/1 should be used to handle special characters (such as cursor arrows keys or HOME or INS and so on) which correspond to ?wxKeyCode enum elements above the WXK_START constant. While getKeyCode/1 also returns the character code for Latin-1 keys for compatibility, it doesn't work for Unicode characters in general and will return WXK_NONE for any non-Latin-1 ones. For this reason, it's recommended to always use getUnicodeKey/1 and only fall back to getKeyCode/1 if getUnicodeKey/1 returned WXK_NONE meaning that the event corresponds to a non-printable special keys.

While both of these functions can be used with the events of wxEVT_KEY_DOWN, wxEVT_KEY_UP and wxEVT_CHAR types, the values returned by them are different for the first two events and the last one. For the latter, the key returned corresponds to the character that would appear in e.g. a text zone if the user pressed the key in it. As such, its value depends on the current state of the Shift key and, for the letters, on the state of Caps Lock modifier. For example, if A key is pressed without Shift being held down, wxKeyEvent of type wxEVT_CHAR generated for this key press will return (from either getKeyCode/1 or getUnicodeKey/1 as their meanings coincide for ASCII characters) key code of 97 corresponding the ASCII value of a. And if the same key is pressed but with Shift being held (or Caps Lock being active), then the key could would be 65, i.e. ASCII value of capital A.

However for the key down and up events the returned key code will instead be A independently of the state of the modifier keys i.e. it depends only on physical key being pressed and is not translated to its logical representation using the current keyboard state. Such untranslated key codes are defined as follows:

For the letters they correspond to the upper case value of the letter.

For the other alphanumeric keys (e.g. 7 or +), the untranslated key code corresponds to the character produced by the key when it is pressed without Shift. E.g. in standard US keyboard layout the untranslated key code for the key =/+ in the upper right corner of the keyboard is 61 which is the ASCII value of =.

For the rest of the keys (i.e. special non-printable keys) it is the same as the normal key code as no translation is used anyhow.

Notice that the first rule applies to all Unicode letters, not just the usual Latin-1 ones. However for non-Latin-1 letters only getUnicodeKey/1 can be used to retrieve the key code as getKeyCode/1 just returns WXK_NONE in this case.

To summarize: you should handle wxEVT_CHAR if you need the translated key and wxEVT_KEY_DOWN if you only need the value of the key itself, independent of the current keyboard state.

Note: Not all key down events may be generated by the user. As an example, wxEVT_KEY_DOWN with = key code can be generated using the standard US keyboard layout but not using the German one because the = key corresponds to Shift-0 key combination in this layout and the key code for it is 0, not =. Because of this you should avoid requiring your users to type key events that might be impossible to enter on their keyboard.

Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl-A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of [, \, ], ^ and _ keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values WXK_CONTROL_A

WXK_CONTROL_Z can be used instead of the non-descriptive constant values 1-26.

Finally, modifier keys only generate key events but no char events at all. The modifiers keys are WXK_SHIFT, WXK_CONTROL, WXK_ALT and various WXK_WINDOWS_XXX from ?wxKeyCode enum.

Modifier keys events are special in one additional aspect: usually the keyboard state associated with a key press is well defined, e.g. shiftDown/1 returns true only if the Shift key was held pressed when the key that generated this event itself was pressed. There is an ambiguity for the key press events for Shift key itself however. By convention, it is considered to be already pressed when it is pressed and already released when it is released. In other words, wxEVT_KEY_DOWN event for the Shift key itself will have wxMOD_SHIFT in getModifiers/1 and shiftDown/1 will return true while the wxEVT_KEY_UP event for Shift itself will not have wxMOD_SHIFT in its modifiers and shiftDown/1 will return false.

Tip: You may discover the key codes and modifiers generated by all the keys on your system interactively by running the page_samples_keyboard wxWidgets sample and pressing some keys in it.

Note: If a key down (EVT_KEY_DOWN) event is caught and the event handler does not call event.Skip() then the corresponding char event (EVT_CHAR) will not happen. This is by design and enables the programs that handle both types of events to avoid processing the same key twice. As a consequence, if you do not want to suppress the wxEVT_CHAR events for the keys you handle, always call event.Skip() in your wxEVT_KEY_DOWN handler. Not doing may also prevent accelerators defined using this key from working.

Note: If a key is maintained in a pressed state, you will typically get a lot of (automatically generated) key down events but only one key up one at the end when the key is released so it is wrong to assume that there is one up event corresponding to each down one.

Note: For Windows programmers: The key and char events in wxWidgets are similar to but slightly different from Windows WM_KEYDOWN and WM_CHAR events. In particular, Alt-x combination will generate a char event in wxWidgets (unless it is used as an accelerator) and almost all keys, including ones without ASCII equivalents, generate char events too.

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxKeyEvent

Events

Use wxEvtHandler:connect/3 with wxKeyEventType to subscribe to events of this type.

Summary

Types

wxKey()

wxKeyEvent()

wxKeyEventType()

Functions

altDown(This)

Returns true if the Alt key is pressed.

cmdDown(This)

Returns true if the key used for command accelerators is pressed.

controlDown(This)

Returns true if the Control key or Apple/Command key under macOS is pressed.

getKeyCode(This)

Returns the key code of the key that generated this event.

getModifiers(This)

Return the bit mask of all pressed modifier keys.

getPosition(This)

Obtains the position (in client coordinates) at which the key was pressed.

getRawKeyCode(This)

Returns the raw key code for this event.

getRawKeyFlags(This)

Returns the low level key flags for this event.

getUnicodeKey(This)

Returns the Unicode character corresponding to this key event.

getX(This)

Returns the X position (in client coordinates) of the event.

getY(This)

Returns the Y position (in client coordinates) of the event.

hasModifiers(This)

Returns true if Control or Alt are pressed.

metaDown(This)

Returns true if the Meta/Windows/Apple key is pressed.

shiftDown(This)

Returns true if the Shift key is pressed.

Types

wxKey()

-type wxKey() ::
          #wxKey{type :: wxKeyEvent:wxKeyEventType(),
                 x :: integer(),
                 y :: integer(),
                 keyCode :: integer(),
                 controlDown :: boolean(),
                 shiftDown :: boolean(),
                 altDown :: boolean(),
                 metaDown :: boolean(),
                 uniChar :: integer(),
                 rawCode :: integer(),
                 rawFlags :: integer()}.

wxKeyEvent()

-type wxKeyEvent() :: wx:wx_object().

wxKeyEventType()

-type wxKeyEventType() :: char | char_hook | key_down | key_up.

Functions

altDown(This)

-spec altDown(This) -> boolean() when This :: wxKeyEvent().

Returns true if the Alt key is pressed.

Notice that getModifiers/1 should usually be used instead of this one.

cmdDown(This)

-spec cmdDown(This) -> boolean() when This :: wxKeyEvent().

Returns true if the key used for command accelerators is pressed.

Same as controlDown/1. Deprecated.

Notice that getModifiers/1 should usually be used instead of this one.

controlDown(This)

-spec controlDown(This) -> boolean() when This :: wxKeyEvent().

Returns true if the Control key or Apple/Command key under macOS is pressed.

This function doesn't distinguish between right and left control keys.

Notice that getModifiers/1 should usually be used instead of this one.

getKeyCode(This)

-spec getKeyCode(This) -> integer() when This :: wxKeyEvent().

Returns the key code of the key that generated this event.

ASCII symbols return normal ASCII values, while events from special keys such as "left cursor arrow" (WXK_LEFT) return values outside of the ASCII range. See ?wxKeyCode for a full list of the virtual key codes.

Note that this method returns a meaningful value only for special non-alphanumeric keys or if the user entered a Latin-1 character (this includes ASCII and the accented letters found in Western European languages but not letters of other alphabets such as e.g. Cyrillic). Otherwise it simply method returns WXK_NONE and getUnicodeKey/1 should be used to obtain the corresponding Unicode character.

Using getUnicodeKey/1 is in general the right thing to do if you are interested in the characters typed by the user, getKeyCode/1 should be only used for special keys (for which getUnicodeKey/1 returns WXK_NONE). To handle both kinds of keys you might write:

getModifiers(This)

-spec getModifiers(This) -> integer() when This :: wxKeyEvent().

Return the bit mask of all pressed modifier keys.

The return value is a combination of wxMOD_ALT, wxMOD_CONTROL, wxMOD_SHIFT and wxMOD_META bit masks. Additionally, wxMOD_NONE is defined as 0, i.e. corresponds to no modifiers (see HasAnyModifiers() (not implemented in wx)) and wxMOD_CMD is either wxMOD_CONTROL (MSW and Unix) or wxMOD_META (Mac), see cmdDown/1. See ?wxKeyModifier for the full list of modifiers.

Notice that this function is easier to use correctly than, for example, controlDown/1 because when using the latter you also have to remember to test that none of the other modifiers is pressed:

and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where AltGr key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write:

with this function.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxKeyEvent().

Obtains the position (in client coordinates) at which the key was pressed.

Notice that under most platforms this position is simply the current mouse pointer position and has no special relationship to the key event itself.

x and y may be NULL if the corresponding coordinate is not needed.

getRawKeyCode(This)

-spec getRawKeyCode(This) -> integer() when This :: wxKeyEvent().

Returns the raw key code for this event.

The flags are platform-dependent and should only be used if the functionality provided by other wxKeyEvent methods is insufficient.

Under MSW, the raw key code is the value of wParam parameter of the corresponding message.

Under GTK, the raw key code is the keyval field of the corresponding GDK event.

Under macOS, the raw key code is the keyCode field of the corresponding NSEvent.

Note: Currently the raw key codes are not supported by all ports, use #ifdef wxHAS_RAW_KEY_CODES to determine if this feature is available.

getRawKeyFlags(This)

-spec getRawKeyFlags(This) -> integer() when This :: wxKeyEvent().

Returns the low level key flags for this event.

The flags are platform-dependent and should only be used if the functionality provided by other wxKeyEvent methods is insufficient.

Under MSW, the raw flags are just the value of lParam parameter of the corresponding message.

Under GTK, the raw flags contain the hardware_keycode field of the corresponding GDK event.

Under macOS, the raw flags contain the modifiers state.

Note: Currently the raw key flags are not supported by all ports, use #ifdef wxHAS_RAW_KEY_CODES to determine if this feature is available.

getUnicodeKey(This)

-spec getUnicodeKey(This) -> integer() when This :: wxKeyEvent().

Returns the Unicode character corresponding to this key event.

If the key pressed doesn't have any character value (e.g. a cursor key) this method will return WXK_NONE. In this case you should use getKeyCode/1 to retrieve the value of the key.

This function is only available in Unicode build, i.e. when wxUSE_UNICODE is 1.

getX(This)

-spec getX(This) -> integer() when This :: wxKeyEvent().

Returns the X position (in client coordinates) of the event.

See: getPosition/1

getY(This)

-spec getY(This) -> integer() when This :: wxKeyEvent().

Returns the Y position (in client coordinates) of the event.

See: getPosition/1

hasModifiers(This)

-spec hasModifiers(This) -> boolean() when This :: wxKeyEvent().

Returns true if Control or Alt are pressed.

Checks if Control, Alt or, under macOS only, Command key are pressed (notice that the real Control key is still taken into account under OS X too).

This method returns false if only Shift is pressed for compatibility reasons and also because pressing Shift usually doesn't change the interpretation of key events, see HasAnyModifiers() (not implemented in wx) if you want to take Shift into account as well.

metaDown(This)

-spec metaDown(This) -> boolean() when This :: wxKeyEvent().

Returns true if the Meta/Windows/Apple key is pressed.

This function tests the state of the key traditionally called Meta under Unix systems, Windows keys under MSW Notice that getModifiers/1 should usually be used instead of this one.

See: cmdDown/1

shiftDown(This)

-spec shiftDown(This) -> boolean() when This :: wxKeyEvent().

Returns true if the Shift key is pressed.

This function doesn't distinguish between right and left shift keys.

Notice that getModifiers/1 should usually be used instead of this one.

wxLayoutAlgorithm

wxLayoutAlgorithm implements layout of subwindows in MDI or SDI frames.

It sends a wxCalculateLayoutEvent (not implemented in wx) event to children of the frame, asking them for information about their size. For MDI parent frames, the algorithm allocates the remaining space to the MDI client window (which contains the MDI child frames).

For SDI (normal) frames, a 'main' window is specified as taking up the remaining space.

Because the event system is used, this technique can be applied to any windows, which are not necessarily 'aware' of the layout classes (no virtual functions in wxWindow refer to wxLayoutAlgorithm or its events). However, you may wish to use wxSashLayoutWindow for your subwindows since this class provides handlers for the required events, and accessors to specify the desired size of the window. The sash behaviour in the base class can be used, optionally, to make the windows user-resizable.

wxLayoutAlgorithm is typically used in IDE (integrated development environment) applications, where there are several resizable windows in addition to the MDI client window, or other primary editing window. Resizable windows might include toolbars, a project window, and a window for displaying error and warning messages.

When a window receives an OnCalculateLayout event, it should call SetRect in the given event object, to be the old supplied rectangle minus whatever space the window takes up. It should also set its own size accordingly. wxSashLayoutWindow::OnCalculateLayout (not implemented in wx) generates an OnQueryLayoutInfo event which it sends to itself to determine the orientation, alignment and size of the window, which it gets from internal member variables set by the application.

The algorithm works by starting off with a rectangle equal to the whole frame client area. It iterates through the frame children, generating wxLayoutAlgorithm::OnCalculateLayout events which subtract the window size and return the remaining rectangle for the next window to process. It is assumed (by wxSashLayoutWindow::OnCalculateLayout (not implemented in wx)) that a window stretches the full dimension of the frame client, according to the orientation it specifies. For example, a horizontal window will stretch the full width of the remaining portion of the frame client area. In the other orientation, the window will be fixed to whatever size was specified by wxLayoutAlgorithm::OnQueryLayoutInfo. An alignment setting will make the window 'stick' to the left, top, right or bottom of the remaining client area. This scheme implies that order of window creation is important. Say you wish to have an extra toolbar at the top of the frame, a project window to the left of the MDI client window, and an output window above the status bar. You should therefore create the windows in this order: toolbar, output window, project window. This ensures that the toolbar and output window take up space at the top and bottom, and then the remaining height in-between is used for the project window.

wxLayoutAlgorithm is quite independent of the way in which wxLayoutAlgorithm::OnCalculateLayout chooses to interpret a window's size and alignment. Therefore you could implement a different window class with a new wxLayoutAlgorithm::OnCalculateLayout event handler, that has a more sophisticated way of laying out the windows. It might allow specification of whether stretching occurs in the specified orientation, for example, rather than always assuming stretching. (This could, and probably should, be added to the existing implementation).

Note: wxLayoutAlgorithm has nothing to do with wxLayoutConstraints (not implemented in wx). It is an alternative way of specifying layouts for which the normal constraint system is unsuitable.

See:

wxSashEvent

wxSashLayoutWindow

Overview events

wxWidgets docs: wxLayoutAlgorithm

Summary

Types

wxLayoutAlgorithm()

Functions

destroy(This)

Destroys the object

layoutFrame(This, Frame)

Equivalent to layoutFrame(This, Frame, []).

layoutFrame/3

Lays out the children of a normal frame.

layoutMDIFrame(This, Frame)

Equivalent to layoutMDIFrame(This, Frame, []).

layoutMDIFrame/3

Lays out the children of an MDI parent frame.

layoutWindow(This, Parent)

Equivalent to layoutWindow(This, Parent, []).

layoutWindow/3

Lays out the children of a normal frame or other window.

new()

Default constructor.

Types

wxLayoutAlgorithm()

-type wxLayoutAlgorithm() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxLayoutAlgorithm()) -> ok.

Destroys the object

layoutFrame(This, Frame)

-spec layoutFrame(This, Frame) -> boolean() when This :: wxLayoutAlgorithm(), Frame :: wxFrame:wxFrame().

Equivalent to layoutFrame(This, Frame, []).

layoutFrame/3

-spec layoutFrame(This, Frame, [Option]) -> boolean()
                     when
                         This :: wxLayoutAlgorithm(),
                         Frame :: wxFrame:wxFrame(),
                         Option :: {mainWindow, wxWindow:wxWindow()}.

Lays out the children of a normal frame.

mainWindow is set to occupy the remaining space. This function simply calls layoutWindow/3.

layoutMDIFrame(This, Frame)

-spec layoutMDIFrame(This, Frame) -> boolean()
                        when This :: wxLayoutAlgorithm(), Frame :: wxMDIParentFrame:wxMDIParentFrame().

Equivalent to layoutMDIFrame(This, Frame, []).

layoutMDIFrame/3

-spec layoutMDIFrame(This, Frame, [Option]) -> boolean()
                        when
                            This :: wxLayoutAlgorithm(),
                            Frame :: wxMDIParentFrame:wxMDIParentFrame(),
                            Option ::
                                {rect, {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}}.

Lays out the children of an MDI parent frame.

If rect is non-NULL, the given rectangle will be used as a starting point instead of the frame's client area. The MDI client window is set to occupy the remaining space.

layoutWindow(This, Parent)

-spec layoutWindow(This, Parent) -> boolean()
                      when This :: wxLayoutAlgorithm(), Parent :: wxWindow:wxWindow().

Equivalent to layoutWindow(This, Parent, []).

layoutWindow/3

-spec layoutWindow(This, Parent, [Option]) -> boolean()
                      when
                          This :: wxLayoutAlgorithm(),
                          Parent :: wxWindow:wxWindow(),
                          Option :: {mainWindow, wxWindow:wxWindow()}.

Lays out the children of a normal frame or other window.

mainWindow is set to occupy the remaining space. If this is not specified, then the last window that responds to a calculate layout event in query mode will get the remaining space (that is, a non-query OnCalculateLayout event will not be sent to this window and the window will be set to the remaining size).

new()

-spec new() -> wxLayoutAlgorithm().

Default constructor.

wxListBox

A listbox is used to select one or more of a list of strings.

The strings are displayed in a scrolling box, with the selected string(s) marked in reverse video. A listbox can be single selection (if an item is selected, the previous selection is removed) or multiple selection (clicking an item toggles the item on or off independently of other selections).

List box elements are numbered from zero and while the maximal number of elements is unlimited, it is usually better to use a virtual control, not requiring to add all the items to it at once, such as wxDataViewCtrl (not implemented in wx) or wxListCtrl with wxLC_VIRTUAL style, once more than a few hundreds items need to be displayed because this control is not optimized, neither from performance nor from user interface point of view, for large number of items.

Notice that the list box doesn't support control characters other than TAB.

Styles

This class supports the following styles:

wxLB_SINGLE: Single-selection list.

wxLB_MULTIPLE: Multiple-selection list: the user can toggle multiple items on and off. This is the same as wxLB_EXTENDED in wxGTK2 port.

wxLB_EXTENDED: Extended-selection list: the user can extend the selection by using SHIFT or CTRL keys together with the cursor movement keys or the mouse.

wxLB_HSCROLL: Create horizontal scrollbar if contents are too wide (Windows only).

wxLB_ALWAYS_SB: Always show a vertical scrollbar.

wxLB_NEEDED_SB: Only create a vertical scrollbar if needed.

wxLB_NO_SB: Don't create vertical scrollbar (wxMSW and wxGTK only).

wxLB_SORT: The listbox contents are sorted in alphabetical order. Note that wxLB_SINGLE, wxLB_MULTIPLE and wxLB_EXTENDED styles are mutually exclusive and you can specify at most one of them (single selection is the default). See also overview_windowstyles.

See:

wxChoice

wxComboBox

wxListCtrl

wxCommandEvent

This class is derived, and can use functions, from:

wxControlWithItems

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxListBox

Events

Event types emitted from this class:

command_listbox_selected

command_listbox_doubleclicked

Summary

Types

wxListBox()

Functions

create(This, Parent, Id, Pos, Size, Choices)

Equivalent to create(This, Parent, Id, Pos, Size, Choices, []).

create/7

deselect(This, N)

Deselects an item in the list box.

destroy(This)

Destroys the object

getSelections(This)

Fill an array of ints with the positions of the currently selected items.

hitTest(This, Point)

Returns the item located at point, or wxNOT\_FOUND if there is no item located at point.

hitTest(This, X, Y)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

insertItems(This, Items, Pos)

Insert the given number of strings before the specified position.

isSelected(This, N)

Determines whether an item is selected.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a list box.

set(This, Items)

Replaces the current control contents with the given items.

setFirstItem/2

Set the specified item to be the first visible item.

Types

wxListBox()

-type wxListBox() :: wx:wx_object().

Functions

create(This, Parent, Id, Pos, Size, Choices)

-spec create(This, Parent, Id, Pos, Size, Choices) -> boolean()
                when
                    This :: wxListBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()].

Equivalent to create(This, Parent, Id, Pos, Size, Choices, []).

create/7

-spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean()
                when
                    This :: wxListBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()],
                    Option :: {style, integer()} | {validator, wx:wx_object()}.

deselect(This, N)

-spec deselect(This, N) -> ok when This :: wxListBox(), N :: integer().

Deselects an item in the list box.

Remark: This applies to multiple selection listboxes only.

destroy(This)

-spec destroy(This :: wxListBox()) -> ok.

Destroys the object

getSelections(This)

-spec getSelections(This) -> Result
                       when Result :: {Res :: integer(), Selections :: [integer()]}, This :: wxListBox().

Fill an array of ints with the positions of the currently selected items.

Return: The number of selections.

Remark: Use this with a multiple selection listbox.

See:

wxControlWithItems:getSelection/1

wxControlWithItems:getStringSelection/1

wxControlWithItems:setSelection/2

hitTest(This, Point)

-spec hitTest(This, Point) -> integer()
                 when This :: wxListBox(), Point :: {X :: integer(), Y :: integer()}.

Returns the item located at point, or wxNOT\_FOUND if there is no item located at point.

It is currently implemented for wxMSW, wxMac and wxGTK2 ports.

Return: Item located at point, or wxNOT_FOUND if unimplemented or the item does not exist.

Since: 2.7.0

hitTest(This, X, Y)

-spec hitTest(This, X, Y) -> integer() when This :: wxListBox(), X :: integer(), Y :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

insertItems(This, Items, Pos)

-spec insertItems(This, Items, Pos) -> ok
                     when This :: wxListBox(), Items :: [unicode:chardata()], Pos :: integer().

Insert the given number of strings before the specified position.

isSelected(This, N)

-spec isSelected(This, N) -> boolean() when This :: wxListBox(), N :: integer().

Determines whether an item is selected.

Return: true if the given item is selected, false otherwise.

new()

-spec new() -> wxListBox().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxListBox() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxListBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {choices, [unicode:chardata()]} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a list box.

See the other new/3 constructor; the only difference is that this overload takes a wxArrayString (not implemented in wx) instead of a pointer to an array of wxString (not implemented in wx).

set(This, Items)

-spec set(This, Items) -> ok when This :: wxListBox(), Items :: [unicode:chardata()].

Replaces the current control contents with the given items.

Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.

setFirstItem/2

-spec setFirstItem(This, N) -> ok when This :: wxListBox(), N :: integer();
                  (This, String) -> ok when This :: wxListBox(), String :: unicode:chardata().

Set the specified item to be the first visible item.

wxListCtrl

A list control presents lists in a number of formats: list view, report view, icon view and small icon view.

In any case, elements are numbered from zero. For all these modes, the items are stored in the control and must be added to it using insertItem/4 method.

A special case of report view quite different from the other modes of the list control is a virtual control in which the items data (including text, images and attributes) is managed by the main program and is requested by the control itself only when needed which allows having controls with millions of items without consuming much memory. To use virtual list control you must use setItemCount/2 first and override at least wxListCtrl::OnGetItemText (not implemented in wx) (and optionally wxListCtrl::OnGetItemImage (not implemented in wx) or wxListCtrl::OnGetItemColumnImage (not implemented in wx) and wxListCtrl::OnGetItemAttr (not implemented in wx)) to return the information about the items when the control requests it.

Virtual list control can be used as a normal one except that no operations which can take time proportional to the number of items in the control happen - this is required to allow having a practically infinite number of items. For example, in a multiple selection virtual list control, the selections won't be sent when many items are selected at once because this could mean iterating over all the items.

Using many of wxListCtrl features is shown in the corresponding sample.

To intercept events from a list control, use the event table macros described in wxListEvent.

wxMac Note: Starting with wxWidgets 2.8, wxListCtrl uses a native implementation for report mode, and uses a generic implementation for other modes. You can use the generic implementation for report mode as well by setting the mac.listctrl.always_use_generic system option (see wxSystemOptions) to 1.

Styles

This class supports the following styles:

wxLC_LIST: Multicolumn list view, with optional small icons. Columns are computed automatically, i.e. you don't set columns as in wxLC_REPORT. In other words, the list wraps, unlike a wxListBox.

wxLC_REPORT: Single or multicolumn report view, with optional header.

wxLC_VIRTUAL: The application provides items text on demand. May only be used with wxLC_REPORT.

wxLC_ICON: Large icon view, with optional labels.

wxLC_SMALL_ICON: Small icon view, with optional labels.

wxLC_ALIGN_TOP: Icons align to the top. Win32 default, Win32 only.

wxLC_ALIGN_LEFT: Icons align to the left.

wxLC_AUTOARRANGE: Icons arrange themselves. Win32 only.

wxLC_EDIT_LABELS: Labels are editable: the application will be notified when editing starts.

wxLC_NO_HEADER: No header in report mode.

wxLC_SINGLE_SEL: Single selection (default is multiple).

wxLC_SORT_ASCENDING: Sort in ascending order. (You must still supply a comparison callback in sortItems/2.)

wxLC_SORT_DESCENDING: Sort in descending order. (You must still supply a comparison callback in sortItems/2.)

wxLC_HRULES: Draws light horizontal rules between rows in report mode.

wxLC_VRULES: Draws light vertical rules between columns in report mode.

See:

Overview listctrl

wxListView

wxListBox

wxTreeCtrl

wxImageList

wxListEvent

wxListItem

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxListCtrl

Events

Event types emitted from this class:

command_list_begin_drag

command_list_begin_rdrag

command_list_begin_label_edit

command_list_end_label_edit

command_list_delete_item

command_list_delete_all_items

command_list_item_selected

command_list_item_deselected

command_list_item_activated

command_list_item_focused

command_list_item_middle_click

command_list_item_right_click

command_list_key_down

command_list_insert_item

command_list_col_click

command_list_col_right_click

command_list_col_begin_drag

command_list_col_dragging

command_list_col_end_drag

command_list_cache_hint

Summary

Types

wxListCtrl()

Functions

arrange(This)

Equivalent to arrange(This, []).

arrange/2

Arranges the items in icon or small icon view.

assignImageList(This, ImageList, Which)

Sets the image list associated with the control and takes ownership of it (i.e.

clearAll(This)

Deletes all items and all columns.

create(This, Parent)

create/3

deleteAllItems(This)

Deletes all items in the list control.

deleteColumn(This, Col)

Deletes a column.

deleteItem(This, Item)

Deletes the specified item.

destroy(This)

Destroys the object

editLabel(This, Item)

Starts editing the label of the given item.

ensureVisible(This, Item)

Ensures this item is visible.

findItem(This, Start, Str)

Equivalent to findItem(This, Start, Str, []).

findItem/4

Find an item nearest this position in the specified direction, starting from start or the beginning if start is -1.

getColumn(This, Col, Item)

Gets information about this column.

getColumnCount(This)

Returns the number of columns.

getColumnWidth(This, Col)

Gets the column width (report view only).

getCountPerPage(This)

Gets the number of items that can fit vertically in the visible area of the list control (list or report view) or the total number of items in the list control (icon or small icon view).

getEditControl(This)

Returns the edit control being currently used to edit a label.

getImageList(This, Which)

Returns the specified image list.

getItem(This, Info)

Gets information about the item.

getItemBackgroundColour(This, Item)

Returns the colour for this item.

getItemCount(This)

Returns the number of items in the list control.

getItemData(This, Item)

Gets the application-defined data associated with this item.

getItemFont(This, Item)

Returns the item's font.

getItemPosition(This, Item)

Returns the position of the item, in icon or small icon view.

getItemRect(This, Item)

Equivalent to getItemRect(This, Item, []).

getItemRect/3

Returns the rectangle representing the item's size and position, in physical coordinates.

getItemSpacing(This)

Retrieves the spacing between icons in pixels: horizontal spacing is returned as x component of the {Width,Height} object and the vertical spacing as its y component.

getItemState(This, Item, StateMask)

Gets the item state.

getItemText(This, Item)

Equivalent to getItemText(This, Item, []).

getItemText/3

Gets the item text for this item.

getItemTextColour(This, Item)

Returns the colour for this item.

getNextItem(This, Item)

Equivalent to getNextItem(This, Item, []).

getNextItem/3

Searches for an item with the given geometry or state, starting from item but excluding the item itself.

getSelectedItemCount(This)

Returns the number of selected items in the list control.

getTextColour(This)

Gets the text colour of the list control.

getTopItem(This)

Gets the index of the topmost visible item when in list or report view.

getViewRect(This)

Returns the rectangle taken by all items in the control.

hitTest(This, Point)

Determines which item (if any) is at the specified point, giving details in flags.

insertColumn/3

For report view mode (only), inserts a column.

insertColumn/4

For report view mode (only), inserts a column.

insertItem(This, Info)

Inserts an item, returning the index of the new item if successful, -1 otherwise.

insertItem/3

Insert a string item.

insertItem(This, Index, Label, ImageIndex)

Insert an image/string item.

new()

new(Parent)

new/2

refreshItem(This, Item)

Redraws the given item.

refreshItems(This, ItemFrom, ItemTo)

Redraws the items between itemFrom and itemTo.

scrollList(This, Dx, Dy)

Scrolls the list control.

setBackgroundColour(This, Col)

Sets the background colour.

setColumn(This, Col, Item)

Sets information about this column.

setColumnWidth(This, Col, Width)

Sets the column width.

setImageList(This, ImageList, Which)

Sets the image list associated with the control.

setItem(This, Info)

Sets the data of an item.

setItem(This, Index, Column, Label)

Equivalent to setItem(This, Index, Column, Label, []).

setItem/5

Sets an item string field at a particular column.

setItemBackgroundColour(This, Item, Col)

Sets the background colour for this item.

setItemColumnImage(This, Item, Column, Image)

Sets the image associated with the item.

setItemCount(This, Count)

This method can only be used with virtual list controls.

setItemData(This, Item, Data)

Associates application-defined data with this item.

setItemFont(This, Item, Font)

Sets the item's font.

setItemImage(This, Item, Image)

Equivalent to setItemImage(This, Item, Image, []).

setItemImage/4

Sets the unselected and selected images associated with the item.

setItemPosition(This, Item, Pos)

Sets the position of the item, in icon or small icon view.

setItemState(This, Item, State, StateMask)

Sets the item state.

setItemText(This, Item, Text)

Sets the item text for this item.

setItemTextColour(This, Item, Col)

Sets the colour for this item.

setSingleStyle(This, Style)

Equivalent to setSingleStyle(This, Style, []).

setSingleStyle/3

Adds or removes a single window style.

setTextColour(This, Col)

Sets the text colour of the list control.

setWindowStyleFlag(This, Style)

Sets the whole window style, deleting all items.

sortItems(This, SortCallBack)

Types

wxListCtrl()

-type wxListCtrl() :: wx:wx_object().

Functions

arrange(This)

-spec arrange(This) -> boolean() when This :: wxListCtrl().

Equivalent to arrange(This, []).

arrange/2

-spec arrange(This, [Option]) -> boolean() when This :: wxListCtrl(), Option :: {flag, integer()}.

Arranges the items in icon or small icon view.

This only has effect on Win32. flag is one of:

wxLIST_ALIGN_DEFAULT: Default alignment.

wxLIST_ALIGN_LEFT: Align to the left side of the control.

wxLIST_ALIGN_TOP: Align to the top side of the control.

wxLIST_ALIGN_SNAP_TO_GRID: Snap to grid.

assignImageList(This, ImageList, Which)

-spec assignImageList(This, ImageList, Which) -> ok
                         when
                             This :: wxListCtrl(),
                             ImageList :: wxImageList:wxImageList(),
                             Which :: integer().

Sets the image list associated with the control and takes ownership of it (i.e.

the control will, unlike when using setImageList/3, delete the list when destroyed). which is one of wxIMAGE_LIST_NORMAL, wxIMAGE_LIST_SMALL, wxIMAGE_LIST_STATE (the last is unimplemented).

See: setImageList/3

clearAll(This)

-spec clearAll(This) -> ok when This :: wxListCtrl().

Deletes all items and all columns.

Note: This sends an event of type wxEVT_LIST_DELETE_ALL_ITEMS under all platforms.

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxWindow:wxWindow(), Parent :: wxWindow:wxWindow().

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxWindow:wxWindow(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {winid, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()} |
                        {onGetItemText, function()} |
                        {onGetItemAttr, function()} |
                        {onGetItemColumnImage, function()}.

deleteAllItems(This)

-spec deleteAllItems(This) -> boolean() when This :: wxListCtrl().

Deletes all items in the list control.

This function does not send the wxEVT_LIST_DELETE_ITEM event because deleting many items from the control would be too slow then (unlike deleteItem/2) but it does send the special wxEVT_LIST_DELETE_ALL_ITEMS event if the control was not empty. If it was already empty, nothing is done and no event is sent.

Return: true if the items were successfully deleted or if the control was already empty, false if an error occurred while deleting the items.

deleteColumn(This, Col)

-spec deleteColumn(This, Col) -> boolean() when This :: wxListCtrl(), Col :: integer().

Deletes a column.

deleteItem(This, Item)

-spec deleteItem(This, Item) -> boolean() when This :: wxListCtrl(), Item :: integer().

Deletes the specified item.

This function sends the wxEVT_LIST_DELETE_ITEM event for the item being deleted.

See: deleteAllItems/1

destroy(This)

-spec destroy(This :: wxListCtrl()) -> ok.

Destroys the object

editLabel(This, Item)

-spec editLabel(This, Item) -> wxTextCtrl:wxTextCtrl() when This :: wxListCtrl(), Item :: integer().

Starts editing the label of the given item.

This function generates a EVT_LIST_BEGIN_LABEL_EDIT event which can be vetoed so that no text control will appear for in-place editing.

If the user changed the label (i.e. s/he does not press ESC or leave the text control without changes, a EVT_LIST_END_LABEL_EDIT event will be sent which can be vetoed as well.

ensureVisible(This, Item)

-spec ensureVisible(This, Item) -> boolean() when This :: wxListCtrl(), Item :: integer().

Ensures this item is visible.

findItem(This, Start, Str)

-spec findItem(This, Start, Str) -> integer()
                  when This :: wxListCtrl(), Start :: integer(), Str :: unicode:chardata().

Equivalent to findItem(This, Start, Str, []).

findItem/4

-spec findItem(This, Start, Str, [Option]) -> integer()
                  when
                      This :: wxListCtrl(),
                      Start :: integer(),
                      Str :: unicode:chardata(),
                      Option :: {partial, boolean()};
              (This, Start, Pt, Direction) -> integer()
                  when
                      This :: wxListCtrl(),
                      Start :: integer(),
                      Pt :: {X :: integer(), Y :: integer()},
                      Direction :: integer().

Find an item nearest this position in the specified direction, starting from start or the beginning if start is -1.

Return: The next matching item if any or -1 (wxNOT_FOUND) otherwise.

getColumn(This, Col, Item)

-spec getColumn(This, Col, Item) -> boolean()
                   when This :: wxListCtrl(), Col :: integer(), Item :: wxListItem:wxListItem().

Gets information about this column.

See setItem/5 for more information.

getColumnCount(This)

-spec getColumnCount(This) -> integer() when This :: wxListCtrl().

Returns the number of columns.

getColumnWidth(This, Col)

-spec getColumnWidth(This, Col) -> integer() when This :: wxListCtrl(), Col :: integer().

Gets the column width (report view only).

getCountPerPage(This)

-spec getCountPerPage(This) -> integer() when This :: wxListCtrl().

Gets the number of items that can fit vertically in the visible area of the list control (list or report view) or the total number of items in the list control (icon or small icon view).

getEditControl(This)

-spec getEditControl(This) -> wxTextCtrl:wxTextCtrl() when This :: wxListCtrl().

Returns the edit control being currently used to edit a label.

Returns NULL if no label is being edited.

Note: It is currently only implemented for wxMSW and the generic version, not for the native macOS version.

getImageList(This, Which)

-spec getImageList(This, Which) -> wxImageList:wxImageList()
                      when This :: wxListCtrl(), Which :: integer().

Returns the specified image list.

which may be one of:

wxIMAGE_LIST_NORMAL: The normal (large icon) image list.

wxIMAGE_LIST_SMALL: The small icon image list.

wxIMAGE_LIST_STATE: The user-defined state image list (unimplemented).

getItem(This, Info)

-spec getItem(This, Info) -> boolean() when This :: wxListCtrl(), Info :: wxListItem:wxListItem().

Gets information about the item.

See setItem/5 for more information.

You must call info.SetId() to set the ID of item you're interested in before calling this method, and info.SetMask() with the flags indicating what fields you need to retrieve from info.

getItemBackgroundColour(This, Item)

-spec getItemBackgroundColour(This, Item) -> wx:wx_colour4()
                                 when This :: wxListCtrl(), Item :: integer().

Returns the colour for this item.

If the item has no specific colour, returns an invalid colour (and not the default background control of the control itself).

See: getItemTextColour/2

getItemCount(This)

-spec getItemCount(This) -> integer() when This :: wxListCtrl().

Returns the number of items in the list control.

getItemData(This, Item)

-spec getItemData(This, Item) -> integer() when This :: wxListCtrl(), Item :: integer().

Gets the application-defined data associated with this item.

getItemFont(This, Item)

-spec getItemFont(This, Item) -> wxFont:wxFont() when This :: wxListCtrl(), Item :: integer().

Returns the item's font.

getItemPosition(This, Item)

-spec getItemPosition(This, Item) -> Result
                         when
                             Result :: {Res :: boolean(), Pos :: {X :: integer(), Y :: integer()}},
                             This :: wxListCtrl(),
                             Item :: integer().

Returns the position of the item, in icon or small icon view.

getItemRect(This, Item)

-spec getItemRect(This, Item) -> Result
                     when
                         Result ::
                             {Res :: boolean(),
                              Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}},
                         This :: wxListCtrl(),
                         Item :: integer().

Equivalent to getItemRect(This, Item, []).

getItemRect/3

-spec getItemRect(This, Item, [Option]) -> Result
                     when
                         Result ::
                             {Res :: boolean(),
                              Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}},
                         This :: wxListCtrl(),
                         Item :: integer(),
                         Option :: {code, integer()}.

Returns the rectangle representing the item's size and position, in physical coordinates.

code is one of wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON, wxLIST_RECT_LABEL.

getItemSpacing(This)

-spec getItemSpacing(This) -> {W :: integer(), H :: integer()} when This :: wxListCtrl().

Retrieves the spacing between icons in pixels: horizontal spacing is returned as x component of the {Width,Height} object and the vertical spacing as its y component.

getItemState(This, Item, StateMask)

-spec getItemState(This, Item, StateMask) -> integer()
                      when This :: wxListCtrl(), Item :: integer(), StateMask :: integer().

Gets the item state.

For a list of state flags, see setItem/5. The stateMask indicates which state flags are of interest.

getItemText(This, Item)

-spec getItemText(This, Item) -> unicode:charlist() when This :: wxListCtrl(), Item :: integer().

Equivalent to getItemText(This, Item, []).

getItemText/3

-spec getItemText(This, Item, [Option]) -> unicode:charlist()
                     when This :: wxListCtrl(), Item :: integer(), Option :: {col, integer()}.

Gets the item text for this item.

getItemTextColour(This, Item)

-spec getItemTextColour(This, Item) -> wx:wx_colour4() when This :: wxListCtrl(), Item :: integer().

Returns the colour for this item.

If the item has no specific colour, returns an invalid colour (and not the default foreground control of the control itself as this wouldn't allow distinguishing between items having the same colour as the current control foreground and items with default colour which, hence, have always the same colour as the control).

getNextItem(This, Item)

-spec getNextItem(This, Item) -> integer() when This :: wxListCtrl(), Item :: integer().

Equivalent to getNextItem(This, Item, []).

getNextItem/3

-spec getNextItem(This, Item, [Option]) -> integer()
                     when
                         This :: wxListCtrl(),
                         Item :: integer(),
                         Option :: {geometry, integer()} | {state, integer()}.

Searches for an item with the given geometry or state, starting from item but excluding the item itself.

If item is -1, the first item that matches the specified flags will be returned. Returns the first item with given state following item or -1 if no such item found. This function may be used to find all selected items in the control like this:

geometry can be one of:

wxLIST_NEXT_ABOVE: Searches for an item above the specified item.

wxLIST_NEXT_ALL: Searches for subsequent item by index.

wxLIST_NEXT_BELOW: Searches for an item below the specified item.

wxLIST_NEXT_LEFT: Searches for an item to the left of the specified item.

wxLIST_NEXT_RIGHT: Searches for an item to the right of the specified item.

Note: this parameter is only supported by wxMSW currently and ignored on other platforms.

state can be a bitlist of the following:

wxLIST_STATE_DONTCARE: Don't care what the state is.

wxLIST_STATE_DROPHILITED: The item indicates it is a drop target.

wxLIST_STATE_FOCUSED: The item has the focus.

wxLIST_STATE_SELECTED: The item is selected.

wxLIST_STATE_CUT: The item is selected as part of a cut and paste operation.

getSelectedItemCount(This)

-spec getSelectedItemCount(This) -> integer() when This :: wxListCtrl().

Returns the number of selected items in the list control.

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxListCtrl().

Gets the text colour of the list control.

getTopItem(This)

-spec getTopItem(This) -> integer() when This :: wxListCtrl().

Gets the index of the topmost visible item when in list or report view.

getViewRect(This)

-spec getViewRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                     when This :: wxListCtrl().

Returns the rectangle taken by all items in the control.

In other words, if the controls client size were equal to the size of this rectangle, no scrollbars would be needed and no free space would be left.

Note that this function only works in the icon and small icon views, not in list or report views (this is a limitation of the native Win32 control).

hitTest(This, Point)

-spec hitTest(This, Point) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer(), PtrSubItem :: integer()},
                     This :: wxListCtrl(),
                     Point :: {X :: integer(), Y :: integer()}.

Determines which item (if any) is at the specified point, giving details in flags.

Returns index of the item or wxNOT_FOUND if no item is at the specified point.

flags will be a combination of the following flags:

wxLIST_HITTEST_ABOVE: Above the control's client area.

wxLIST_HITTEST_BELOW: Below the control's client area.

wxLIST_HITTEST_TOLEFT: To the left of the control's client area.

wxLIST_HITTEST_TORIGHT: To the right of the control's client area.

wxLIST_HITTEST_NOWHERE: Inside the control's client area but not over an item.

wxLIST_HITTEST_ONITEMICON: Over an item's icon.

wxLIST_HITTEST_ONITEMLABEL: Over an item's text.

wxLIST_HITTEST_ONITEMSTATEICON: Over the checkbox of an item.

wxLIST_HITTEST_ONITEM: Combination of wxLIST_HITTEST_ONITEMICON, wxLIST_HITTEST_ONITEMLABEL, wxLIST_HITTEST_ONITEMSTATEICON.

If ptrSubItem is not NULL and the wxListCtrl is in the report mode the subitem (or column) number will also be provided. This feature is only available in version 2.7.0 or higher and is currently only implemented under wxMSW and requires at least comctl32.dll of version 4.70 on the host system or the value stored in ptrSubItem will be always -1. To compile this feature into wxWidgets library you need to have access to commctrl.h of version 4.70 that is provided by Microsoft.

insertColumn/3

-spec insertColumn(This, Col, Heading) -> integer()
                      when This :: wxListCtrl(), Col :: integer(), Heading :: unicode:chardata();
                  (This, Col, Info) -> integer()
                      when This :: wxListCtrl(), Col :: integer(), Info :: wxListItem:wxListItem().

For report view mode (only), inserts a column.

For more details, see setItem/5. Also see insertColumn/4 overload for a usually more convenient alternative to this method and the description of how the item width is interpreted by this method.

insertColumn/4

-spec insertColumn(This, Col, Heading, [Option]) -> integer()
                      when
                          This :: wxListCtrl(),
                          Col :: integer(),
                          Heading :: unicode:chardata(),
                          Option :: {format, integer()} | {width, integer()}.

For report view mode (only), inserts a column.

Insert a new column in the list control in report view mode at the given position specifying its most common attributes.

Notice that to set the image for the column you need to use insertColumn/4 overload and specify ?wxLIST_MASK_IMAGE in the item mask.

Return: The index of the inserted column or -1 if adding it failed.

insertItem(This, Info)

-spec insertItem(This, Info) -> integer() when This :: wxListCtrl(), Info :: wxListItem:wxListItem().

Inserts an item, returning the index of the new item if successful, -1 otherwise.

insertItem/3

-spec insertItem(This, Index, ImageIndex) -> integer()
                    when This :: wxListCtrl(), Index :: integer(), ImageIndex :: integer();
                (This, Index, Label) -> integer()
                    when This :: wxListCtrl(), Index :: integer(), Label :: unicode:chardata().

Insert a string item.

insertItem(This, Index, Label, ImageIndex)

-spec insertItem(This, Index, Label, ImageIndex) -> integer()
                    when
                        This :: wxListCtrl(),
                        Index :: integer(),
                        Label :: unicode:chardata(),
                        ImageIndex :: integer().

Insert an image/string item.

new()

-spec new() -> wxListCtrl().

new(Parent)

-spec new(Parent) -> wxListCtrl() when Parent :: wxWindow:wxWindow().

new/2

-spec new(Parent, [Option]) -> wxListCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {winid, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()} |
                     {onGetItemText, function()} |
                     {onGetItemAttr, function()} |
                     {onGetItemColumnImage, function()}.

refreshItem(This, Item)

-spec refreshItem(This, Item) -> ok when This :: wxListCtrl(), Item :: integer().

Redraws the given item.

This is only useful for the virtual list controls as without calling this function the displayed value of the item doesn't change even when the underlying data does change.

See: refreshItems/3

refreshItems(This, ItemFrom, ItemTo)

-spec refreshItems(This, ItemFrom, ItemTo) -> ok
                      when This :: wxListCtrl(), ItemFrom :: integer(), ItemTo :: integer().

Redraws the items between itemFrom and itemTo.

The starting item must be less than or equal to the ending one.

Just as refreshItem/2 this is only useful for virtual list controls.

scrollList(This, Dx, Dy)

-spec scrollList(This, Dx, Dy) -> boolean() when This :: wxListCtrl(), Dx :: integer(), Dy :: integer().

Scrolls the list control.

If in icon, small icon or report view mode, dx specifies the number of pixels to scroll. If in list view mode, dx specifies the number of columns to scroll. dy always specifies the number of pixels to scroll vertically.

Note: This method is currently only implemented in the Windows version.

setBackgroundColour(This, Col)

-spec setBackgroundColour(This, Col) -> boolean() when This :: wxListCtrl(), Col :: wx:wx_colour().

Sets the background colour.

Note that the wxWindow:getBackgroundColour/1 function of wxWindow base class can be used to retrieve the current background colour.

setColumn(This, Col, Item)

-spec setColumn(This, Col, Item) -> boolean()
                   when This :: wxListCtrl(), Col :: integer(), Item :: wxListItem:wxListItem().

Sets information about this column.

See setItem/5 for more information.

setColumnWidth(This, Col, Width)

-spec setColumnWidth(This, Col, Width) -> boolean()
                        when This :: wxListCtrl(), Col :: integer(), Width :: integer().

Sets the column width.

width can be a width in pixels or wxLIST_AUTOSIZE (-1) or wxLIST_AUTOSIZE_USEHEADER (-2).

wxLIST_AUTOSIZE will resize the column to the length of its longest item.

wxLIST_AUTOSIZE_USEHEADER will resize the column to the length of the header (Win32) or 80 pixels (other platforms).

In small or normal icon view, col must be -1, and the column width is set for all columns.

setImageList(This, ImageList, Which)

-spec setImageList(This, ImageList, Which) -> ok
                      when
                          This :: wxListCtrl(),
                          ImageList :: wxImageList:wxImageList(),
                          Which :: integer().

Sets the image list associated with the control.

which is one of wxIMAGE_LIST_NORMAL, wxIMAGE_LIST_SMALL, wxIMAGE_LIST_STATE (the last is unimplemented).

This method does not take ownership of the image list, you have to delete it yourself.

See: assignImageList/3

setItem(This, Info)

-spec setItem(This, Info) -> boolean() when This :: wxListCtrl(), Info :: wxListItem:wxListItem().

Sets the data of an item.

Using the wxListItem's mask and state mask, you can change only selected attributes of a wxListCtrl item.

Return: true if the item was successfully updated or false if the update failed for some reason (e.g. an invalid item index).

setItem(This, Index, Column, Label)

-spec setItem(This, Index, Column, Label) -> boolean()
                 when
                     This :: wxListCtrl(),
                     Index :: integer(),
                     Column :: integer(),
                     Label :: unicode:chardata().

Equivalent to setItem(This, Index, Column, Label, []).

setItem/5

-spec setItem(This, Index, Column, Label, [Option]) -> boolean()
                 when
                     This :: wxListCtrl(),
                     Index :: integer(),
                     Column :: integer(),
                     Label :: unicode:chardata(),
                     Option :: {imageId, integer()}.

Sets an item string field at a particular column.

Return: true if the item was successfully updated or false if the update failed for some reason (e.g. an invalid item index).

setItemBackgroundColour(This, Item, Col)

-spec setItemBackgroundColour(This, Item, Col) -> ok
                                 when This :: wxListCtrl(), Item :: integer(), Col :: wx:wx_colour().

Sets the background colour for this item.

This function only works in report view mode. The colour can be retrieved using getItemBackgroundColour/2.

setItemColumnImage(This, Item, Column, Image)

-spec setItemColumnImage(This, Item, Column, Image) -> boolean()
                            when
                                This :: wxListCtrl(),
                                Item :: integer(),
                                Column :: integer(),
                                Image :: integer().

Sets the image associated with the item.

In report view, you can specify the column. The image is an index into the image list associated with the list control.

setItemCount(This, Count)

-spec setItemCount(This, Count) -> ok when This :: wxListCtrl(), Count :: integer().

This method can only be used with virtual list controls.

It is used to indicate to the control the number of items it contains. After calling it, the main program should be ready to handle calls to various item callbacks (such as wxListCtrl::OnGetItemText (not implemented in wx)) for all items in the range from 0 to count.

Notice that the control is not necessarily redrawn after this call as it may be undesirable if an item which is not visible on the screen anyhow was added to or removed from a control displaying many items, if you do need to refresh the display you can just call wxWindow:refresh/2 manually.

setItemData(This, Item, Data)

-spec setItemData(This, Item, Data) -> boolean()
                     when This :: wxListCtrl(), Item :: integer(), Data :: integer().

Associates application-defined data with this item.

Notice that this function cannot be used to associate pointers with the control items, use SetItemPtrData() (not implemented in wx) instead.

setItemFont(This, Item, Font)

-spec setItemFont(This, Item, Font) -> ok
                     when This :: wxListCtrl(), Item :: integer(), Font :: wxFont:wxFont().

Sets the item's font.

setItemImage(This, Item, Image)

-spec setItemImage(This, Item, Image) -> boolean()
                      when This :: wxListCtrl(), Item :: integer(), Image :: integer().

Equivalent to setItemImage(This, Item, Image, []).

setItemImage/4

-spec setItemImage(This, Item, Image, [Option]) -> boolean()
                      when
                          This :: wxListCtrl(),
                          Item :: integer(),
                          Image :: integer(),
                          Option :: {selImage, integer()}.

Sets the unselected and selected images associated with the item.

The images are indices into the image list associated with the list control.

setItemPosition(This, Item, Pos)

-spec setItemPosition(This, Item, Pos) -> boolean()
                         when
                             This :: wxListCtrl(),
                             Item :: integer(),
                             Pos :: {X :: integer(), Y :: integer()}.

Sets the position of the item, in icon or small icon view.

Windows only.

setItemState(This, Item, State, StateMask)

-spec setItemState(This, Item, State, StateMask) -> boolean()
                      when
                          This :: wxListCtrl(),
                          Item :: integer(),
                          State :: integer(),
                          StateMask :: integer().

Sets the item state.

The stateMask is a combination of wxLIST_STATE_XXX constants described in wxListItem documentation. For each of the bits specified in stateMask, the corresponding state is set or cleared depending on whether state argument contains the same bit or not.

So to select an item you can use while to deselect it you should use

Consider using wxListView if possible to avoid dealing with this error-prone and confusing method.

Also notice that contrary to the usual rule that only user actions generate events, this method does generate wxEVT_LIST_ITEM_SELECTED event when it is used to select an item.

setItemText(This, Item, Text)

-spec setItemText(This, Item, Text) -> ok
                     when This :: wxListCtrl(), Item :: integer(), Text :: unicode:chardata().

Sets the item text for this item.

setItemTextColour(This, Item, Col)

-spec setItemTextColour(This, Item, Col) -> ok
                           when This :: wxListCtrl(), Item :: integer(), Col :: wx:wx_colour().

Sets the colour for this item.

This function only works in report view. The colour can be retrieved using getItemTextColour/2.

setSingleStyle(This, Style)

-spec setSingleStyle(This, Style) -> ok when This :: wxListCtrl(), Style :: integer().

Equivalent to setSingleStyle(This, Style, []).

setSingleStyle/3

-spec setSingleStyle(This, Style, [Option]) -> ok
                        when This :: wxListCtrl(), Style :: integer(), Option :: {add, boolean()}.

Adds or removes a single window style.

setTextColour(This, Col)

-spec setTextColour(This, Col) -> ok when This :: wxListCtrl(), Col :: wx:wx_colour().

Sets the text colour of the list control.

setWindowStyleFlag(This, Style)

-spec setWindowStyleFlag(This, Style) -> ok when This :: wxListCtrl(), Style :: integer().

Sets the whole window style, deleting all items.

sortItems(This, SortCallBack)

-spec sortItems(This :: wxListCtrl(), SortCallBack) -> boolean()
                   when SortCallBack :: fun((integer(), integer()) -> integer()).

wxListEvent

A list event holds information about events associated with wxListCtrl objects.

See: wxListCtrl

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxListEvent

Events

Use wxEvtHandler:connect/3 with wxListEventType to subscribe to events of this type.

Summary

Types

wxList()

wxListEvent()

wxListEventType()

Functions

getCacheFrom(This)

For EVT\_LIST\_CACHE\_HINT event only: return the first item which the list control advises us to cache.

getCacheTo(This)

For EVT\_LIST\_CACHE\_HINT event only: return the last item (inclusive) which the list control advises us to cache.

getColumn(This)

The column position: it is only used with COL events.

getData(This)

The data.

getImage(This)

The image.

getIndex(This)

The item index.

getItem(This)

An item object, used by some events.

getKeyCode(This)

Key code if the event is a keypress event.

getLabel(This)

The (new) item label for EVT_LIST_END_LABEL_EDIT event.

getMask(This)

The mask.

getPoint(This)

The position of the mouse pointer if the event is a drag event.

getText(This)

The text.

isEditCancelled(This)

This method only makes sense for EVT\_LIST\_END\_LABEL\_EDIT message and returns true if it the label editing has been cancelled by the user (getLabel/1 returns an empty string in this case but it doesn't allow the application to distinguish between really cancelling the edit and the admittedly rare case when the user wants to rename it to an empty string).

Types

wxList()

-type wxList() ::
          #wxList{type :: wxListEvent:wxListEventType(),
                  code :: integer(),
                  oldItemIndex :: integer(),
                  itemIndex :: integer(),
                  col :: integer(),
                  pointDrag :: {X :: integer(), Y :: integer()}}.

wxListEvent()

-type wxListEvent() :: wx:wx_object().

wxListEventType()

-type wxListEventType() ::
          command_list_begin_drag | command_list_begin_rdrag | command_list_begin_label_edit |
          command_list_end_label_edit | command_list_delete_item | command_list_delete_all_items |
          command_list_key_down | command_list_insert_item | command_list_col_click |
          command_list_col_right_click | command_list_col_begin_drag | command_list_col_dragging |
          command_list_col_end_drag | command_list_item_selected | command_list_item_deselected |
          command_list_item_right_click | command_list_item_middle_click | command_list_item_activated |
          command_list_item_focused | command_list_cache_hint.

Functions

getCacheFrom(This)

-spec getCacheFrom(This) -> integer() when This :: wxListEvent().

For EVT\_LIST\_CACHE\_HINT event only: return the first item which the list control advises us to cache.

getCacheTo(This)

-spec getCacheTo(This) -> integer() when This :: wxListEvent().

For EVT\_LIST\_CACHE\_HINT event only: return the last item (inclusive) which the list control advises us to cache.

getColumn(This)

-spec getColumn(This) -> integer() when This :: wxListEvent().

The column position: it is only used with COL events.

For the column dragging events, it is the column to the left of the divider being dragged, for the column click events it may be -1 if the user clicked in the list control header outside any column.

getData(This)

-spec getData(This) -> integer() when This :: wxListEvent().

The data.

getImage(This)

-spec getImage(This) -> integer() when This :: wxListEvent().

The image.

getIndex(This)

-spec getIndex(This) -> integer() when This :: wxListEvent().

The item index.

getItem(This)

-spec getItem(This) -> wxListItem:wxListItem() when This :: wxListEvent().

An item object, used by some events.

See also wxListCtrl:setItem/5.

getKeyCode(This)

-spec getKeyCode(This) -> integer() when This :: wxListEvent().

Key code if the event is a keypress event.

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxListEvent().

The (new) item label for EVT_LIST_END_LABEL_EDIT event.

getMask(This)

-spec getMask(This) -> integer() when This :: wxListEvent().

The mask.

getPoint(This)

-spec getPoint(This) -> {X :: integer(), Y :: integer()} when This :: wxListEvent().

The position of the mouse pointer if the event is a drag event.

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxListEvent().

The text.

isEditCancelled(This)

-spec isEditCancelled(This) -> boolean() when This :: wxListEvent().

This method only makes sense for EVT\_LIST\_END\_LABEL\_EDIT message and returns true if it the label editing has been cancelled by the user (getLabel/1 returns an empty string in this case but it doesn't allow the application to distinguish between really cancelling the edit and the admittedly rare case when the user wants to rename it to an empty string).

wxListItem

This class stores information about a wxListCtrl item or column.

wxListItem is a class which contains information about:

Zero based item position; see setId/2 and getId/1.

Zero based column index; see setColumn/2 and getColumn/1.

The label (or header for columns); see setText/2 and getText/1.

The zero based index into an image list; see getImage/1 and setImage/2.

Application defined data; see SetData() (not implemented in wx) and GetData() (not implemented in wx).

For columns only: the width of the column; see setWidth/2 and getWidth/1.

For columns only: the format of the column; one of wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT, wxLIST_FORMAT_CENTRE. See setAlign/2 and getAlign/1.

The state of the item; see setState/2 and getState/1. This is a bitlist of the following flags:

wxLIST_STATE_FOCUSED: The item has the focus.

wxLIST_STATE_SELECTED: The item is selected.

wxLIST_STATE_DONTCARE: No special flags (the value of this constant is 0).

wxLIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only.

wxLIST_STATE_CUT: The item is in the cut state. Win32 only.

A mask indicating which state flags are valid; this is a bitlist of the flags reported above for the item state. See setStateMask/2 and GetStateMask().

A mask indicating which fields of this class are valid; see setMask/2 and getMask/1. This is a bitlist of the following flags:

wxLIST_MASK_STATE: The state field is valid.

wxLIST_MASK_TEXT: The label field is valid.

wxLIST_MASK_IMAGE: The image field is valid.

wxLIST_MASK_DATA: The application-defined data field is valid.

wxLIST_MASK_WIDTH: The column width field is valid.

wxLIST_MASK_FORMAT: The column format field is valid.

The wxListItem object can also contain item-specific colour and font information: for this you need to call one of setTextColour/2, setBackgroundColour/2 or setFont/2 functions on it passing it the colour/font to use. If the colour/font is not specified, the default list control colour/font is used.

See: wxListCtrl

wxWidgets docs: wxListItem

Summary

Types

wxListItem()

Functions

clear(This)

Resets the item state to the default.

destroy(This)

Destroys the object

getAlign(This)

Returns the alignment for this item.

getBackgroundColour(This)

Returns the background colour for this item.

getColumn(This)

Returns the zero-based column; meaningful only in report mode.

getFont(This)

Returns the font used to display the item.

getId(This)

Returns the zero-based item position.

getImage(This)

Returns the zero-based index of the image associated with the item into the image list.

getMask(This)

Returns a bit mask indicating which fields of the structure are valid.

getState(This)

Returns a bit field representing the state of the item.

getText(This)

Returns the label/header text.

getTextColour(This)

Returns the text colour.

getWidth(This)

Meaningful only for column headers in report mode.

new()

Constructor.

new(Item)

setAlign(This, Align)

Sets the alignment for the item.

setBackgroundColour(This, ColBack)

Sets the background colour for the item.

setColumn(This, Col)

Sets the zero-based column.

setFont(This, Font)

Sets the font for the item.

setId(This, Id)

Sets the zero-based item position.

setImage(This, Image)

Sets the zero-based index of the image associated with the item into the image list.

setMask(This, Mask)

Sets the mask of valid fields.

setState(This, State)

Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see setStateMask/2).

setStateMask(This, StateMask)

Sets the bitmask that is used to determine which of the state flags are to be set.

setText(This, Text)

Sets the text label for the item.

setTextColour(This, ColText)

Sets the text colour for the item.

setWidth(This, Width)

Meaningful only for column headers in report mode.

Types

wxListItem()

-type wxListItem() :: wx:wx_object().

Functions

clear(This)

-spec clear(This) -> ok when This :: wxListItem().

Resets the item state to the default.

destroy(This)

-spec destroy(This :: wxListItem()) -> ok.

Destroys the object

getAlign(This)

-spec getAlign(This) -> wx:wx_enum() when This :: wxListItem().

Returns the alignment for this item.

Can be one of wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT or wxLIST_FORMAT_CENTRE.

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxListItem().

Returns the background colour for this item.

getColumn(This)

-spec getColumn(This) -> integer() when This :: wxListItem().

Returns the zero-based column; meaningful only in report mode.

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxListItem().

Returns the font used to display the item.

getId(This)

-spec getId(This) -> integer() when This :: wxListItem().

Returns the zero-based item position.

getImage(This)

-spec getImage(This) -> integer() when This :: wxListItem().

Returns the zero-based index of the image associated with the item into the image list.

getMask(This)

-spec getMask(This) -> integer() when This :: wxListItem().

Returns a bit mask indicating which fields of the structure are valid.

Can be any combination of the following values:

wxLIST_MASK_STATE: GetState is valid.

wxLIST_MASK_TEXT: GetText is valid.

wxLIST_MASK_IMAGE: GetImage is valid.

wxLIST_MASK_DATA: GetData is valid.

wxLIST_MASK_WIDTH: GetWidth is valid.

wxLIST_MASK_FORMAT: GetFormat is valid.

getState(This)

-spec getState(This) -> integer() when This :: wxListItem().

Returns a bit field representing the state of the item.

Can be any combination of:

wxLIST_STATE_DONTCARE: No special flags (the values of this constant is 0).

wxLIST_STATE_DROPHILITED: The item is highlighted to receive a drop event. Win32 only.

wxLIST_STATE_FOCUSED: The item has the focus.

wxLIST_STATE_SELECTED: The item is selected.

wxLIST_STATE_CUT: The item is in the cut state. Win32 only.

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxListItem().

Returns the label/header text.

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxListItem().

Returns the text colour.

getWidth(This)

-spec getWidth(This) -> integer() when This :: wxListItem().

Meaningful only for column headers in report mode.

Returns the column width.

new()

-spec new() -> wxListItem().

Constructor.

new(Item)

-spec new(Item) -> wxListItem() when Item :: wxListItem().

setAlign(This, Align)

-spec setAlign(This, Align) -> ok when This :: wxListItem(), Align :: wx:wx_enum().

Sets the alignment for the item.

See also getAlign/1

setBackgroundColour(This, ColBack)

-spec setBackgroundColour(This, ColBack) -> ok when This :: wxListItem(), ColBack :: wx:wx_colour().

Sets the background colour for the item.

setColumn(This, Col)

-spec setColumn(This, Col) -> ok when This :: wxListItem(), Col :: integer().

Sets the zero-based column.

Meaningful only in report mode.

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxListItem(), Font :: wxFont:wxFont().

Sets the font for the item.

setId(This, Id)

-spec setId(This, Id) -> ok when This :: wxListItem(), Id :: integer().

Sets the zero-based item position.

setImage(This, Image)

-spec setImage(This, Image) -> ok when This :: wxListItem(), Image :: integer().

Sets the zero-based index of the image associated with the item into the image list.

setMask(This, Mask)

-spec setMask(This, Mask) -> ok when This :: wxListItem(), Mask :: integer().

Sets the mask of valid fields.

See getMask/1.

setState(This, State)

-spec setState(This, State) -> ok when This :: wxListItem(), State :: integer().

Sets the item state flags (note that the valid state flags are influenced by the value of the state mask, see setStateMask/2).

See getState/1 for valid flag values.

setStateMask(This, StateMask)

-spec setStateMask(This, StateMask) -> ok when This :: wxListItem(), StateMask :: integer().

Sets the bitmask that is used to determine which of the state flags are to be set.

See also setState/2.

setText(This, Text)

-spec setText(This, Text) -> ok when This :: wxListItem(), Text :: unicode:chardata().

Sets the text label for the item.

setTextColour(This, ColText)

-spec setTextColour(This, ColText) -> ok when This :: wxListItem(), ColText :: wx:wx_colour().

Sets the text colour for the item.

setWidth(This, Width)

-spec setWidth(This, Width) -> ok when This :: wxListItem(), Width :: integer().

Meaningful only for column headers in report mode.

Sets the column width.

wxListItemAttr

Functions for wxListItemAttr class

wxWidgets docs: wxListItemAttr

Summary

Types

wxListItemAttr()

Functions

destroy(This)

Destroys the object

getBackgroundColour(This)

getFont(This)

getTextColour(This)

hasBackgroundColour(This)

hasFont(This)

hasTextColour(This)

new()

new(ColText, ColBack, Font)

setBackgroundColour(This, ColBack)

setFont(This, Font)

setTextColour(This, ColText)

Types

wxListItemAttr()

-type wxListItemAttr() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxListItemAttr()) -> ok.

Destroys the object

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxListItemAttr().

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxListItemAttr().

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxListItemAttr().

hasBackgroundColour(This)

-spec hasBackgroundColour(This) -> boolean() when This :: wxListItemAttr().

hasFont(This)

-spec hasFont(This) -> boolean() when This :: wxListItemAttr().

hasTextColour(This)

-spec hasTextColour(This) -> boolean() when This :: wxListItemAttr().

new()

-spec new() -> wxListItemAttr().

new(ColText, ColBack, Font)

-spec new(ColText, ColBack, Font) -> wxListItemAttr()
             when ColText :: wx:wx_colour(), ColBack :: wx:wx_colour(), Font :: wxFont:wxFont().

setBackgroundColour(This, ColBack)

-spec setBackgroundColour(This, ColBack) -> ok when This :: wxListItemAttr(), ColBack :: wx:wx_colour().

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxListItemAttr(), Font :: wxFont:wxFont().

setTextColour(This, ColText)

-spec setTextColour(This, ColText) -> ok when This :: wxListItemAttr(), ColText :: wx:wx_colour().

wxListView

This class currently simply presents a simpler to use interface for the wxListCtrl -- it can be thought of as a façade for that complicated class.

Using it is preferable to using wxListCtrl directly whenever possible because in the future some ports might implement wxListView but not the full set of wxListCtrl features.

Other than different interface, this class is identical to wxListCtrl. In particular, it uses the same events, same window styles and so on.

See: setColumnImage/3

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxListView

Summary

Types

wxListView()

Functions

clearColumnImage(This, Col)

Resets the column image -- after calling this function, no image will be shown.

focus(This, Index)

Sets focus to the item with the given index.

getFirstSelected(This)

Returns the first selected item in a (presumably) multiple selection control.

getFocusedItem(This)

Returns the currently focused item or -1 if none.

getNextSelected(This, Item)

Used together with getFirstSelected/1 to iterate over all selected items in the control.

isSelected(This, Index)

Returns true if the item with the given index is selected, false otherwise.

select(This, N)

Equivalent to select(This, N, []).

select/3

Selects or unselects the given item.

setColumnImage(This, Col, Image)

Sets the column image for the specified column.

Types

wxListView()

-type wxListView() :: wx:wx_object().

Functions

clearColumnImage(This, Col)

-spec clearColumnImage(This, Col) -> ok when This :: wxListView(), Col :: integer().

Resets the column image -- after calling this function, no image will be shown.

See: setColumnImage/3

focus(This, Index)

-spec focus(This, Index) -> ok when This :: wxListView(), Index :: integer().

Sets focus to the item with the given index.

getFirstSelected(This)

-spec getFirstSelected(This) -> integer() when This :: wxListView().

Returns the first selected item in a (presumably) multiple selection control.

Together with getNextSelected/2 it can be used to iterate over all selected items in the control.

Return: The first selected item, if any, -1 otherwise.

getFocusedItem(This)

-spec getFocusedItem(This) -> integer() when This :: wxListView().

Returns the currently focused item or -1 if none.

See:

isSelected/2

focus/2

getNextSelected(This, Item)

-spec getNextSelected(This, Item) -> integer() when This :: wxListView(), Item :: integer().

Used together with getFirstSelected/1 to iterate over all selected items in the control.

Return: Returns the next selected item or -1 if there are no more of them.

isSelected(This, Index)

-spec isSelected(This, Index) -> boolean() when This :: wxListView(), Index :: integer().

Returns true if the item with the given index is selected, false otherwise.

See:

getFirstSelected/1

getNextSelected/2

select(This, N)

-spec select(This, N) -> ok when This :: wxListView(), N :: integer().

Equivalent to select(This, N, []).

select/3

-spec select(This, N, [Option]) -> ok
                when This :: wxListView(), N :: integer(), Option :: {on, boolean()}.

Selects or unselects the given item.

Notice that this method inherits the unusual behaviour of wxListCtrl:setItemState/4 which sends a wxEVT_LIST_ITEM_SELECTED event when it is used to select an item, contrary to the usual rule that only the user actions result in selection.

setColumnImage(This, Col, Image)

-spec setColumnImage(This, Col, Image) -> ok
                        when This :: wxListView(), Col :: integer(), Image :: integer().

Sets the column image for the specified column.

To use the column images, the control must have a valid image list with at least one image.

wxListbook

wxListbook is a class similar to wxNotebook but which uses a wxListCtrl to show the labels instead of the tabs.

The underlying wxListCtrl displays page labels in a one-column report view by default. Calling wxBookCtrl::SetImageList will implicitly switch the control to use an icon view.

For usage documentation of this class, please refer to the base abstract class wxBookCtrl. You can also use the page_samples_notebook to see wxListbook in action.

Styles

This class supports the following styles:

wxLB_DEFAULT: Choose the default location for the labels depending on the current platform (left everywhere except Mac where it is top).

wxLB_TOP: Place labels above the page area.

wxLB_LEFT: Place labels on the left side.

wxLB_RIGHT: Place labels on the right side.

wxLB_BOTTOM: Place labels below the page area.

See:

?wxBookCtrl

wxNotebook

Examples

This class is derived, and can use functions, from:

wxBookCtrlBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxListbook

Events

Event types emitted from this class:

listbook_page_changed

listbook_page_changing

Summary

Types

wxListbook()

Functions

addPage(This, Page, Text)

Equivalent to addPage(This, Page, Text, []).

addPage/4

Adds a new page.

advanceSelection(This)

Equivalent to advanceSelection(This, []).

advanceSelection/2

Cycles through the tabs.

assignImageList(This, ImageList)

Sets the image list for the page control and takes ownership of the list.

changeSelection(This, Page)

Changes the selection to the given page, returning the previous selection.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Create the list book control that has already been constructed with the default constructor.

deleteAllPages(This)

Deletes all pages.

destroy(This)

Destroys the object

getCurrentPage(This)

Returns the currently selected page or NULL.

getImageList(This)

Returns the associated image list, may be NULL.

getPage(This, Page)

Returns the window at the given page position.

getPageCount(This)

Returns the number of pages in the control.

getPageImage(This, NPage)

Returns the image index for the given page.

getPageText(This, NPage)

Returns the string for the given page.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

hitTest(This, Pt)

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

insertPage(This, Index, Page, Text)

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

Inserts a new page at the specified position.

new()

Default ctor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructs a listbook control.

setImageList(This, ImageList)

Sets the image list to use.

setPageImage(This, Page, Image)

Sets the image index for the given page.

setPageSize(This, Size)

Sets the width and height of the pages.

setPageText(This, Page, Text)

Sets the text for the given page.

setSelection(This, Page)

Sets the selection to the given page, returning the previous selection.

Types

wxListbook()

-type wxListbook() :: wx:wx_object().

Functions

addPage(This, Page, Text)

-spec addPage(This, Page, Text) -> boolean()
                 when This :: wxListbook(), Page :: wxWindow:wxWindow(), Text :: unicode:chardata().

Equivalent to addPage(This, Page, Text, []).

addPage/4

-spec addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxListbook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option :: {bSelect, boolean()} | {imageId, integer()}.

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function will generate the page changing and page changed events if select is true, but not when inserting the very first page (as there is no previous page selection to switch from in this case and so it wouldn't make sense to e.g. veto such event).

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: insertPage/5

advanceSelection(This)

-spec advanceSelection(This) -> ok when This :: wxListbook().

Equivalent to advanceSelection(This, []).

advanceSelection/2

-spec advanceSelection(This, [Option]) -> ok when This :: wxListbook(), Option :: {forward, boolean()}.

Cycles through the tabs.

The call to this function generates the page changing events.

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxListbook(), ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list.

See:

wxImageList

setImageList/2

changeSelection(This, Page)

-spec changeSelection(This, Page) -> integer() when This :: wxListbook(), Page :: integer().

Changes the selection to the given page, returning the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events.

See overview_events_prog for more information.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxListbook(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxListbook(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Create the list book control that has already been constructed with the default constructor.

deleteAllPages(This)

-spec deleteAllPages(This) -> boolean() when This :: wxListbook().

Deletes all pages.

destroy(This)

-spec destroy(This :: wxListbook()) -> ok.

Destroys the object

getCurrentPage(This)

-spec getCurrentPage(This) -> wxWindow:wxWindow() when This :: wxListbook().

Returns the currently selected page or NULL.

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxListbook().

Returns the associated image list, may be NULL.

See:

wxImageList

setImageList/2

getPage(This, Page)

-spec getPage(This, Page) -> wxWindow:wxWindow() when This :: wxListbook(), Page :: integer().

Returns the window at the given page position.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxListbook().

Returns the number of pages in the control.

getPageImage(This, NPage)

-spec getPageImage(This, NPage) -> integer() when This :: wxListbook(), NPage :: integer().

Returns the image index for the given page.

getPageText(This, NPage)

-spec getPageText(This, NPage) -> unicode:charlist() when This :: wxListbook(), NPage :: integer().

Returns the string for the given page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxListbook().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent:getSelection/1 should be used instead in this case.

hitTest(This, Pt)

-spec hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxListbook(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage(This, Index, Page, Text)

-spec insertPage(This, Index, Page, Text) -> boolean()
                    when
                        This :: wxListbook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata().

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

-spec insertPage(This, Index, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxListbook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: addPage/4

new()

-spec new() -> wxListbook().

Default ctor.

new(Parent, Id)

-spec new(Parent, Id) -> wxListbook() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxListbook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructs a listbook control.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxListbook(), ImageList :: wxImageList:wxImageList().

Sets the image list to use.

It does not take ownership of the image list, you must delete it yourself.

See:

wxImageList

assignImageList/2

setPageImage(This, Page, Image)

-spec setPageImage(This, Page, Image) -> boolean()
                      when This :: wxListbook(), Page :: integer(), Image :: integer().

Sets the image index for the given page.

image is an index into the image list which was set with setImageList/2.

setPageSize(This, Size)

-spec setPageSize(This, Size) -> ok when This :: wxListbook(), Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxListbook(), Page :: integer(), Text :: unicode:chardata().

Sets the text for the given page.

setSelection(This, Page)

-spec setSelection(This, Page) -> integer() when This :: wxListbook(), Page :: integer().

Sets the selection to the given page, returning the previous selection.

Notice that the call to this function generates the page changing events, use the changeSelection/2 function if you don't want these events to be generated.

See: getSelection/1

wxLocale

wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale concept.

In wxWidgets this class manages current locale. It also initializes and activates wxTranslations (not implemented in wx) object that manages message catalogs.

For a list of the supported languages, please see ?wxLanguage enum values. These constants may be used to specify the language in init/3 and are returned by getSystemLanguage/0.

See:

Overview i18n

Examples

wxWidgets docs: wxLocale

Summary

Types

wxLocale()

Functions

addCatalog(This, Domain)

Calls wxTranslations::AddCatalog(const wxString&).

addCatalog(This, Domain, MsgIdLanguage)

Calls wxTranslations::AddCatalog(const wxString&, wxLanguage) (not implemented in wx).

addCatalog(This, Domain, MsgIdLanguage, MsgIdCharset)

Calls wxTranslations::AddCatalog(const wxString&, wxLanguage, const wxString&) (not implemented in wx).

addCatalogLookupPathPrefix(Prefix)

Calls wxFileTranslationsLoader::AddCatalogLookupPathPrefix() (not implemented in wx).

destroy(This)

Destroys the object

getCanonicalName(This)

Returns the canonical form of current locale name.

getHeaderValue(This, Header)

Equivalent to getHeaderValue(This, Header, []).

getHeaderValue/3

Calls wxTranslations::GetHeaderValue() (not implemented in wx).

getLanguage(This)

Returns the ?wxLanguage constant of current language.

getLanguageName(Lang)

Returns English name of the given language or empty string if this language is unknown.

getLocale(This)

Returns the locale name as passed to the constructor or init/3.

getName(This)

Returns the current short name for the locale (as given to the constructor or the init/3 function).

getString(This, OrigString)

Equivalent to getString(This, OrigString, []).

getString/3

Calls wxGetTranslation(const wxString&, const wxString&).

getString(This, OrigString, OrigString2, N)

Equivalent to getString(This, OrigString, OrigString2, N, []).

getString/5

Calls wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&).

getSysName(This)

Returns current platform-specific locale name as passed to setlocale().

getSystemEncoding()

Tries to detect the user's default font encoding.

getSystemEncodingName()

Tries to detect the name of the user's default font encoding.

getSystemLanguage()

Tries to detect the user's default locale setting.

init(This)

Equivalent to init(This, []).

init/2

Initializes the wxLocale instance.

init/3

Deprecated

isLoaded(This, Domain)

Calls wxTranslations::IsLoaded() (not implemented in wx).

isOk(This)

Returns true if the locale could be set successfully.

new()

This is the default constructor and it does nothing to initialize the object: init/3 must be used to do that.

new/1

Equivalent to: new/2

new/2

See init/3 for parameters description.

Types

wxLocale()

-type wxLocale() :: wx:wx_object().

Functions

addCatalog(This, Domain)

-spec addCatalog(This, Domain) -> boolean() when This :: wxLocale(), Domain :: unicode:chardata().

Calls wxTranslations::AddCatalog(const wxString&).

addCatalog(This, Domain, MsgIdLanguage)

-spec addCatalog(This, Domain, MsgIdLanguage) -> boolean()
                    when This :: wxLocale(), Domain :: unicode:chardata(), MsgIdLanguage :: wx:wx_enum().

Calls wxTranslations::AddCatalog(const wxString&, wxLanguage) (not implemented in wx).

addCatalog(This, Domain, MsgIdLanguage, MsgIdCharset)

-spec addCatalog(This, Domain, MsgIdLanguage, MsgIdCharset) -> boolean()
                    when
                        This :: wxLocale(),
                        Domain :: unicode:chardata(),
                        MsgIdLanguage :: wx:wx_enum(),
                        MsgIdCharset :: unicode:chardata().

Calls wxTranslations::AddCatalog(const wxString&, wxLanguage, const wxString&) (not implemented in wx).

addCatalogLookupPathPrefix(Prefix)

-spec addCatalogLookupPathPrefix(Prefix) -> ok when Prefix :: unicode:chardata().

Calls wxFileTranslationsLoader::AddCatalogLookupPathPrefix() (not implemented in wx).

destroy(This)

-spec destroy(This :: wxLocale()) -> ok.

Destroys the object

getCanonicalName(This)

-spec getCanonicalName(This) -> unicode:charlist() when This :: wxLocale().

Returns the canonical form of current locale name.

Canonical form is the one that is used on UNIX systems: it is a two- or five-letter string in xx or xx_YY format, where xx is ISO 639 code of language and YY is ISO 3166 code of the country. Examples are "en", "en_GB", "en_US" or "fr_FR". This form is internally used when looking up message catalogs. Compare getSysName/1.

getHeaderValue(This, Header)

-spec getHeaderValue(This, Header) -> unicode:charlist()
                        when This :: wxLocale(), Header :: unicode:chardata().

Equivalent to getHeaderValue(This, Header, []).

getHeaderValue/3

-spec getHeaderValue(This, Header, [Option]) -> unicode:charlist()
                        when
                            This :: wxLocale(),
                            Header :: unicode:chardata(),
                            Option :: {szDomain, unicode:chardata()}.

Calls wxTranslations::GetHeaderValue() (not implemented in wx).

getLanguage(This)

-spec getLanguage(This) -> integer() when This :: wxLocale().

Returns the ?wxLanguage constant of current language.

Note that you can call this function only if you used the form of init/3 that takes ?wxLanguage argument.

getLanguageName(Lang)

-spec getLanguageName(Lang) -> unicode:charlist() when Lang :: integer().

Returns English name of the given language or empty string if this language is unknown.

See GetLanguageInfo() (not implemented in wx) for a remark about special meaning of wxLANGUAGE_DEFAULT.

getLocale(This)

-spec getLocale(This) -> unicode:charlist() when This :: wxLocale().

Returns the locale name as passed to the constructor or init/3.

This is a full, human-readable name, e.g. "English" or "French".

getName(This)

-spec getName(This) -> unicode:charlist() when This :: wxLocale().

Returns the current short name for the locale (as given to the constructor or the init/3 function).

getString(This, OrigString)

-spec getString(This, OrigString) -> unicode:charlist()
                   when This :: wxLocale(), OrigString :: unicode:chardata().

Equivalent to getString(This, OrigString, []).

getString/3

-spec getString(This, OrigString, [Option]) -> unicode:charlist()
                   when
                       This :: wxLocale(),
                       OrigString :: unicode:chardata(),
                       Option :: {szDomain, unicode:chardata()}.

Calls wxGetTranslation(const wxString&, const wxString&).

getString(This, OrigString, OrigString2, N)

-spec getString(This, OrigString, OrigString2, N) -> unicode:charlist()
                   when
                       This :: wxLocale(),
                       OrigString :: unicode:chardata(),
                       OrigString2 :: unicode:chardata(),
                       N :: integer().

Equivalent to getString(This, OrigString, OrigString2, N, []).

getString/5

-spec getString(This, OrigString, OrigString2, N, [Option]) -> unicode:charlist()
                   when
                       This :: wxLocale(),
                       OrigString :: unicode:chardata(),
                       OrigString2 :: unicode:chardata(),
                       N :: integer(),
                       Option :: {szDomain, unicode:chardata()}.

Calls wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&).

getSysName(This)

-spec getSysName(This) -> unicode:charlist() when This :: wxLocale().

Returns current platform-specific locale name as passed to setlocale().

Compare getCanonicalName/1.

getSystemEncoding()

-spec getSystemEncoding() -> wx:wx_enum().

Tries to detect the user's default font encoding.

Returns ?wxFontEncoding() value or wxFONTENCODING_SYSTEM if it couldn't be determined.

getSystemEncodingName()

-spec getSystemEncodingName() -> unicode:charlist().

Tries to detect the name of the user's default font encoding.

This string isn't particularly useful for the application as its form is platform-dependent and so you should probably use getSystemEncoding/0 instead.

Returns a user-readable string value or an empty string if it couldn't be determined.

getSystemLanguage()

-spec getSystemLanguage() -> integer().

Tries to detect the user's default locale setting.

Returns the ?wxLanguage value or wxLANGUAGE_UNKNOWN if the language-guessing algorithm failed.

Note: This function works with locales and returns the user's default locale. This may be, and usually is, the same as their preferred UI language, but it's not the same thing. Use wxTranslation to obtain language information.

init(This)

-spec init(This) -> boolean() when This :: wxLocale().

Equivalent to init(This, []).

init/2

-spec init(This, [Option]) -> boolean()
              when This :: wxLocale(), Option :: {language, integer()} | {flags, integer()}.

Initializes the wxLocale instance.

The call of this function has several global side effects which you should understand: first of all, the application locale is changed - note that this will affect many of standard C library functions such as printf() or strftime(). Second, this wxLocale object becomes the new current global locale for the application and so all subsequent calls to ?wxGetTranslation() will try to translate the messages using the message catalogs for this locale.

Return: true on success or false if the given locale couldn't be set.

init/3

-spec init(This, Name, [Option]) -> boolean()
              when
                  This :: wxLocale(),
                  Name :: unicode:chardata(),
                  Option ::
                      {shortName, unicode:chardata()} |
                      {locale, unicode:chardata()} |
                      {bLoadDefault, boolean()}.

Deprecated:

This form is deprecated, use the other one unless you know what you are doing.

isLoaded(This, Domain)

-spec isLoaded(This, Domain) -> boolean() when This :: wxLocale(), Domain :: unicode:chardata().

Calls wxTranslations::IsLoaded() (not implemented in wx).

isOk(This)

-spec isOk(This) -> boolean() when This :: wxLocale().

Returns true if the locale could be set successfully.

new()

-spec new() -> wxLocale().

This is the default constructor and it does nothing to initialize the object: init/3 must be used to do that.

new/1

-spec new(Language) -> wxLocale() when Language :: integer();
         (Name) -> wxLocale() when Name :: unicode:chardata().

Equivalent to: new/2

new/2

-spec new(Language, [Option]) -> wxLocale() when Language :: integer(), Option :: {flags, integer()};
         (Name, [Option]) -> wxLocale()
             when
                 Name :: unicode:chardata(),
                 Option ::
                     {shortName, unicode:chardata()} |
                     {locale, unicode:chardata()} |
                     {bLoadDefault, boolean()}.

See init/3 for parameters description.

The call of this function has several global side effects which you should understand: first of all, the application locale is changed - note that this will affect many of standard C library functions such as printf() or strftime(). Second, this wxLocale object becomes the new current global locale for the application and so all subsequent calls to ?wxGetTranslation() will try to translate the messages using the message catalogs for this locale.

wxLogNull

This class allows you to temporarily suspend logging.

All calls to the log functions during the life time of an object of this class are just ignored.

In particular, it can be used to suppress the log messages given by wxWidgets itself but it should be noted that it is rarely the best way to cope with this problem as all log messages are suppressed, even if they indicate a completely different error than the one the programmer wanted to suppress.

For instance, the example of the overview:

would be better written as:

wxWidgets docs: wxLogNull

Summary

Types

wxLogNull()

Functions

destroy(This)

Destroys the object

new()

Suspends logging.

Types

wxLogNull()

-type wxLogNull() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxLogNull()) -> ok.

Destroys the object

new()

-spec new() -> wxLogNull().

Suspends logging.

wxMDIChildFrame

An MDI child frame is a frame that can only exist inside a wxMDIClientWindow, which is itself a child of wxMDIParentFrame.

Styles

This class supports the following styles:

All of the standard wxFrame styles can be used but most of them are ignored by TDI-based MDI implementations.

Remark: Although internally an MDI child frame is a child of the MDI client window, in wxWidgets you create it as a child of wxMDIParentFrame. In fact, you can usually forget that the client window exists. MDI child frames are clipped to the area of the MDI client window, and may be iconized on the client window. You can associate a menubar with a child frame as usual, although an MDI child doesn't display its menubar under its own title bar. The MDI parent frame's menubar will be changed to reflect the currently active child frame. If there are currently no children, the parent frame's own menubar will be displayed.

See:

wxMDIClientWindow

wxMDIParentFrame

wxFrame

This class is derived, and can use functions, from:

wxFrame

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxMDIChildFrame

Summary

Types

wxMDIChildFrame()

Functions

activate(This)

Activates this MDI child frame.

create(This, Parent, Id, Title)

Equivalent to create(This, Parent, Id, Title, []).

create/5

Used in two-step frame construction.

destroy(This)

Destroys the object

maximize(This)

Equivalent to maximize(This, []).

maximize/2

Maximizes this MDI child frame.

new()

Default constructor.

new(Parent, Id, Title)

Equivalent to new(Parent, Id, Title, []).

new/4

Constructor, creating the window.

restore(This)

Restores this MDI child frame (unmaximizes).

Types

wxMDIChildFrame()

-type wxMDIChildFrame() :: wx:wx_object().

Functions

activate(This)

-spec activate(This) -> ok when This :: wxMDIChildFrame().

Activates this MDI child frame.

See:

maximize/2

restore/1

create(This, Parent, Id, Title)

-spec create(This, Parent, Id, Title) -> boolean()
                when
                    This :: wxMDIChildFrame(),
                    Parent :: wxMDIParentFrame:wxMDIParentFrame(),
                    Id :: integer(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Id, Title, []).

create/5

-spec create(This, Parent, Id, Title, [Option]) -> boolean()
                when
                    This :: wxMDIChildFrame(),
                    Parent :: wxMDIParentFrame:wxMDIParentFrame(),
                    Id :: integer(),
                    Title :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Used in two-step frame construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxMDIChildFrame()) -> ok.

Destroys the object

maximize(This)

-spec maximize(This) -> ok when This :: wxMDIChildFrame().

Equivalent to maximize(This, []).

maximize/2

-spec maximize(This, [Option]) -> ok when This :: wxMDIChildFrame(), Option :: {maximize, boolean()}.

Maximizes this MDI child frame.

This function doesn't do anything if IsAlwaysMaximized() (not implemented in wx) returns true.

See:

activate/1

restore/1

new()

-spec new() -> wxMDIChildFrame().

Default constructor.

new(Parent, Id, Title)

-spec new(Parent, Id, Title) -> wxMDIChildFrame()
             when
                 Parent :: wxMDIParentFrame:wxMDIParentFrame(),
                 Id :: integer(),
                 Title :: unicode:chardata().

Equivalent to new(Parent, Id, Title, []).

new/4

-spec new(Parent, Id, Title, [Option]) -> wxMDIChildFrame()
             when
                 Parent :: wxMDIParentFrame:wxMDIParentFrame(),
                 Id :: integer(),
                 Title :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating the window.

See: create/5

restore(This)

-spec restore(This) -> ok when This :: wxMDIChildFrame().

Restores this MDI child frame (unmaximizes).

This function doesn't do anything if IsAlwaysMaximized() (not implemented in wx) returns true.

See:

activate/1

maximize/2

wxMDIClientWindow

An MDI client window is a child of wxMDIParentFrame, and manages zero or more wxMDIChildFrame objects.

The client window is the area where MDI child windows exist. It doesn't have to cover the whole parent frame; other windows such as toolbars and a help window might coexist with it. There can be scrollbars on a client window, which are controlled by the parent window style.

The wxMDIClientWindow class is usually adequate without further derivation, and it is created automatically when the MDI parent frame is created. If the application needs to derive a new class, the function wxMDIParentFrame::OnCreateClient() (not implemented in wx) must be overridden in order to give an opportunity to use a different class of client window.

Under wxMSW, the client window will automatically have a sunken border style when the active child is not maximized, and no border style when a child is maximized.

See:

wxMDIChildFrame

wxMDIParentFrame

wxFrame

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxMDIClientWindow

Summary

Types

wxMDIClientWindow()

Functions

createClient(This, Parent)

Equivalent to createClient(This, Parent, []).

createClient/3

Called by wxMDIParentFrame immediately after creating the client window.

destroy(This)

Destroys the object

new()

Default constructor.

Types

wxMDIClientWindow()

-type wxMDIClientWindow() :: wx:wx_object().

Functions

createClient(This, Parent)

-spec createClient(This, Parent) -> boolean()
                      when This :: wxMDIClientWindow(), Parent :: wxMDIParentFrame:wxMDIParentFrame().

Equivalent to createClient(This, Parent, []).

createClient/3

-spec createClient(This, Parent, [Option]) -> boolean()
                      when
                          This :: wxMDIClientWindow(),
                          Parent :: wxMDIParentFrame:wxMDIParentFrame(),
                          Option :: {style, integer()}.

Called by wxMDIParentFrame immediately after creating the client window.

This function may be overridden in the derived class but the base class version must usually be called first to really create the window.

destroy(This)

-spec destroy(This :: wxMDIClientWindow()) -> ok.

Destroys the object

new()

-spec new() -> wxMDIClientWindow().

Default constructor.

Objects of this class are only created by wxMDIParentFrame which uses the default constructor and calls createClient/3 immediately afterwards.

wxMDIParentFrame

An MDI (Multiple Document Interface) parent frame is a window which can contain MDI child frames in its client area which emulates the full desktop.

MDI is a user-interface model in which all the window reside inside the single parent window as opposed to being separate from each other. It remains popular despite dire warnings from Microsoft itself (which popularized this model in the first model) that MDI is obsolete.

An MDI parent frame always has a wxMDIClientWindow associated with it, which is the parent for MDI child frames. In the simplest case, the client window takes up the entire parent frame area but it is also possible to resize it to be smaller in order to have other windows in the frame, a typical example is using a sidebar along one of the window edges.

The appearance of MDI applications differs between different ports. The classic MDI model, with child windows which can be independently moved, resized etc, is only available under MSW, which provides native support for it. In Mac ports, multiple top level windows are used for the MDI children too and the MDI parent frame itself is invisible, to accommodate the native look and feel requirements. In all the other ports, a tab-based MDI implementation (sometimes called TDI) is used and so at most one MDI child is visible at any moment (child frames are always maximized).

Although it is possible to have multiple MDI parent frames, a typical MDI application has a single MDI parent frame window inside which multiple MDI child frames, i.e. objects of class wxMDIChildFrame, can be created.

Styles

This class supports the following styles:

There are no special styles for this class, all wxFrame styles apply to it in the usual way. The only exception is that wxHSCROLL and wxVSCROLL styles apply not to the frame itself but to the client window, so that using them enables horizontal and vertical scrollbars for this window and not the frame.

See:

wxMDIChildFrame

wxMDIClientWindow

wxFrame

wxDialog

This class is derived, and can use functions, from:

wxFrame

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxMDIParentFrame

Summary

Types

wxMDIParentFrame()

Functions

activateNext(This)

Activates the MDI child following the currently active one.

activatePrevious(This)

Activates the MDI child preceding the currently active one.

arrangeIcons(This)

Arranges any iconized (minimized) MDI child windows.

cascade(This)

Arranges the MDI child windows in a cascade.

create(This, Parent, Id, Title)

Equivalent to create(This, Parent, Id, Title, []).

create/5

Used in two-step frame construction.

destroy(This)

Destroys the object

getActiveChild(This)

Returns a pointer to the active MDI child, if there is one.

getClientWindow(This)

Returns a pointer to the client window.

new()

Default constructor.

new(Parent, Id, Title)

Equivalent to new(Parent, Id, Title, []).

new/4

Constructor, creating the window.

tile(This)

Equivalent to tile(This, []).

tile/2

Tiles the MDI child windows either horizontally or vertically depending on whether orient is wxHORIZONTAL or wxVERTICAL.

Types

wxMDIParentFrame()

-type wxMDIParentFrame() :: wx:wx_object().

Functions

activateNext(This)

-spec activateNext(This) -> ok when This :: wxMDIParentFrame().

Activates the MDI child following the currently active one.

The MDI children are maintained in an ordered list and this function switches to the next element in this list, wrapping around the end of it if the currently active child is the last one.

See: activatePrevious/1

activatePrevious(This)

-spec activatePrevious(This) -> ok when This :: wxMDIParentFrame().

Activates the MDI child preceding the currently active one.

See: activateNext/1

arrangeIcons(This)

-spec arrangeIcons(This) -> ok when This :: wxMDIParentFrame().

Arranges any iconized (minimized) MDI child windows.

This method is only implemented in MSW MDI implementation and does nothing under the other platforms.

See:

cascade/1

tile/2

cascade(This)

-spec cascade(This) -> ok when This :: wxMDIParentFrame().

Arranges the MDI child windows in a cascade.

This method is only implemented in MSW MDI implementation and does nothing under the other platforms.

See:

tile/2

arrangeIcons/1

create(This, Parent, Id, Title)

-spec create(This, Parent, Id, Title) -> boolean()
                when
                    This :: wxMDIParentFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Id, Title, []).

create/5

-spec create(This, Parent, Id, Title, [Option]) -> boolean()
                when
                    This :: wxMDIParentFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Used in two-step frame construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxMDIParentFrame()) -> ok.

Destroys the object

getActiveChild(This)

-spec getActiveChild(This) -> wxMDIChildFrame:wxMDIChildFrame() when This :: wxMDIParentFrame().

Returns a pointer to the active MDI child, if there is one.

If there are any children at all this function returns a non-NULL pointer.

getClientWindow(This)

-spec getClientWindow(This) -> wxMDIClientWindow:wxMDIClientWindow() when This :: wxMDIParentFrame().

Returns a pointer to the client window.

new()

-spec new() -> wxMDIParentFrame().

Default constructor.

Use create/5 for the objects created using this constructor.

new(Parent, Id, Title)

-spec new(Parent, Id, Title) -> wxMDIParentFrame()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Title :: unicode:chardata().

Equivalent to new(Parent, Id, Title, []).

new/4

-spec new(Parent, Id, Title, [Option]) -> wxMDIParentFrame()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Title :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating the window.

Notice that if you override virtual OnCreateClient() (not implemented in wx) method you shouldn't be using this constructor but the default constructor and create/5 as otherwise your overridden method is never going to be called because of the usual C++ virtual call resolution rules.

Under wxMSW, the client window will automatically have a sunken border style when the active child is not maximized, and no border style when a child is maximized.

See: create/5

tile(This)

-spec tile(This) -> ok when This :: wxMDIParentFrame().

Equivalent to tile(This, []).

tile/2

-spec tile(This, [Option]) -> ok when This :: wxMDIParentFrame(), Option :: {orient, wx:wx_enum()}.

Tiles the MDI child windows either horizontally or vertically depending on whether orient is wxHORIZONTAL or wxVERTICAL.

This method is only implemented in MSW MDI implementation and does nothing under the other platforms.

wxMask

This class encapsulates a monochrome mask bitmap, where the masked area is black and the unmasked area is white.

When associated with a bitmap and drawn in a device context, the unmasked area of the bitmap will be drawn, and the masked area will not be drawn.

Note: A mask can be associated also with a bitmap with an alpha channel but drawing such bitmaps under wxMSW may be slow so using them should be avoided if drawing performance is an important factor.

See:

wxBitmap

wxDC:blit/6

wxMemoryDC

wxWidgets docs: wxMask

Summary

Types

wxMask()

Functions

create(This, Bitmap)

Constructs a mask from a monochrome bitmap.

create/3

Constructs a mask from a bitmap and a colour that indicates the background.

destroy(This)

Destroys the object

new()

Default constructor.

new(Bitmap)

Constructs a mask from a monochrome bitmap.

new/2

Constructs a mask from a bitmap and a colour that indicates the background.

Types

wxMask()

-type wxMask() :: wx:wx_object().

Functions

create(This, Bitmap)

-spec create(This, Bitmap) -> boolean() when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap.

create/3

-spec create(This, Bitmap, Index) -> boolean()
                when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap(), Index :: integer();
            (This, Bitmap, Colour) -> boolean()
                when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap(), Colour :: wx:wx_colour().

Constructs a mask from a bitmap and a colour that indicates the background.

destroy(This)

-spec destroy(This :: wxMask()) -> ok.

Destroys the object

new()

-spec new() -> wxMask().

Default constructor.

new(Bitmap)

-spec new(Bitmap) -> wxMask() when Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap.

new/2

-spec new(Bitmap, Index) -> wxMask() when Bitmap :: wxBitmap:wxBitmap(), Index :: integer();
         (Bitmap, Colour) -> wxMask() when Bitmap :: wxBitmap:wxBitmap(), Colour :: wx:wx_colour().

Constructs a mask from a bitmap and a colour that indicates the background.

wxMaximizeEvent

An event being sent when a top level window is maximized.

Notice that it is not sent when the window is restored to its original size after it had been maximized, only a normal wxSizeEvent is generated in this case.

Currently this event is only generated in wxMSW, wxGTK and wxOSX/Cocoa ports so portable programs should only rely on receiving wxEVT_SIZE and not necessarily this event when the window is maximized.

See:

Overview events

wxTopLevelWindow:maximize/2

wxTopLevelWindow:isMaximized/1

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMaximizeEvent

Events

Use wxEvtHandler:connect/3 with wxMaximizeEventType to subscribe to events of this type.

Summary

Types

wxMaximize()

wxMaximizeEvent()

wxMaximizeEventType()

Types

wxMaximize()

-type wxMaximize() :: #wxMaximize{type :: wxMaximizeEvent:wxMaximizeEventType()}.

wxMaximizeEvent()

-type wxMaximizeEvent() :: wx:wx_object().

wxMaximizeEventType()

-type wxMaximizeEventType() :: maximize.

wxMemoryDC

A memory device context provides a means to draw graphics onto a bitmap.

When drawing in to a mono-bitmap, using wxWHITE, wxWHITE_PEN and wxWHITE_BRUSH will draw the background colour (i.e. 0) whereas all other colours will draw the foreground colour (i.e. 1).

A bitmap must be selected into the new memory DC before it may be used for anything. Typical usage is as follows:

Note that the memory DC must be deleted (or the bitmap selected out of it) before a bitmap can be reselected into another memory DC.

And, before performing any other operations on the bitmap data, the bitmap must be selected out of the memory DC:

This happens automatically when wxMemoryDC object goes out of scope.

See:

wxBitmap

wxDC

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxMemoryDC

Summary

Types

wxMemoryDC()

Functions

destroy(This)

Destroys the object

new()

Constructs a new memory device context.

new(Dc)

Constructs a new memory device context having the same characteristics as the given existing device context.

selectObject(This, Bitmap)

Works exactly like selectObjectAsSource/2 but this is the function you should use when you select a bitmap because you want to modify it, e.g.

selectObjectAsSource(This, Bitmap)

Selects the given bitmap into the device context, to use as the memory bitmap.

Types

wxMemoryDC()

-type wxMemoryDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxMemoryDC()) -> ok.

Destroys the object

new()

-spec new() -> wxMemoryDC().

Constructs a new memory device context.

Use the wxDC:isOk/1 member to test whether the constructor was successful in creating a usable device context. Don't forget to select a bitmap into the DC before drawing on it.

new(Dc)

-spec new(Dc) -> wxMemoryDC() when Dc :: wxDC:wxDC() | wxBitmap:wxBitmap().

Constructs a new memory device context having the same characteristics as the given existing device context.

This constructor creates a memory device context compatible with dc in wxMSW, the argument is ignored in the other ports. If dc is NULL, a device context compatible with the screen is created, just as with the default constructor.

selectObject(This, Bitmap)

-spec selectObject(This, Bitmap) -> ok when This :: wxMemoryDC(), Bitmap :: wxBitmap:wxBitmap().

Works exactly like selectObjectAsSource/2 but this is the function you should use when you select a bitmap because you want to modify it, e.g.

drawing on this DC.

Using selectObjectAsSource/2 when modifying the bitmap may incur some problems related to wxBitmap being a reference counted object (see overview_refcount).

Before using the updated bitmap data, make sure to select it out of context first either by selecting ?wxNullBitmap into the device context or destroying the device context entirely.

If the bitmap is already selected in this device context, nothing is done. If it is selected in another context, the function asserts and drawing on the bitmap won't work correctly.

See: wxDC:drawBitmap/4

selectObjectAsSource(This, Bitmap)

-spec selectObjectAsSource(This, Bitmap) -> ok when This :: wxMemoryDC(), Bitmap :: wxBitmap:wxBitmap().

Selects the given bitmap into the device context, to use as the memory bitmap.

Selecting the bitmap into a memory DC allows you to draw into the DC (and therefore the bitmap) and also to use wxDC:blit/6 to copy the bitmap to a window. For this purpose, you may find wxDC:drawIcon/3 easier to use instead.

If the argument is ?wxNullBitmap (or some other uninitialised wxBitmap) the current bitmap is selected out of the device context, and the original bitmap restored, allowing the current bitmap to be destroyed safely.

wxMenu

A menu is a popup (or pull down) list of items, one of which may be selected before the menu goes away (clicking elsewhere dismisses the menu).

Menus may be used to construct either menu bars or popup menus.

A menu item has an integer ID associated with it which can be used to identify the selection, or to change the menu item in some way. A menu item with a special identifier wxID_SEPARATOR is a separator item and doesn't have an associated command but just makes a separator line appear in the menu.

Note: Please note that wxID_ABOUT and wxID_EXIT are predefined by wxWidgets and have a special meaning since entries using these IDs will be taken out of the normal menus under macOS and will be inserted into the system menu (following the appropriate macOS interface guideline).

Menu items may be either normal items, check items or radio items. Normal items don't have any special properties while the check items have a boolean flag associated to them and they show a checkmark in the menu when the flag is set. wxWidgets automatically toggles the flag value when the item is clicked and its value may be retrieved using either isChecked/2 method of wxMenu or wxMenuBar itself or by using wxEvent::IsChecked when you get the menu notification for the item in question.

The radio items are similar to the check items except that all the other items in the same radio group are unchecked when a radio item is checked. The radio group is formed by a contiguous range of radio items, i.e. it starts at the first item of this kind and ends with the first item of a different kind (or the end of the menu). Notice that because the radio groups are defined in terms of the item positions inserting or removing the items in the menu containing the radio items risks to not work correctly.

Allocation strategy

All menus must be created on the heap because all menus attached to a menubar or to another menu will be deleted by their parent when it is deleted. The only exception to this rule are the popup menus (i.e. menus used with wxWindow:popupMenu/4) as wxWidgets does not destroy them to allow reusing the same menu more than once. But the exception applies only to the menus themselves and not to any submenus of popup menus which are still destroyed by wxWidgets as usual and so must be heap-allocated.

As the frame menubar is deleted by the frame itself, it means that normally all menus used are deleted automatically.

Event handling

Event handlers for the commands generated by the menu items can be connected directly to the menu object itself using wxEvtHandler::Bind() (not implemented in wx). If this menu is a submenu of another one, the events from its items can also be processed in the parent menu and so on, recursively.

If the menu is part of a menu bar, then events can also be handled in wxMenuBar object.

Finally, menu events can also be handled in the associated window, which is either the wxFrame associated with the menu bar this menu belongs to or the window for which wxWindow:popupMenu/4 was called for the popup menus.

See overview_events_bind for how to bind event handlers to the various objects.

See:

wxMenuBar

wxWindow:popupMenu/4

Overview events

This class is derived, and can use functions, from:

wxEvtHandler

wxWidgets docs: wxMenu

Summary

Types

wxMenu()

Functions

append(This, MenuItem)

Adds a menu item object.

append(This, Id, Item)

Equivalent to append(This, Id, Item, []).

append/4

Adds a menu item.

append/5

Adds a submenu.

appendCheckItem(This, Id, Item)

Equivalent to appendCheckItem(This, Id, Item, []).

appendCheckItem/4

Adds a checkable item to the end of the menu.

appendRadioItem(This, Id, Item)

Equivalent to appendRadioItem(This, Id, Item, []).

appendRadioItem/4

Adds a radio item to the end of the menu.

appendSeparator(This)

Adds a separator to the end of the menu.

break(This)

Inserts a break in a menu, causing the next appended item to appear in a new column.

check(This, Id, Check)

Checks or unchecks the menu item.

'Destroy'/2

Deletes the menu item from the menu.

delete/2

Deletes the menu item from the menu.

destroy(This)

Destroys the object

enable(This, Id, Enable)

Enables or disables (greys out) a menu item.

findItem/2

Finds the menu id for a menu item string.

findItemByPosition(This, Position)

Returns the wxMenuItem given a position in the menu.

getHelpString(This, Id)

Returns the help string associated with a menu item.

getLabel(This, Id)

Returns a menu item label.

getMenuItemCount(This)

Returns the number of items in the menu.

getMenuItems(This)

getTitle(This)

Returns the title of the menu.

insert/3

Inserts the given item before the position pos.

insert/4

Inserts the given item before the position pos.

insert(This, Pos, Id, Text, Submenu)

Equivalent to insert(This, Pos, Id, Text, Submenu, []).

insert/6

Inserts the given submenu before the position pos.

insertCheckItem(This, Pos, Id, Item)

Equivalent to insertCheckItem(This, Pos, Id, Item, []).

insertCheckItem/5

Inserts a checkable item at the given position.

insertRadioItem(This, Pos, Id, Item)

Equivalent to insertRadioItem(This, Pos, Id, Item, []).

insertRadioItem/5

Inserts a radio item at the given position.

insertSeparator(This, Pos)

Inserts a separator at the given position.

isChecked(This, Id)

Determines whether a menu item is checked.

isEnabled(This, Id)

Determines whether a menu item is enabled.

new()

Constructs a wxMenu object.

new(Options)

Constructs a wxMenu object.

new(Title, Options)

Constructs a wxMenu object with a title.

prepend/2

Inserts the given item at position 0, i.e. before all the other existing items.

prepend/3

Inserts the given item at position 0, i.e. before all the other existing items.

prepend(This, Id, Text, Submenu)

Equivalent to prepend(This, Id, Text, Submenu, []).

prepend/5

Inserts the given submenu at position 0.

prependCheckItem(This, Id, Item)

Equivalent to prependCheckItem(This, Id, Item, []).

prependCheckItem/4

Inserts a checkable item at position 0.

prependRadioItem(This, Id, Item)

Equivalent to prependRadioItem(This, Id, Item, []).

prependRadioItem/4

Inserts a radio item at position 0.

prependSeparator(This)

Inserts a separator at position 0.

remove/2

Removes the menu item from the menu but doesn't delete the associated C++ object.

setHelpString(This, Id, HelpString)

Sets an item's help string.

setLabel(This, Id, Label)

Sets the label of a menu item.

setTitle(This, Title)

Sets the title of the menu.

Types

wxMenu()

-type wxMenu() :: wx:wx_object().

Functions

append(This, MenuItem)

-spec append(This, MenuItem) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), MenuItem :: wxMenuItem:wxMenuItem().

Adds a menu item object.

This is the most generic variant of append/5 method because it may be used for both items (including separators) and submenus and because you can also specify various extra properties of a menu item this way, such as bitmaps and fonts.

Remark: See the remarks for the other append/5 overloads.

See:

appendSeparator/1

appendCheckItem/4

appendRadioItem/4

insert/6

setLabel/3

getHelpString/2

setHelpString/3

wxMenuItem

append(This, Id, Item)

-spec append(This, Id, Item) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata().

Equivalent to append(This, Id, Item, []).

append/4

-spec append(This, Id, Item, SubMenu) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata(), SubMenu :: wxMenu();
            (This, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                when
                    This :: wxMenu(),
                    Id :: integer(),
                    Item :: unicode:chardata(),
                    Option :: {help, unicode:chardata()} | {kind, wx:wx_enum()}.

Adds a menu item.

Example: or even better for stock menu items (see wxMenuItem:new/1):

Remark: This command can be used after the menu has been shown, as well as on initial creation of a menu or menubar.

See:

appendSeparator/1

appendCheckItem/4

appendRadioItem/4

insert/6

setLabel/3

getHelpString/2

setHelpString/3

wxMenuItem

append/5

-spec append(This, Id, Item, SubMenu, [Option]) -> wxMenuItem:wxMenuItem()
                when
                    This :: wxMenu(),
                    Id :: integer(),
                    Item :: unicode:chardata(),
                    SubMenu :: wxMenu(),
                    Option :: {help, unicode:chardata()}.

Adds a submenu.

Deprecated:

This function is deprecated, use AppendSubMenu() (not implemented in wx) instead.

See:

appendSeparator/1

appendCheckItem/4

appendRadioItem/4

insert/6

setLabel/3

getHelpString/2

setHelpString/3

wxMenuItem

appendCheckItem(This, Id, Item)

-spec appendCheckItem(This, Id, Item) -> wxMenuItem:wxMenuItem()
                         when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata().

Equivalent to appendCheckItem(This, Id, Item, []).

appendCheckItem/4

-spec appendCheckItem(This, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Id :: integer(),
                             Item :: unicode:chardata(),
                             Option :: {help, unicode:chardata()}.

Adds a checkable item to the end of the menu.

See:

append/5

insertCheckItem/5

appendRadioItem(This, Id, Item)

-spec appendRadioItem(This, Id, Item) -> wxMenuItem:wxMenuItem()
                         when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata().

Equivalent to appendRadioItem(This, Id, Item, []).

appendRadioItem/4

-spec appendRadioItem(This, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Id :: integer(),
                             Item :: unicode:chardata(),
                             Option :: {help, unicode:chardata()}.

Adds a radio item to the end of the menu.

All consequent radio items form a group and when an item in the group is checked, all the others are automatically unchecked.

Note: Radio items are not supported under wxMotif.

See:

append/5

insertRadioItem/5

appendSeparator(This)

-spec appendSeparator(This) -> wxMenuItem:wxMenuItem() when This :: wxMenu().

Adds a separator to the end of the menu.

See:

append/5

insertSeparator/2

break(This)

-spec break(This) -> ok when This :: wxMenu().

Inserts a break in a menu, causing the next appended item to appear in a new column.

This function only actually inserts a break in wxMSW and does nothing under the other platforms.

check(This, Id, Check)

-spec check(This, Id, Check) -> ok when This :: wxMenu(), Id :: integer(), Check :: boolean().

Checks or unchecks the menu item.

See: isChecked/2

'Destroy'/2

-spec 'Destroy'(This, Id) -> boolean() when This :: wxMenu(), Id :: integer();
               (This, Item) -> boolean() when This :: wxMenu(), Item :: wxMenuItem:wxMenuItem().

Deletes the menu item from the menu.

If the item is a submenu, it will be deleted. Use remove/2 if you want to keep the submenu (for example, to reuse it later).

See:

findItem/2

delete/2

remove/2

delete/2

-spec delete(This, Id) -> boolean() when This :: wxMenu(), Id :: integer();
            (This, Item) -> boolean() when This :: wxMenu(), Item :: wxMenuItem:wxMenuItem().

Deletes the menu item from the menu.

If the item is a submenu, it will not be deleted. Use 'Destroy'/2 if you want to delete a submenu.

See:

findItem/2

'Destroy'/2

remove/2

destroy(This)

-spec destroy(This :: wxMenu()) -> ok.

Destroys the object

enable(This, Id, Enable)

-spec enable(This, Id, Enable) -> ok when This :: wxMenu(), Id :: integer(), Enable :: boolean().

Enables or disables (greys out) a menu item.

See: isEnabled/2

findItem/2

-spec findItem(This, Id) -> wxMenuItem:wxMenuItem() when This :: wxMenu(), Id :: integer();
              (This, ItemString) -> integer() when This :: wxMenu(), ItemString :: unicode:chardata().

Finds the menu id for a menu item string.

Return: Menu item identifier, or wxNOT_FOUND if none is found.

Remark: Any special menu codes are stripped out of source and target strings before matching.

findItemByPosition(This, Position)

-spec findItemByPosition(This, Position) -> wxMenuItem:wxMenuItem()
                            when This :: wxMenu(), Position :: integer().

Returns the wxMenuItem given a position in the menu.

getHelpString(This, Id)

-spec getHelpString(This, Id) -> unicode:charlist() when This :: wxMenu(), Id :: integer().

Returns the help string associated with a menu item.

Return: The help string, or the empty string if there is no help string or the item was not found.

See:

setHelpString/3

append/5

getLabel(This, Id)

-spec getLabel(This, Id) -> unicode:charlist() when This :: wxMenu(), Id :: integer().

Returns a menu item label.

Return: The item label, or the empty string if the item was not found.

See: setLabel/3

getMenuItemCount(This)

-spec getMenuItemCount(This) -> integer() when This :: wxMenu().

Returns the number of items in the menu.

getMenuItems(This)

-spec getMenuItems(This) -> [wxMenuItem:wxMenuItem()] when This :: wxMenu().

getTitle(This)

-spec getTitle(This) -> unicode:charlist() when This :: wxMenu().

Returns the title of the menu.

See: setTitle/2

insert/3

-spec insert(This, Pos, Id) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), Pos :: integer(), Id :: integer();
            (This, Pos, MenuItem) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), Pos :: integer(), MenuItem :: wxMenuItem:wxMenuItem().

Inserts the given item before the position pos.

Inserting the item at position getMenuItemCount/1 is the same as appending it.

See:

append/5

prepend/5

insert/4

-spec insert(This, Pos, Id, [Option]) -> wxMenuItem:wxMenuItem()
                when
                    This :: wxMenu(),
                    Pos :: integer(),
                    Id :: integer(),
                    Option ::
                        {text, unicode:chardata()} | {help, unicode:chardata()} | {kind, wx:wx_enum()}.

Inserts the given item before the position pos.

Inserting the item at position getMenuItemCount/1 is the same as appending it.

See:

append/5

prepend/5

insert(This, Pos, Id, Text, Submenu)

-spec insert(This, Pos, Id, Text, Submenu) -> wxMenuItem:wxMenuItem()
                when
                    This :: wxMenu(),
                    Pos :: integer(),
                    Id :: integer(),
                    Text :: unicode:chardata(),
                    Submenu :: wxMenu().

Equivalent to insert(This, Pos, Id, Text, Submenu, []).

insert/6

-spec insert(This, Pos, Id, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem()
                when
                    This :: wxMenu(),
                    Pos :: integer(),
                    Id :: integer(),
                    Text :: unicode:chardata(),
                    Submenu :: wxMenu(),
                    Option :: {help, unicode:chardata()}.

Inserts the given submenu before the position pos.

text is the text shown in the menu for it and help is the help string shown in the status bar when the submenu item is selected.

See: prepend/5

insertCheckItem(This, Pos, Id, Item)

-spec insertCheckItem(This, Pos, Id, Item) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Pos :: integer(),
                             Id :: integer(),
                             Item :: unicode:chardata().

Equivalent to insertCheckItem(This, Pos, Id, Item, []).

insertCheckItem/5

-spec insertCheckItem(This, Pos, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Pos :: integer(),
                             Id :: integer(),
                             Item :: unicode:chardata(),
                             Option :: {help, unicode:chardata()}.

Inserts a checkable item at the given position.

See:

insert/6

appendCheckItem/4

insertRadioItem(This, Pos, Id, Item)

-spec insertRadioItem(This, Pos, Id, Item) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Pos :: integer(),
                             Id :: integer(),
                             Item :: unicode:chardata().

Equivalent to insertRadioItem(This, Pos, Id, Item, []).

insertRadioItem/5

-spec insertRadioItem(This, Pos, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                         when
                             This :: wxMenu(),
                             Pos :: integer(),
                             Id :: integer(),
                             Item :: unicode:chardata(),
                             Option :: {help, unicode:chardata()}.

Inserts a radio item at the given position.

See:

insert/6

appendRadioItem/4

insertSeparator(This, Pos)

-spec insertSeparator(This, Pos) -> wxMenuItem:wxMenuItem() when This :: wxMenu(), Pos :: integer().

Inserts a separator at the given position.

See:

insert/6

appendSeparator/1

isChecked(This, Id)

-spec isChecked(This, Id) -> boolean() when This :: wxMenu(), Id :: integer().

Determines whether a menu item is checked.

Return: true if the menu item is checked, false otherwise.

See: check/3

isEnabled(This, Id)

-spec isEnabled(This, Id) -> boolean() when This :: wxMenu(), Id :: integer().

Determines whether a menu item is enabled.

Return: true if the menu item is enabled, false otherwise.

See: enable/3

new()

-spec new() -> wxMenu().

Constructs a wxMenu object.

new(Options)

-spec new([Option]) -> wxMenu() when Option :: {style, integer()}.

Constructs a wxMenu object.

new(Title, Options)

-spec new(Title, [Option]) -> wxMenu() when Title :: unicode:chardata(), Option :: {style, integer()}.

Constructs a wxMenu object with a title.

prepend/2

-spec prepend(This, Id) -> wxMenuItem:wxMenuItem() when This :: wxMenu(), Id :: integer();
             (This, Item) -> wxMenuItem:wxMenuItem()
                 when This :: wxMenu(), Item :: wxMenuItem:wxMenuItem().

Inserts the given item at position 0, i.e. before all the other existing items.

See:

append/5

insert/6

prepend/3

-spec prepend(This, Id, [Option]) -> wxMenuItem:wxMenuItem()
                 when
                     This :: wxMenu(),
                     Id :: integer(),
                     Option ::
                         {text, unicode:chardata()} | {help, unicode:chardata()} | {kind, wx:wx_enum()}.

Inserts the given item at position 0, i.e. before all the other existing items.

See:

append/5

insert/6

prepend(This, Id, Text, Submenu)

-spec prepend(This, Id, Text, Submenu) -> wxMenuItem:wxMenuItem()
                 when This :: wxMenu(), Id :: integer(), Text :: unicode:chardata(), Submenu :: wxMenu().

Equivalent to prepend(This, Id, Text, Submenu, []).

prepend/5

-spec prepend(This, Id, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem()
                 when
                     This :: wxMenu(),
                     Id :: integer(),
                     Text :: unicode:chardata(),
                     Submenu :: wxMenu(),
                     Option :: {help, unicode:chardata()}.

Inserts the given submenu at position 0.

See: insert/6

prependCheckItem(This, Id, Item)

-spec prependCheckItem(This, Id, Item) -> wxMenuItem:wxMenuItem()
                          when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata().

Equivalent to prependCheckItem(This, Id, Item, []).

prependCheckItem/4

-spec prependCheckItem(This, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                          when
                              This :: wxMenu(),
                              Id :: integer(),
                              Item :: unicode:chardata(),
                              Option :: {help, unicode:chardata()}.

Inserts a checkable item at position 0.

See:

prepend/5

appendCheckItem/4

prependRadioItem(This, Id, Item)

-spec prependRadioItem(This, Id, Item) -> wxMenuItem:wxMenuItem()
                          when This :: wxMenu(), Id :: integer(), Item :: unicode:chardata().

Equivalent to prependRadioItem(This, Id, Item, []).

prependRadioItem/4

-spec prependRadioItem(This, Id, Item, [Option]) -> wxMenuItem:wxMenuItem()
                          when
                              This :: wxMenu(),
                              Id :: integer(),
                              Item :: unicode:chardata(),
                              Option :: {help, unicode:chardata()}.

Inserts a radio item at position 0.

See:

prepend/5

appendRadioItem/4

prependSeparator(This)

-spec prependSeparator(This) -> wxMenuItem:wxMenuItem() when This :: wxMenu().

Inserts a separator at position 0.

See:

prepend/5

appendSeparator/1

remove/2

-spec remove(This, Id) -> wxMenuItem:wxMenuItem() when This :: wxMenu(), Id :: integer();
            (This, Item) -> wxMenuItem:wxMenuItem()
                when This :: wxMenu(), Item :: wxMenuItem:wxMenuItem().

Removes the menu item from the menu but doesn't delete the associated C++ object.

This allows you to reuse the same item later by adding it back to the menu (especially useful with submenus).

Return: A pointer to the item which was detached from the menu.

setHelpString(This, Id, HelpString)

-spec setHelpString(This, Id, HelpString) -> ok
                       when This :: wxMenu(), Id :: integer(), HelpString :: unicode:chardata().

Sets an item's help string.

See: getHelpString/2

setLabel(This, Id, Label)

-spec setLabel(This, Id, Label) -> ok
                  when This :: wxMenu(), Id :: integer(), Label :: unicode:chardata().

Sets the label of a menu item.

See:

append/5

getLabel/2

setTitle(This, Title)

-spec setTitle(This, Title) -> ok when This :: wxMenu(), Title :: unicode:chardata().

Sets the title of the menu.

Remark: Notice that you can only call this method directly for the popup menus, to change the title of a menu that is part of a menu bar you need to use wxMenuBar:setLabelTop/3.

See: getTitle/1

wxMenuBar

A menu bar is a series of menus accessible from the top of a frame.

Remark: To respond to a menu selection, provide a handler for EVT_MENU, in the frame that contains the menu bar.

If you have a toolbar which uses the same identifiers as your EVT_MENU entries, events from the toolbar will also be processed by your EVT_MENU event handlers.

Tip: under Windows, if you discover that menu shortcuts (for example, Alt-F to show the file menu) are not working, check any EVT_CHAR events you are handling in child windows. If you are not calling event.Skip() for events that you don't process in these event handlers, menu shortcuts may cease to work.

See:

wxMenu

Overview events

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxMenuBar

Summary

Types

wxMenuBar()

Functions

append(This, Menu, Title)

Adds the item to the end of the menu bar.

check(This, Id, Check)

Checks or unchecks a menu item.

destroy(This)

Destroys the object

enable(This, Id, Enable)

Enables or disables (greys out) a menu item.

enableTop(This, Pos, Enable)

Enables or disables a whole menu.

findItem(This, Id)

Finds the menu item object associated with the given menu item identifier.

findMenu(This, Title)

Returns the index of the menu with the given title or wxNOT\_FOUND if no such menu exists in this menubar.

findMenuItem(This, MenuString, ItemString)

Finds the menu item id for a menu name/menu item string pair.

getAutoWindowMenu()

getHelpString(This, Id)

Gets the help string associated with the menu item identifier.

getLabel(This, Id)

Gets the label associated with a menu item.

getLabelTop(This, Pos)

Equivalent to: getMenuLabel/2

getMenu(This, MenuIndex)

Returns the menu at menuIndex (zero-based).

getMenuCount(This)

Returns the number of menus in this menubar.

getMenuLabel(This, Pos)

Returns the label of a top-level menu.

getMenuLabelText(This, Pos)

Returns the label of a top-level menu.

insert(This, Pos, Menu, Title)

Inserts the menu at the given position into the menu bar.

isChecked(This, Id)

Determines whether an item is checked.

isEnabled(This, Id)

Determines whether an item is enabled.

macGetCommonMenuBar()

Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

macSetCommonMenuBar(Menubar)

Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

new()

Construct an empty menu bar.

new(Style)

oSXGetAppleMenu(This)

Returns the Apple menu.

remove(This, Pos)

Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it.

replace(This, Pos, Menu, Title)

Replaces the menu at the given position with another one.

setAutoWindowMenu(Enable)

setHelpString(This, Id, HelpString)

Sets the help string associated with a menu item.

setLabel(This, Id, Label)

Sets the label of a menu item.

setLabelTop(This, Pos, Label)

Equivalent to: setMenuLabel/3

setMenuLabel(This, Pos, Label)

Sets the label of a top-level menu.

Types

wxMenuBar()

-type wxMenuBar() :: wx:wx_object().

Functions

append(This, Menu, Title)

-spec append(This, Menu, Title) -> boolean()
                when This :: wxMenuBar(), Menu :: wxMenu:wxMenu(), Title :: unicode:chardata().

Adds the item to the end of the menu bar.

Return: true on success, false if an error occurred.

See: insert/4

check(This, Id, Check)

-spec check(This, Id, Check) -> ok when This :: wxMenuBar(), Id :: integer(), Check :: boolean().

Checks or unchecks a menu item.

Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.

destroy(This)

-spec destroy(This :: wxMenuBar()) -> ok.

Destroys the object

enable(This, Id, Enable)

-spec enable(This, Id, Enable) -> ok when This :: wxMenuBar(), Id :: integer(), Enable :: boolean().

Enables or disables (greys out) a menu item.

Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call.

enableTop(This, Pos, Enable)

-spec enableTop(This, Pos, Enable) -> ok when This :: wxMenuBar(), Pos :: integer(), Enable :: boolean().

Enables or disables a whole menu.

Remark: Only use this when the menu bar has been associated with a frame.

findItem(This, Id)

-spec findItem(This, Id) -> wxMenuItem:wxMenuItem() when This :: wxMenuBar(), Id :: integer().

Finds the menu item object associated with the given menu item identifier.

Return: The found menu item object, or NULL if one was not found.

findMenu(This, Title)

-spec findMenu(This, Title) -> integer() when This :: wxMenuBar(), Title :: unicode:chardata().

Returns the index of the menu with the given title or wxNOT\_FOUND if no such menu exists in this menubar.

The title parameter may specify either the menu title (with accelerator characters, i.e. "&File") or just the menu label ("File") indifferently.

findMenuItem(This, MenuString, ItemString)

-spec findMenuItem(This, MenuString, ItemString) -> integer()
                      when
                          This :: wxMenuBar(),
                          MenuString :: unicode:chardata(),
                          ItemString :: unicode:chardata().

Finds the menu item id for a menu name/menu item string pair.

Return: The menu item identifier, or wxNOT_FOUND if none was found.

Remark: Any special menu codes are stripped out of source and target strings before matching.

getAutoWindowMenu()

-spec getAutoWindowMenu() -> boolean().

getHelpString(This, Id)

-spec getHelpString(This, Id) -> unicode:charlist() when This :: wxMenuBar(), Id :: integer().

Gets the help string associated with the menu item identifier.

Return: The help string, or the empty string if there was no help string or the menu item was not found.

See: setHelpString/3

getLabel(This, Id)

-spec getLabel(This, Id) -> unicode:charlist() when This :: wxMenuBar(), Id :: integer().

Gets the label associated with a menu item.

Return: The menu item label, or the empty string if the item was not found.

Remark: Use only after the menubar has been associated with a frame.

getLabelTop(This, Pos)

-spec getLabelTop(This, Pos) -> unicode:charlist() when This :: wxMenuBar(), Pos :: integer().

Equivalent to: getMenuLabel/2

getMenu(This, MenuIndex)

-spec getMenu(This, MenuIndex) -> wxMenu:wxMenu() when This :: wxMenuBar(), MenuIndex :: integer().

Returns the menu at menuIndex (zero-based).

getMenuCount(This)

-spec getMenuCount(This) -> integer() when This :: wxMenuBar().

Returns the number of menus in this menubar.

getMenuLabel(This, Pos)

-spec getMenuLabel(This, Pos) -> unicode:charlist() when This :: wxMenuBar(), Pos :: integer().

Returns the label of a top-level menu.

Note that the returned string includes the accelerator characters that have been specified in the menu title string during its construction.

Return: The menu label, or the empty string if the menu was not found.

Remark: Use only after the menubar has been associated with a frame.

See:

getMenuLabelText/2

setMenuLabel/3

getMenuLabelText(This, Pos)

-spec getMenuLabelText(This, Pos) -> unicode:charlist() when This :: wxMenuBar(), Pos :: integer().

Returns the label of a top-level menu.

Note that the returned string does not include any accelerator characters that may have been specified in the menu title string during its construction.

Return: The menu label, or the empty string if the menu was not found.

Remark: Use only after the menubar has been associated with a frame.

See:

getMenuLabel/2

setMenuLabel/3

insert(This, Pos, Menu, Title)

-spec insert(This, Pos, Menu, Title) -> boolean()
                when
                    This :: wxMenuBar(),
                    Pos :: integer(),
                    Menu :: wxMenu:wxMenu(),
                    Title :: unicode:chardata().

Inserts the menu at the given position into the menu bar.

Inserting menu at position 0 will insert it in the very beginning of it, inserting at position getMenuCount/1 is the same as calling append/3.

Return: true on success, false if an error occurred.

See: append/3

isChecked(This, Id)

-spec isChecked(This, Id) -> boolean() when This :: wxMenuBar(), Id :: integer().

Determines whether an item is checked.

Return: true if the item was found and is checked, false otherwise.

isEnabled(This, Id)

-spec isEnabled(This, Id) -> boolean() when This :: wxMenuBar(), Id :: integer().

Determines whether an item is enabled.

Return: true if the item was found and is enabled, false otherwise.

macGetCommonMenuBar()

-spec macGetCommonMenuBar() -> wxMenuBar().

Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

Return: The global menubar.

Remark: Only exists on Mac, other platforms do not have this method.

Only for:wxosx

macSetCommonMenuBar(Menubar)

-spec macSetCommonMenuBar(Menubar) -> ok when Menubar :: wxMenuBar().

Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open.

Remark: Only exists on Mac, other platforms do not have this method.

Only for:wxosx

new()

-spec new() -> wxMenuBar().

Construct an empty menu bar.

new(Style)

-spec new(Style) -> wxMenuBar() when Style :: integer().

oSXGetAppleMenu(This)

-spec oSXGetAppleMenu(This) -> wxMenu:wxMenu() when This :: wxMenuBar().

Returns the Apple menu.

This is the leftmost menu with application's name as its title. You shouldn't remove any items from it, but it is safe to insert extra menu items or submenus into it.

Only for:wxosx

Since: 3.0.1

remove(This, Pos)

-spec remove(This, Pos) -> wxMenu:wxMenu() when This :: wxMenuBar(), Pos :: integer().

Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it.

This function may be used together with insert/4 to change the menubar dynamically.

See: replace/4

replace(This, Pos, Menu, Title)

-spec replace(This, Pos, Menu, Title) -> wxMenu:wxMenu()
                 when
                     This :: wxMenuBar(),
                     Pos :: integer(),
                     Menu :: wxMenu:wxMenu(),
                     Title :: unicode:chardata().

Replaces the menu at the given position with another one.

Return: The menu which was previously at position pos. The caller is responsible for deleting it.

See:

insert/4

remove/2

setAutoWindowMenu(Enable)

-spec setAutoWindowMenu(Enable) -> ok when Enable :: boolean().

setHelpString(This, Id, HelpString)

-spec setHelpString(This, Id, HelpString) -> ok
                       when This :: wxMenuBar(), Id :: integer(), HelpString :: unicode:chardata().

Sets the help string associated with a menu item.

See: getHelpString/2

setLabel(This, Id, Label)

-spec setLabel(This, Id, Label) -> ok
                  when This :: wxMenuBar(), Id :: integer(), Label :: unicode:chardata().

Sets the label of a menu item.

Remark: Use only after the menubar has been associated with a frame.

See: getLabel/2

setLabelTop(This, Pos, Label)

-spec setLabelTop(This, Pos, Label) -> ok
                     when This :: wxMenuBar(), Pos :: integer(), Label :: unicode:chardata().

Equivalent to: setMenuLabel/3

setMenuLabel(This, Pos, Label)

-spec setMenuLabel(This, Pos, Label) -> ok
                      when This :: wxMenuBar(), Pos :: integer(), Label :: unicode:chardata().

Sets the label of a top-level menu.

Remark: Use only after the menubar has been associated with a frame.

wxMenuEvent

This class is used for a variety of menu-related events.

Note that these do not include menu command events, which are handled using wxCommandEvent objects.

Events of this class are generated by both menus that are part of a wxMenuBar, attached to wxFrame, and popup menus shown by wxWindow:popupMenu/4. They are sent to the following objects until one of them handles the event: -# The menu object itself, as returned by GetMenu(), if any. -# The wxMenuBar to which this menu is attached, if any. -# The window associated with the menu, e.g. the one calling PopupMenu() for the popup menus. -# The top level parent of that window if it's different from the window itself. This is similar to command events generated by the menu items, but, unlike them, wxMenuEvent are only sent to the window itself and its top level parent but not any intermediate windows in the hierarchy.

The default handler for wxEVT_MENU_HIGHLIGHT in wxFrame displays help text in the status bar, see wxFrame:setStatusBarPane/2.

See:

wxCommandEvent

Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMenuEvent

Events

Use wxEvtHandler:connect/3 with wxMenuEventType to subscribe to events of this type.

Summary

Types

wxMenu()

wxMenuEvent()

wxMenuEventType()

Functions

getMenu(This)

Returns the menu which is being opened or closed, or the menu containing the highlighted item.

getMenuId(This)

Returns the menu identifier associated with the event.

isPopup(This)

Returns true if the menu which is being opened or closed is a popup menu, false if it is a normal one.

Types

wxMenu()

-type wxMenu() ::
          #wxMenu{type :: wxMenuEvent:wxMenuEventType(), menuId :: integer(), menu :: wxMenu:wxMenu()}.

wxMenuEvent()

-type wxMenuEvent() :: wx:wx_object().

wxMenuEventType()

-type wxMenuEventType() :: menu_open | menu_close | menu_highlight.

Functions

getMenu(This)

-spec getMenu(This) -> wxMenu:wxMenu() when This :: wxMenuEvent().

Returns the menu which is being opened or closed, or the menu containing the highlighted item.

Note that the returned value can be NULL if the menu being opened doesn't have a corresponding wxMenu, e.g. this happens when opening the system menu in wxMSW port.

Remark: Since 3.1.3 this function can be used with OPEN, CLOSE and HIGHLIGHT events. Before 3.1.3, this method can only be used with the OPEN and CLOSE events.

getMenuId(This)

-spec getMenuId(This) -> integer() when This :: wxMenuEvent().

Returns the menu identifier associated with the event.

This method should be only used with the HIGHLIGHT events.

isPopup(This)

-spec isPopup(This) -> boolean() when This :: wxMenuEvent().

Returns true if the menu which is being opened or closed is a popup menu, false if it is a normal one.

This method should only be used with the OPEN and CLOSE events.

wxMenuItem

A menu item represents an item in a menu.

Note that you usually don't have to deal with it directly as wxMenu methods usually construct an object of this class for you.

Also please note that the methods related to fonts and bitmaps are currently only implemented for Windows, Mac and GTK+.

See:

wxMenuBar

wxMenu

wxWidgets docs: wxMenuItem

Events

Event types emitted from this class:

menu_open

menu_close

menu_highlight

Summary

Types

wxMenuItem()

Functions

check(This)

Equivalent to check(This, []).

check/2

Checks or unchecks the menu item.

destroy(This)

Destroys the object

enable(This)

Equivalent to enable(This, []).

enable/2

Enables or disables the menu item.

getBitmap(This)

Returns the checked or unchecked bitmap.

getHelp(This)

Returns the help string associated with the menu item.

getId(This)

Returns the menu item identifier.

getItemLabel(This)

Returns the text associated with the menu item including any accelerator characters that were passed to the constructor or setItemLabel/2.

getItemLabelText(This)

Returns the text associated with the menu item, without any accelerator characters.

getKind(This)

Returns the item kind, one of wxITEM_SEPARATOR, wxITEM_NORMAL, wxITEM_CHECK or wxITEM_RADIO.

getLabel(This)

Equivalent to: getItemLabelText/1

getLabelFromText(Text)

Equivalent to: getLabelText/1

getLabelText(Text)

Strips all accelerator characters and mnemonics from the given text.

getMenu(This)

Returns the menu this menu item is in, or NULL if this menu item is not attached.

getSubMenu(This)

Returns the submenu associated with the menu item, or NULL if there isn't one.

getText(This)

Equivalent to: getItemLabel/1

isCheckable(This)

Returns true if the item is checkable.

isChecked(This)

Returns true if the item is checked.

isEnabled(This)

Returns true if the item is enabled.

isSeparator(This)

Returns true if the item is a separator.

isSubMenu(This)

Returns true if the item is a submenu.

new()

Equivalent to new([]).

new(Options)

Constructs a wxMenuItem object.

setBitmap(This, Bmp)

Sets the bitmap for the menu item.

setHelp(This, HelpString)

Sets the help string.

setItemLabel(This, Label)

Sets the label associated with the menu item.

setMenu(This, Menu)

Sets the parent menu which will contain this menu item.

setSubMenu(This, Menu)

Sets the submenu of this menu item.

setText(This, Label)

Equivalent to: setItemLabel/2

Types

wxMenuItem()

-type wxMenuItem() :: wx:wx_object().

Functions

check(This)

-spec check(This) -> ok when This :: wxMenuItem().

Equivalent to check(This, []).

check/2

-spec check(This, [Option]) -> ok when This :: wxMenuItem(), Option :: {check, boolean()}.

Checks or unchecks the menu item.

Note that this only works when the item is already appended to a menu.

destroy(This)

-spec destroy(This :: wxMenuItem()) -> ok.

Destroys the object

enable(This)

-spec enable(This) -> ok when This :: wxMenuItem().

Equivalent to enable(This, []).

enable/2

-spec enable(This, [Option]) -> ok when This :: wxMenuItem(), Option :: {enable, boolean()}.

Enables or disables the menu item.

getBitmap(This)

-spec getBitmap(This) -> wxBitmap:wxBitmap() when This :: wxMenuItem().

Returns the checked or unchecked bitmap.

Only for:wxmsw

getHelp(This)

-spec getHelp(This) -> unicode:charlist() when This :: wxMenuItem().

Returns the help string associated with the menu item.

getId(This)

-spec getId(This) -> integer() when This :: wxMenuItem().

Returns the menu item identifier.

getItemLabel(This)

-spec getItemLabel(This) -> unicode:charlist() when This :: wxMenuItem().

Returns the text associated with the menu item including any accelerator characters that were passed to the constructor or setItemLabel/2.

See:

getItemLabelText/1

getLabelText/1

getItemLabelText(This)

-spec getItemLabelText(This) -> unicode:charlist() when This :: wxMenuItem().

Returns the text associated with the menu item, without any accelerator characters.

See:

getItemLabel/1

getLabelText/1

getKind(This)

-spec getKind(This) -> wx:wx_enum() when This :: wxMenuItem().

Returns the item kind, one of wxITEM_SEPARATOR, wxITEM_NORMAL, wxITEM_CHECK or wxITEM_RADIO.

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxMenuItem().

Equivalent to: getItemLabelText/1

getLabelFromText(Text)

-spec getLabelFromText(Text) -> unicode:charlist() when Text :: unicode:chardata().

Equivalent to: getLabelText/1

getLabelText(Text)

-spec getLabelText(Text) -> unicode:charlist() when Text :: unicode:chardata().

Strips all accelerator characters and mnemonics from the given text.

For example:

will return just "Hello".

See:

getItemLabelText/1

getItemLabel/1

getMenu(This)

-spec getMenu(This) -> wxMenu:wxMenu() when This :: wxMenuItem().

Returns the menu this menu item is in, or NULL if this menu item is not attached.

getSubMenu(This)

-spec getSubMenu(This) -> wxMenu:wxMenu() when This :: wxMenuItem().

Returns the submenu associated with the menu item, or NULL if there isn't one.

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxMenuItem().

Equivalent to: getItemLabel/1

isCheckable(This)

-spec isCheckable(This) -> boolean() when This :: wxMenuItem().

Returns true if the item is checkable.

Notice that the radio buttons are considered to be checkable as well, so this method returns true for them too. Use IsCheck() (not implemented in wx) if you want to test for the check items only.

isChecked(This)

-spec isChecked(This) -> boolean() when This :: wxMenuItem().

Returns true if the item is checked.

isEnabled(This)

-spec isEnabled(This) -> boolean() when This :: wxMenuItem().

Returns true if the item is enabled.

isSeparator(This)

-spec isSeparator(This) -> boolean() when This :: wxMenuItem().

Returns true if the item is a separator.

isSubMenu(This)

-spec isSubMenu(This) -> boolean() when This :: wxMenuItem().

Returns true if the item is a submenu.

new()

-spec new() -> wxMenuItem().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxMenuItem()
             when
                 Option ::
                     {parentMenu, wxMenu:wxMenu()} |
                     {id, integer()} |
                     {text, unicode:chardata()} |
                     {help, unicode:chardata()} |
                     {kind, wx:wx_enum()} |
                     {subMenu, wxMenu:wxMenu()}.

Constructs a wxMenuItem object.

Menu items can be standard, or "stock menu items", or custom. For the standard menu items (such as commands to open a file, exit the program and so on, see page_stockitems for the full list) it is enough to specify just the stock ID and leave text and help string empty. Some platforms (currently wxGTK only, and see the remark in setBitmap/2 documentation) will also show standard bitmaps for stock menu items.

Leaving at least text empty for the stock menu items is actually strongly recommended as they will have appearance and keyboard interface (including standard accelerators) familiar to the user.

For the custom (non-stock) menu items, text must be specified and while help string may be left empty, it's recommended to pass the item description (which is automatically shown by the library in the status bar when the menu item is selected) in this parameter.

Finally note that you can e.g. use a stock menu label without using its stock help string:

that is, stock properties are set independently one from the other.

setBitmap(This, Bmp)

-spec setBitmap(This, Bmp) -> ok when This :: wxMenuItem(), Bmp :: wxBitmap:wxBitmap().

Sets the bitmap for the menu item.

It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if checked is true (default value) or SetBitmaps(wxNullBitmap, bmp) otherwise.

setBitmap/2 must be called before the item is appended to the menu, i.e. appending the item without a bitmap and setting one later is not guaranteed to work. But the bitmap can be changed or reset later if it had been set up initially.

Notice that GTK+ uses a global setting called gtk-menu-images to determine if the images should be shown in the menus at all. If it is off (which is the case in e.g. Gnome 2.28 by default), no images will be shown, consistently with the native behaviour.

Only for:wxmsw,wxosx,wxgtk

setHelp(This, HelpString)

-spec setHelp(This, HelpString) -> ok when This :: wxMenuItem(), HelpString :: unicode:chardata().

Sets the help string.

setItemLabel(This, Label)

-spec setItemLabel(This, Label) -> ok when This :: wxMenuItem(), Label :: unicode:chardata().

Sets the label associated with the menu item.

Note that if the ID of this menu item corresponds to a stock ID, then it is not necessary to specify a label: wxWidgets will automatically use the stock item label associated with that ID. See the new/1 for more info.

The label string for the normal menu items (not separators) may include the accelerator which can be used to activate the menu item from keyboard. An accelerator key can be specified using the ampersand & character. In order to embed an ampersand character in the menu item text, the ampersand must be doubled.

Optionally you can specify also an accelerator string appending a tab character \t followed by a valid key combination (e.g. CTRL+V). Its general syntax is any combination of "CTRL", "RAWCTRL", "ALT" and "SHIFT" strings (case doesn't matter) separated by either '-' or '+' characters and followed by the accelerator itself. Notice that CTRL corresponds to the "Ctrl" key on most platforms but not under macOS where it is mapped to "Cmd" key on Mac keyboard. Usually this is exactly what you want in portable code but if you really need to use the (rarely used for this purpose) "Ctrl" key even under Mac, you may use RAWCTRL to prevent this mapping. Under the other platforms RAWCTRL is the same as plain CTRL.

The accelerator may be any alphanumeric character, any function key (from F1 to F12), any numpad digit key using KP_ prefix (i.e. from KP_0 to KP_9) or one of the special strings listed below (again, case doesn't matter) corresponding to the specified key code:

Del or Delete: WXK_DELETE

Back: WXK_BACK

Ins or Insert: WXK_INSERT

Enter or Return: WXK_RETURN

PgUp or PageUp: WXK_PAGEUP

PgDn or PageDown: WXK_PAGEDOWN

Left: WXK_LEFT

Right: WXK_RIGHT

Up: WXK_UP

Down: WXK_DOWN

Home: WXK_HOME

End: WXK_END

Space: WXK_SPACE

Tab: WXK_TAB

Esc or Escape: WXK_ESCAPE

Cancel: WXK_CANCEL

Clear: WXK_CLEAR

Menu: WXK_MENU

Pause: WXK_PAUSE

Capital: WXK_CAPITAL

Select: WXK_SELECT

Print: WXK_PRINT

Execute: WXK_EXECUTE

Snapshot: WXK_SNAPSHOT

Help: WXK_HELP

Add: WXK_ADD

Separator: WXK_SEPARATOR

Subtract: WXK_SUBTRACT

Decimal: WXK_DECIMAL

Divide: WXK_DIVIDE

Num_lock: WXK_NUMLOCK

Scroll_lock: WXK_SCROLL

KP_Space: WXK_NUMPAD_SPACE

KP_Tab: WXK_NUMPAD_TAB

KP_Enter: WXK_NUMPAD_ENTER

KP_Home: WXK_NUMPAD_HOME

KP_Left: WXK_NUMPAD_LEFT

KP_Up: WXK_NUMPAD_UP

KP_Right: WXK_NUMPAD_RIGHT

KP_Down: WXK_NUMPAD_DOWN

KP_PageUp: WXK_NUMPAD_PAGEUP

KP_PageDown: WXK_NUMPAD_PAGEDOWN

KP_Prior: WXK_NUMPAD_PAGEUP

KP_Next: WXK_NUMPAD_PAGEDOWN

KP_End: WXK_NUMPAD_END

KP_Begin: WXK_NUMPAD_BEGIN

KP_Insert: WXK_NUMPAD_INSERT

KP_Delete: WXK_NUMPAD_DELETE

KP_Equal: WXK_NUMPAD_EQUAL

KP_Multiply: WXK_NUMPAD_MULTIPLY

KP_Add: WXK_NUMPAD_ADD

KP_Separator: WXK_NUMPAD_SEPARATOR

KP_Subtract: WXK_NUMPAD_SUBTRACT

KP_Decimal: WXK_NUMPAD_DECIMAL

KP_Divide: WXK_NUMPAD_DIVIDE

Windows_Left: WXK_WINDOWS_LEFT

Windows_Right: WXK_WINDOWS_RIGHT

Windows_Menu: WXK_WINDOWS_MENU

Command: WXK_COMMAND

Examples:

Note: In wxGTK using "SHIFT" with non-alphabetic characters currently doesn't work, even in combination with other modifiers, due to GTK+ limitation. E.g. Shift+Ctrl+A works but Shift+Ctrl+1 or Shift+/ do not, so avoid using accelerators of this form in portable code.

Note: In wxGTk, the left/right/up/down arrow keys do not work as accelerator keys for a menu item unless a modifier key is used. Additionally, the following keycodes are not supported as menu accelerator keys:

WXK_COMMAND/WXK_CONTROL

WXK_SHIFT

WXK_ALT

WXK_SCROLL

WXK_CAPITAL

WXK_NUMLOCK

WXK_NUMPAD_TAB

WXK_TAB

WXK_WINDOWS_LEFT

WXK_WINDOWS_RIGHT

WXK_ADD

WXK_SEPARATOR

WXK_SUBTRACT

WXK_DECIMAL

WXK_DIVIDE

WXK_SNAPSHOT

See:

getItemLabel/1

getItemLabelText/1

setMenu(This, Menu)

-spec setMenu(This, Menu) -> ok when This :: wxMenuItem(), Menu :: wxMenu:wxMenu().

Sets the parent menu which will contain this menu item.

setSubMenu(This, Menu)

-spec setSubMenu(This, Menu) -> ok when This :: wxMenuItem(), Menu :: wxMenu:wxMenu().

Sets the submenu of this menu item.

setText(This, Label)

-spec setText(This, Label) -> ok when This :: wxMenuItem(), Label :: unicode:chardata().

Equivalent to: setItemLabel/2

wxMessageDialog

This class represents a dialog that shows a single or multi-line message, with a choice of OK, Yes, No and Cancel buttons.

Styles

This class supports the following styles:

wxOK: Puts an Ok button in the message box. May be combined with wxCANCEL.

wxCANCEL: Puts a Cancel button in the message box. Must be combined with either wxOK or wxYES_NO.

wxYES_NO: Puts Yes and No buttons in the message box. It is recommended to always use wxCANCEL with this style as otherwise the message box won't have a close button under wxMSW and the user will be forced to answer it.

wxHELP: Puts a Help button to the message box. This button can have special appearance or be specially positioned if its label is not changed from the default one. Notice that using this button is not supported when showing a message box from non-main thread in wxOSX/Cocoa. Available since wxWidgets 2.9.3.

wxNO_DEFAULT: Makes the "No" button default, can only be used with wxYES_NO.

wxCANCEL_DEFAULT: Makes the "Cancel" button default, can only be used with wxCANCEL. This style is currently not supported (and ignored) in wxOSX.

wxYES_DEFAULT: Makes the "Yes" button default, this is the default behaviour and this flag exists solely for symmetry with wxNO_DEFAULT.

wxOK_DEFAULT: Makes the "OK" button default, this is the default behaviour and this flag exists solely for symmetry with wxCANCEL_DEFAULT.

wxICON_NONE: Displays no icon in the dialog if possible (an icon might still be displayed if the current platform mandates its use). This style may be used to prevent the dialog from using the default icon based on wxYES_NO presence as explained in wxICON_QUESTION and wxICON_INFORMATION documentation below.

wxICON_ERROR: Displays an error icon in the dialog.

wxICON_WARNING: Displays a warning icon in the dialog. This style should be used for informative warnings or, in combination with wxYES_NO or wxCANCEL, for questions that have potentially serious consequences (caution icon is used on macOS in this case).

wxICON_QUESTION: Displays a question mark symbol. This icon is automatically used with wxYES_NO so it's usually unnecessary to specify it explicitly. This style is not supported for message dialogs under wxMSW when a task dialog is used to implement them (i.e. when running under Windows Vista or later) because Microsoft guidelines indicate that no icon should be used for routine confirmations. If it is specified, no icon will be displayed.

wxICON_INFORMATION: Displays an information symbol. This icon is used by default if wxYES_NO is not given so it is usually unnecessary to specify it explicitly.

wxICON_EXCLAMATION: Alias for wxICON_WARNING.

wxICON_HAND: Alias for wxICON_ERROR.

wxICON_AUTH_NEEDED: Displays an authentication needed symbol. This style is only supported for message dialogs under wxMSW when a task dialog is used to implement them (i.e. when running under Windows Vista or later). In other cases the default icon selection logic will be used. Note this can be combined with other styles to provide a fallback. For instance, using wxICON_AUTH_NEEDED | wxICON_QUESTION will show a shield symbol on Windows Vista or above and a question symbol on other platforms. Available since wxWidgets 2.9.5

wxSTAY_ON_TOP: Makes the message box stay on top of all other windows and not only just its parent (currently implemented only under MSW and GTK).

wxCENTRE: Centre the message box on its parent or on the screen if parent is not specified. Setting this style under MSW makes no differences as the dialog is always centered on the parent.

See: Overview cmndlg

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxMessageDialog

Summary

Types

wxMessageDialog()

Functions

destroy(This)

Destroys the object

new(Parent, Message)

Equivalent to new(Parent, Message, []).

new/3

Constructor specifying the message box properties.

Types

wxMessageDialog()

-type wxMessageDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxMessageDialog()) -> ok.

Destroys the object

new(Parent, Message)

-spec new(Parent, Message) -> wxMessageDialog()
             when Parent :: wxWindow:wxWindow(), Message :: unicode:chardata().

Equivalent to new(Parent, Message, []).

new/3

-spec new(Parent, Message, [Option]) -> wxMessageDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Option ::
                     {caption, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}}.

Constructor specifying the message box properties.

Use wxDialog:showModal/1 to show the dialog.

style may be a bit list of the identifiers described above.

Notice that not all styles are compatible: only one of wxOK and wxYES_NO may be specified (and one of them must be specified) and at most one default button style can be used and it is only valid if the corresponding button is shown in the message box.

wxMiniFrame

A miniframe is a frame with a small title bar.

It is suitable for floating toolbars that must not take up too much screen area.

An example of mini frame can be seen in the page_samples_dialogs using the "Mini frame" command of the "Generic dialogs" submenu.

Styles

This class supports the following styles:

wxICONIZE: Display the frame iconized (minimized) (Windows only).

wxCAPTION: Puts a caption on the frame.

wxMINIMIZE: Identical to wxICONIZE.

wxMINIMIZE_BOX: Displays a minimize box on the frame (Windows and Motif only).

wxMAXIMIZE: Displays the frame maximized (Windows only).

wxMAXIMIZE_BOX: Displays a maximize box on the frame (Windows and Motif only).

wxCLOSE_BOX: Displays a close box on the frame.

wxSTAY_ON_TOP: Stay on top of other windows (Windows only).

wxSYSTEM_MENU: Displays a system menu (Windows and Motif only).

wxRESIZE_BORDER: Displays a resizable border around the window.

Remark: This class has miniframe functionality under Windows and GTK, i.e. the presence of mini frame will not be noted in the task bar and focus behaviour is different. On other platforms, it behaves like a normal frame.

See:

wxMDIParentFrame

wxMDIChildFrame

wxFrame

wxDialog

This class is derived, and can use functions, from:

wxFrame

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxMiniFrame

Summary

Types

wxMiniFrame()

Functions

create(This, Parent, Id, Title)

Equivalent to create(This, Parent, Id, Title, []).

create/5

Used in two-step frame construction.

destroy(This)

Destroys the object

new()

Default ctor.

new(Parent, Id, Title)

Equivalent to new(Parent, Id, Title, []).

new/4

Constructor, creating the window.

Types

wxMiniFrame()

-type wxMiniFrame() :: wx:wx_object().

Functions

create(This, Parent, Id, Title)

-spec create(This, Parent, Id, Title) -> boolean()
                when
                    This :: wxMiniFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata().

Equivalent to create(This, Parent, Id, Title, []).

create/5

-spec create(This, Parent, Id, Title, [Option]) -> boolean()
                when
                    This :: wxMiniFrame(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Title :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Used in two-step frame construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxMiniFrame()) -> ok.

Destroys the object

new()

-spec new() -> wxMiniFrame().

Default ctor.

new(Parent, Id, Title)

-spec new(Parent, Id, Title) -> wxMiniFrame()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Title :: unicode:chardata().

Equivalent to new(Parent, Id, Title, []).

new/4

-spec new(Parent, Id, Title, [Option]) -> wxMiniFrame()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Title :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating the window.

Remark: The frame behaves like a normal frame on non-Windows platforms.

See: create/5

wxMirrorDC

wxMirrorDC is a simple wrapper class which is always associated with a real wxDC object and either forwards all of its operations to it without changes (no mirroring takes place) or exchanges x and y coordinates which makes it possible to reuse the same code to draw a figure and its mirror -- i.e.

reflection related to the diagonal line x == y.

Since: 2.5.0

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxMirrorDC

Summary

Types

wxMirrorDC()

Functions

destroy(This)

Destroys the object

new(Dc, Mirror)

Creates a (maybe) mirrored DC associated with the real dc.

Types

wxMirrorDC()

-type wxMirrorDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxMirrorDC()) -> ok.

Destroys the object

new(Dc, Mirror)

-spec new(Dc, Mirror) -> wxMirrorDC() when Dc :: wxDC:wxDC(), Mirror :: boolean().

Creates a (maybe) mirrored DC associated with the real dc.

Everything drawn on wxMirrorDC will appear (and maybe mirrored) on dc.

mirror specifies if we do mirror (if it is true) or not (if it is false).

wxMouseCaptureChangedEvent

An mouse capture changed event is sent to a window that loses its mouse capture.

This is called even if wxWindow:releaseMouse/1 was called by the application code. Handling this event allows an application to cater for unexpected capture releases which might otherwise confuse mouse handling code.

Only for:wxmsw

See:

wxMouseCaptureLostEvent

Overview events

wxWindow:captureMouse/1

wxWindow:releaseMouse/1

wxWindow:getCapture/0

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMouseCaptureChangedEvent

Events

Use wxEvtHandler:connect/3 with wxMouseCaptureChangedEventType to subscribe to events of this type.

Summary

Types

wxMouseCaptureChanged()

wxMouseCaptureChangedEvent()

wxMouseCaptureChangedEventType()

Functions

getCapturedWindow(This)

Returns the window that gained the capture, or NULL if it was a non-wxWidgets window.

Types

wxMouseCaptureChanged()

-type wxMouseCaptureChanged() ::
          #wxMouseCaptureChanged{type :: wxMouseCaptureChangedEvent:wxMouseCaptureChangedEventType()}.

wxMouseCaptureChangedEvent()

-type wxMouseCaptureChangedEvent() :: wx:wx_object().

wxMouseCaptureChangedEventType()

-type wxMouseCaptureChangedEventType() :: mouse_capture_changed.

Functions

getCapturedWindow(This)

-spec getCapturedWindow(This) -> wxWindow:wxWindow() when This :: wxMouseCaptureChangedEvent().

Returns the window that gained the capture, or NULL if it was a non-wxWidgets window.

wxMouseCaptureLostEvent

A mouse capture lost event is sent to a window that had obtained mouse capture, which was subsequently lost due to an "external" event (for example, when a dialog box is shown or if another application captures the mouse).

If this happens, this event is sent to all windows that are on the capture stack (i.e. called CaptureMouse, but didn't call ReleaseMouse yet). The event is not sent if the capture changes because of a call to CaptureMouse or ReleaseMouse.

This event is currently emitted under Windows only.

See:

wxMouseCaptureChangedEvent

Overview events

wxWindow:captureMouse/1

wxWindow:releaseMouse/1

wxWindow:getCapture/0

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMouseCaptureLostEvent

Events

Use wxEvtHandler:connect/3 with wxMouseCaptureLostEventType to subscribe to events of this type.

Summary

Types

wxMouseCaptureLost()

wxMouseCaptureLostEvent()

wxMouseCaptureLostEventType()

Types

wxMouseCaptureLost()

-type wxMouseCaptureLost() ::
          #wxMouseCaptureLost{type :: wxMouseCaptureLostEvent:wxMouseCaptureLostEventType()}.

wxMouseCaptureLostEvent()

-type wxMouseCaptureLostEvent() :: wx:wx_object().

wxMouseCaptureLostEventType()

-type wxMouseCaptureLostEventType() :: mouse_capture_lost.

wxMouseEvent

This event class contains information about the events generated by the mouse: they include mouse buttons press and release events and mouse move events.

All mouse events involving the buttons use wxMOUSE_BTN_LEFT for the left mouse button, wxMOUSE_BTN_MIDDLE for the middle one and wxMOUSE_BTN_RIGHT for the right one. And if the system supports more buttons, the wxMOUSE_BTN_AUX1 and wxMOUSE_BTN_AUX2 events can also be generated. Note that not all mice have even a middle button so a portable application should avoid relying on the events from it (but the right button click can be emulated using the left mouse button with the control key under Mac platforms with a single button mouse).

For the wxEVT_ENTER_WINDOW and wxEVT_LEAVE_WINDOW events purposes, the mouse is considered to be inside the window if it is in the window client area and not inside one of its children. In other words, the parent window receives wxEVT_LEAVE_WINDOW event not only when the mouse leaves the window entirely but also when it enters one of its children.

The position associated with a mouse event is expressed in the window coordinates of the window which generated the event, you can use wxWindow:clientToScreen/3 to convert it to screen coordinates and possibly call wxWindow:screenToClient/2 next to convert it to window coordinates of another window.

Note: Note the difference between methods like leftDown/1 and the inherited leftIsDown/1: the former returns true when the event corresponds to the left mouse button click while the latter returns true if the left mouse button is currently being pressed. For example, when the user is dragging the mouse you can use leftIsDown/1 to test whether the left mouse button is (still) depressed. Also, by convention, if leftDown/1 returns true, leftIsDown/1 will also return true in wxWidgets whatever the underlying GUI behaviour is (which is platform-dependent). The same applies, of course, to other mouse buttons as well.

See: wxKeyEvent

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMouseEvent

Events

Use wxEvtHandler:connect/3 with wxMouseEventType to subscribe to events of this type.

Summary

Types

wxMouse()

wxMouseEvent()

wxMouseEventType()

Functions

altDown(This)

Returns true if the Alt key is pressed.

aux1DClick(This)

Returns true if the event was a first extra button double click.

aux1Down(This)

Returns true if the first extra button mouse button changed to down.

aux1Up(This)

Returns true if the first extra button mouse button changed to up.

aux2DClick(This)

Returns true if the event was a second extra button double click.

aux2Down(This)

Returns true if the second extra button mouse button changed to down.

aux2Up(This)

Returns true if the second extra button mouse button changed to up.

button(This, But)

Returns true if the event was generated by the specified button.

buttonDClick(This)

Equivalent to buttonDClick(This, []).

buttonDClick/2

If the argument is omitted, this returns true if the event was a mouse double click event.

buttonDown(This)

Equivalent to buttonDown(This, []).

buttonDown/2

If the argument is omitted, this returns true if the event was a mouse button down event.

buttonUp(This)

Equivalent to buttonUp(This, []).

buttonUp/2

If the argument is omitted, this returns true if the event was a mouse button up event.

cmdDown(This)

Returns true if the key used for command accelerators is pressed.

controlDown(This)

Returns true if the Control key or Apple/Command key under macOS is pressed.

dragging(This)

Returns true if this was a dragging event (motion while a button is depressed).

entering(This)

Returns true if the mouse was entering the window.

getButton(This)

Returns the mouse button which generated this event or wxMOUSE\_BTN\_NONE if no button is involved (for mouse move, enter or leave event, for example).

getLinesPerAction(This)

Returns the configured number of lines (or whatever) to be scrolled per wheel action.

getLogicalPosition(This, Dc)

Returns the logical mouse position in pixels (i.e. translated according to the translation set for the DC, which usually indicates that the window has been scrolled).

getPosition(This)

Returns the physical mouse position.

getWheelAxis(This)

Gets the axis the wheel operation concerns.

getWheelDelta(This)

Get wheel delta, normally 120.

getWheelRotation(This)

Get wheel rotation, positive or negative indicates direction of rotation.

getX(This)

Returns X coordinate of the physical mouse event position.

getY(This)

Returns Y coordinate of the physical mouse event position.

isButton(This)

Returns true if the event was a mouse button event (not necessarily a button down event - that may be tested using buttonDown/2).

isPageScroll(This)

Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling.

leaving(This)

Returns true if the mouse was leaving the window.

leftDClick(This)

Returns true if the event was a left double click.

leftDown(This)

Returns true if the left mouse button changed to down.

leftIsDown(This)

Returns true if the left mouse button is currently down.

leftUp(This)

Returns true if the left mouse button changed to up.

metaDown(This)

Returns true if the Meta key was down at the time of the event.

middleDClick(This)

Returns true if the event was a middle double click.

middleDown(This)

Returns true if the middle mouse button changed to down.

middleIsDown(This)

Returns true if the middle mouse button is currently down.

middleUp(This)

Returns true if the middle mouse button changed to up.

moving(This)

Returns true if this was a motion event and no mouse buttons were pressed.

rightDClick(This)

Returns true if the event was a right double click.

rightDown(This)

Returns true if the right mouse button changed to down.

rightIsDown(This)

Returns true if the right mouse button is currently down.

rightUp(This)

Returns true if the right mouse button changed to up.

shiftDown(This)

Returns true if the Shift key is pressed.

Types

wxMouse()

-type wxMouse() ::
          #wxMouse{type :: wxMouseEvent:wxMouseEventType(),
                   x :: integer(),
                   y :: integer(),
                   leftDown :: boolean(),
                   middleDown :: boolean(),
                   rightDown :: boolean(),
                   controlDown :: boolean(),
                   shiftDown :: boolean(),
                   altDown :: boolean(),
                   metaDown :: boolean(),
                   wheelRotation :: integer(),
                   wheelDelta :: integer(),
                   linesPerAction :: integer()}.

wxMouseEvent()

-type wxMouseEvent() :: wx:wx_object().

wxMouseEventType()

-type wxMouseEventType() ::
          left_down | left_up | middle_down | middle_up | right_down | right_up | motion |
          enter_window | leave_window | left_dclick | middle_dclick | right_dclick | mousewheel |
          aux1_down | aux1_up | aux1_dclick | aux2_down | aux2_up | aux2_dclick.

Functions

altDown(This)

-spec altDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the Alt key is pressed.

Notice that wxKeyEvent:getModifiers/1 should usually be used instead of this one.

aux1DClick(This)

-spec aux1DClick(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a first extra button double click.

aux1Down(This)

-spec aux1Down(This) -> boolean() when This :: wxMouseEvent().

Returns true if the first extra button mouse button changed to down.

aux1Up(This)

-spec aux1Up(This) -> boolean() when This :: wxMouseEvent().

Returns true if the first extra button mouse button changed to up.

aux2DClick(This)

-spec aux2DClick(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a second extra button double click.

aux2Down(This)

-spec aux2Down(This) -> boolean() when This :: wxMouseEvent().

Returns true if the second extra button mouse button changed to down.

aux2Up(This)

-spec aux2Up(This) -> boolean() when This :: wxMouseEvent().

Returns true if the second extra button mouse button changed to up.

button(This, But)

-spec button(This, But) -> boolean() when This :: wxMouseEvent(), But :: wx:wx_enum().

Returns true if the event was generated by the specified button.

buttonDClick(This)

-spec buttonDClick(This) -> boolean() when This :: wxMouseEvent().

Equivalent to buttonDClick(This, []).

buttonDClick/2

-spec buttonDClick(This, [Option]) -> boolean()
                      when This :: wxMouseEvent(), Option :: {but, wx:wx_enum()}.

If the argument is omitted, this returns true if the event was a mouse double click event.

Otherwise the argument specifies which double click event was generated (see button/2 for the possible values).

buttonDown(This)

-spec buttonDown(This) -> boolean() when This :: wxMouseEvent().

Equivalent to buttonDown(This, []).

buttonDown/2

-spec buttonDown(This, [Option]) -> boolean() when This :: wxMouseEvent(), Option :: {but, wx:wx_enum()}.

If the argument is omitted, this returns true if the event was a mouse button down event.

Otherwise the argument specifies which button-down event was generated (see button/2 for the possible values).

buttonUp(This)

-spec buttonUp(This) -> boolean() when This :: wxMouseEvent().

Equivalent to buttonUp(This, []).

buttonUp/2

-spec buttonUp(This, [Option]) -> boolean() when This :: wxMouseEvent(), Option :: {but, wx:wx_enum()}.

If the argument is omitted, this returns true if the event was a mouse button up event.

Otherwise the argument specifies which button-up event was generated (see button/2 for the possible values).

cmdDown(This)

-spec cmdDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the key used for command accelerators is pressed.

Same as controlDown/1. Deprecated.

Notice that wxKeyEvent:getModifiers/1 should usually be used instead of this one.

controlDown(This)

-spec controlDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the Control key or Apple/Command key under macOS is pressed.

This function doesn't distinguish between right and left control keys.

Notice that wxKeyEvent:getModifiers/1 should usually be used instead of this one.

dragging(This)

-spec dragging(This) -> boolean() when This :: wxMouseEvent().

Returns true if this was a dragging event (motion while a button is depressed).

See: moving/1

entering(This)

-spec entering(This) -> boolean() when This :: wxMouseEvent().

Returns true if the mouse was entering the window.

See: leaving/1

getButton(This)

-spec getButton(This) -> integer() when This :: wxMouseEvent().

Returns the mouse button which generated this event or wxMOUSE\_BTN\_NONE if no button is involved (for mouse move, enter or leave event, for example).

Otherwise wxMOUSE_BTN_LEFT is returned for the left button down, up and double click events, wxMOUSE_BTN_MIDDLE and wxMOUSE_BTN_RIGHT for the same events for the middle and the right buttons respectively.

getLinesPerAction(This)

-spec getLinesPerAction(This) -> integer() when This :: wxMouseEvent().

Returns the configured number of lines (or whatever) to be scrolled per wheel action.

Default value under most platforms is three.

getLogicalPosition(This, Dc)

-spec getLogicalPosition(This, Dc) -> {X :: integer(), Y :: integer()}
                            when This :: wxMouseEvent(), Dc :: wxDC:wxDC().

Returns the logical mouse position in pixels (i.e. translated according to the translation set for the DC, which usually indicates that the window has been scrolled).

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxMouseEvent().

Returns the physical mouse position.

getWheelAxis(This)

-spec getWheelAxis(This) -> wx:wx_enum() when This :: wxMouseEvent().

Gets the axis the wheel operation concerns.

Usually the mouse wheel is used to scroll vertically so wxMOUSE_WHEEL_VERTICAL is returned but some mice (and most trackpads) also allow to use the wheel to scroll horizontally in which case wxMOUSE_WHEEL_HORIZONTAL is returned.

Notice that before wxWidgets 2.9.4 this method returned int.

getWheelDelta(This)

-spec getWheelDelta(This) -> integer() when This :: wxMouseEvent().

Get wheel delta, normally 120.

This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.

getWheelRotation(This)

-spec getWheelRotation(This) -> integer() when This :: wxMouseEvent().

Get wheel rotation, positive or negative indicates direction of rotation.

Current devices all send an event when rotation is at least +/-WheelDelta, but finer resolution devices can be created in the future.

Because of this you shouldn't assume that one event is equal to 1 line, but you should be able to either do partial line scrolling or wait until several events accumulate before scrolling.

getX(This)

-spec getX(This) -> integer() when This :: wxMouseEvent().

Returns X coordinate of the physical mouse event position.

getY(This)

-spec getY(This) -> integer() when This :: wxMouseEvent().

Returns Y coordinate of the physical mouse event position.

isButton(This)

-spec isButton(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a mouse button event (not necessarily a button down event - that may be tested using buttonDown/2).

isPageScroll(This)

-spec isPageScroll(This) -> boolean() when This :: wxMouseEvent().

Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling.

leaving(This)

-spec leaving(This) -> boolean() when This :: wxMouseEvent().

Returns true if the mouse was leaving the window.

See: entering/1

leftDClick(This)

-spec leftDClick(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a left double click.

leftDown(This)

-spec leftDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the left mouse button changed to down.

leftIsDown(This)

-spec leftIsDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the left mouse button is currently down.

leftUp(This)

-spec leftUp(This) -> boolean() when This :: wxMouseEvent().

Returns true if the left mouse button changed to up.

metaDown(This)

-spec metaDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the Meta key was down at the time of the event.

middleDClick(This)

-spec middleDClick(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a middle double click.

middleDown(This)

-spec middleDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the middle mouse button changed to down.

middleIsDown(This)

-spec middleIsDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the middle mouse button is currently down.

middleUp(This)

-spec middleUp(This) -> boolean() when This :: wxMouseEvent().

Returns true if the middle mouse button changed to up.

moving(This)

-spec moving(This) -> boolean() when This :: wxMouseEvent().

Returns true if this was a motion event and no mouse buttons were pressed.

If any mouse button is held pressed, then this method returns false and dragging/1 returns true.

rightDClick(This)

-spec rightDClick(This) -> boolean() when This :: wxMouseEvent().

Returns true if the event was a right double click.

rightDown(This)

-spec rightDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the right mouse button changed to down.

rightIsDown(This)

-spec rightIsDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the right mouse button is currently down.

rightUp(This)

-spec rightUp(This) -> boolean() when This :: wxMouseEvent().

Returns true if the right mouse button changed to up.

shiftDown(This)

-spec shiftDown(This) -> boolean() when This :: wxMouseEvent().

Returns true if the Shift key is pressed.

This function doesn't distinguish between right and left shift keys.

Notice that wxKeyEvent:getModifiers/1 should usually be used instead of this one.

wxMoveEvent

A move event holds information about window position change.

These events are currently generated for top level (see wxTopLevelWindow) windows in all ports, but are not generated for the child windows in wxGTK.

See:

{X,Y}

Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxMoveEvent

Events

Use wxEvtHandler:connect/3 with wxMoveEventType to subscribe to events of this type.

Summary

Types

wxMove()

wxMoveEvent()

wxMoveEventType()

Functions

getPosition(This)

Returns the position of the window generating the move change event.

getRect(This)

Types

wxMove()

-type wxMove() ::
          #wxMove{type :: wxMoveEvent:wxMoveEventType(),
                  pos :: {X :: integer(), Y :: integer()},
                  rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}}.

wxMoveEvent()

-type wxMoveEvent() :: wx:wx_object().

wxMoveEventType()

-type wxMoveEventType() :: move.

Functions

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxMoveEvent().

Returns the position of the window generating the move change event.

getRect(This)

-spec getRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                 when This :: wxMoveEvent().

wxMultiChoiceDialog

This class represents a dialog that shows a list of strings, and allows the user to select one or more.

Styles

This class supports the following styles:

wxOK: Show an OK button.

wxCANCEL: Show a Cancel button.

wxCENTRE: Centre the message.

See:

Overview cmndlg

wxSingleChoiceDialog

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxMultiChoiceDialog

Summary

Types

wxMultiChoiceDialog()

Functions

destroy(This)

Destroys the object

getSelections(This)

Returns array with indexes of selected items.

new(Parent, Message, Caption, Choices)

Equivalent to new(Parent, Message, Caption, Choices, []).

new/5

Constructor taking an array of wxString (not implemented in wx) choices.

setSelections(This, Selections)

Sets selected items from the array of selected items' indexes.

Types

wxMultiChoiceDialog()

-type wxMultiChoiceDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxMultiChoiceDialog()) -> ok.

Destroys the object

getSelections(This)

-spec getSelections(This) -> [integer()] when This :: wxMultiChoiceDialog().

Returns array with indexes of selected items.

new(Parent, Message, Caption, Choices)

-spec new(Parent, Message, Caption, Choices) -> wxMultiChoiceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Caption :: unicode:chardata(),
                 Choices :: [unicode:chardata()].

Equivalent to new(Parent, Message, Caption, Choices, []).

new/5

-spec new(Parent, Message, Caption, Choices, [Option]) -> wxMultiChoiceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Caption :: unicode:chardata(),
                 Choices :: [unicode:chardata()],
                 Option :: {style, integer()} | {pos, {X :: integer(), Y :: integer()}}.

Constructor taking an array of wxString (not implemented in wx) choices.

Remark: Use wxDialog:showModal/1 to show the dialog.

setSelections(This, Selections)

-spec setSelections(This, Selections) -> ok
                       when This :: wxMultiChoiceDialog(), Selections :: [integer()].

Sets selected items from the array of selected items' indexes.

wxNavigationKeyEvent

This event class contains information about navigation events, generated by navigation keys such as tab and page down.

This event is mainly used by wxWidgets implementations. A wxNavigationKeyEvent handler is automatically provided by wxWidgets when you enable keyboard navigation inside a window by inheriting it from wxNavigationEnabled<>.

See: wxWindow:navigate/2

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxNavigationKeyEvent

Events

Use wxEvtHandler:connect/3 with wxNavigationKeyEventType to subscribe to events of this type.

Summary

Types

wxNavigationKey()

wxNavigationKeyEvent()

wxNavigationKeyEventType()

Functions

getCurrentFocus(This)

Returns the child that has the focus, or NULL.

getDirection(This)

Returns true if the navigation was in the forward direction.

isFromTab(This)

Returns true if the navigation event was from a tab key.

isWindowChange(This)

Returns true if the navigation event represents a window change (for example, from Ctrl-Page Down in a notebook).

setCurrentFocus(This, CurrentFocus)

Sets the current focus window member.

setDirection(This, Direction)

Sets the direction to forward if direction is true, or backward if false.

setFromTab(This, FromTab)

Marks the navigation event as from a tab key.

setWindowChange(This, WindowChange)

Marks the event as a window change event.

Types

wxNavigationKey()

-type wxNavigationKey() ::
          #wxNavigationKey{type :: wxNavigationKeyEvent:wxNavigationKeyEventType(),
                           dir :: boolean(),
                           focus :: wxWindow:wxWindow()}.

wxNavigationKeyEvent()

-type wxNavigationKeyEvent() :: wx:wx_object().

wxNavigationKeyEventType()

-type wxNavigationKeyEventType() :: navigation_key.

Functions

getCurrentFocus(This)

-spec getCurrentFocus(This) -> wxWindow:wxWindow() when This :: wxNavigationKeyEvent().

Returns the child that has the focus, or NULL.

getDirection(This)

-spec getDirection(This) -> boolean() when This :: wxNavigationKeyEvent().

Returns true if the navigation was in the forward direction.

isFromTab(This)

-spec isFromTab(This) -> boolean() when This :: wxNavigationKeyEvent().

Returns true if the navigation event was from a tab key.

This is required for proper navigation over radio buttons.

isWindowChange(This)

-spec isWindowChange(This) -> boolean() when This :: wxNavigationKeyEvent().

Returns true if the navigation event represents a window change (for example, from Ctrl-Page Down in a notebook).

setCurrentFocus(This, CurrentFocus)

-spec setCurrentFocus(This, CurrentFocus) -> ok
                         when This :: wxNavigationKeyEvent(), CurrentFocus :: wxWindow:wxWindow().

Sets the current focus window member.

setDirection(This, Direction)

-spec setDirection(This, Direction) -> ok when This :: wxNavigationKeyEvent(), Direction :: boolean().

Sets the direction to forward if direction is true, or backward if false.

setFromTab(This, FromTab)

-spec setFromTab(This, FromTab) -> ok when This :: wxNavigationKeyEvent(), FromTab :: boolean().

Marks the navigation event as from a tab key.

setWindowChange(This, WindowChange)

-spec setWindowChange(This, WindowChange) -> ok
                         when This :: wxNavigationKeyEvent(), WindowChange :: boolean().

Marks the event as a window change event.

wxNotebook

This class represents a notebook control, which manages multiple windows with associated tabs.

To use the class, create a wxNotebook object and call wxBookCtrlBase:addPage/4 or wxBookCtrlBase:insertPage/5, passing a window to be used as the page. Do not explicitly delete the window for a page that is currently managed by wxNotebook.

wxNotebookPage is a typedef for wxWindow.

Styles

This class supports the following styles:

wxNB_TOP: Place tabs on the top side.

wxNB_LEFT: Place tabs on the left side.

wxNB_RIGHT: Place tabs on the right side.

wxNB_BOTTOM: Place tabs under instead of above the notebook pages.

wxNB_FIXEDWIDTH: (Windows only) All tabs will have same width.

wxNB_MULTILINE: (Windows only) There can be several rows of tabs.

wxNB_NOPAGETHEME: (Windows only) Display a solid colour on notebook pages, and not a gradient, which can reduce performance. The styles wxNB_LEFT, RIGHT and BOTTOM are not supported under Microsoft Windows when using visual themes.

Page backgrounds

On Windows, the default theme paints a background on the notebook's pages. If you wish to suppress this theme, for aesthetic or performance reasons, there are three ways of doing it. You can use wxNB_NOPAGETHEME to disable themed drawing for a particular notebook, you can call wxSystemOptions:setOption/2 to disable it for the whole application, or you can disable it for individual pages by using wxWindow:setBackgroundColour/2.

To disable themed pages globally:

Set the value to 1 to enable it again. To give a single page a solid background that more or less fits in with the overall theme, use:

On platforms other than Windows, or if the application is not using Windows themes, getThemeBackgroundColour/1 will return an uninitialised colour object, and the above code will therefore work on all platforms.

See:

?wxBookCtrl

wxBookCtrlEvent

wxImageList

Examples

This class is derived, and can use functions, from:

wxBookCtrlBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxNotebook

Events

Event types emitted from this class:

command_notebook_page_changed

command_notebook_page_changing

Summary

Types

wxNotebook()

Functions

assignImageList(This, ImageList)

Sets the image list for the page control and takes ownership of the list.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates a notebook control.

destroy(This)

Destroys the object

getImageList(This)

Returns the associated image list, may be NULL.

getPageImage(This, NPage)

Returns the image index for the given page.

getRowCount(This)

Returns the number of rows in the notebook control.

getThemeBackgroundColour(This)

If running under Windows and themes are enabled for the application, this function returns a suitable colour for painting the background of a notebook page, and can be passed to wxWindow:setBackgroundColour/2.

new()

Constructs a notebook control.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructs a notebook control.

setImageList(This, ImageList)

Sets the image list to use.

setPadding(This, Padding)

Sets the amount of space around each page's icon and label, in pixels.

setPageImage(This, Page, Image)

Sets the image index for the given page.

setPageSize(This, Size)

Sets the width and height of the pages.

Types

wxNotebook()

-type wxNotebook() :: wx:wx_object().

Functions

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxNotebook(), ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list.

See:

wxImageList

setImageList/2

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxNotebook(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxNotebook(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates a notebook control.

See new/3 for a description of the parameters.

destroy(This)

-spec destroy(This :: wxNotebook()) -> ok.

Destroys the object

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxNotebook().

Returns the associated image list, may be NULL.

See:

wxImageList

setImageList/2

getPageImage(This, NPage)

-spec getPageImage(This, NPage) -> integer() when This :: wxNotebook(), NPage :: integer().

Returns the image index for the given page.

getRowCount(This)

-spec getRowCount(This) -> integer() when This :: wxNotebook().

Returns the number of rows in the notebook control.

getThemeBackgroundColour(This)

-spec getThemeBackgroundColour(This) -> wx:wx_colour4() when This :: wxNotebook().

If running under Windows and themes are enabled for the application, this function returns a suitable colour for painting the background of a notebook page, and can be passed to wxWindow:setBackgroundColour/2.

Otherwise, an uninitialised colour will be returned.

new()

-spec new() -> wxNotebook().

Constructs a notebook control.

new(Parent, Id)

-spec new(Parent, Id) -> wxNotebook() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxNotebook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructs a notebook control.

Note that sometimes you can reduce flicker by passing the wxCLIP_CHILDREN window style.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxNotebook(), ImageList :: wxImageList:wxImageList().

Sets the image list to use.

It does not take ownership of the image list, you must delete it yourself.

See:

wxImageList

assignImageList/2

setPadding(This, Padding)

-spec setPadding(This, Padding) -> ok
                    when This :: wxNotebook(), Padding :: {W :: integer(), H :: integer()}.

Sets the amount of space around each page's icon and label, in pixels.

Note: The vertical padding cannot be changed in wxGTK.

setPageImage(This, Page, Image)

-spec setPageImage(This, Page, Image) -> boolean()
                      when This :: wxNotebook(), Page :: integer(), Image :: integer().

Sets the image index for the given page.

image is an index into the image list which was set with setImageList/2.

setPageSize(This, Size)

-spec setPageSize(This, Size) -> ok when This :: wxNotebook(), Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK.

wxNotificationMessage

This class allows showing the user a message non intrusively.

Currently it is implemented natively for Windows, macOS, GTK and uses generic toast notifications under the other platforms. It's not recommended but wxGenericNotificationMessage can be used instead of the native ones. This might make sense if your application requires features not available in the native implementation.

Notice that this class is not a window and so doesn't derive from wxWindow.

Platform Notes

Par:

Up to Windows 8 balloon notifications are displayed from an icon in the notification area of the taskbar. If your application uses a wxTaskBarIcon you should call useTaskBarIcon/1 to ensure that only one icon is shown in the notification area. Windows 10 displays all notifications as popup toasts. To suppress the additional icon in the notification area on Windows 10 and for toast notification support on Windows 8 it is recommended to call mSWUseToasts/1 before showing the first notification message.

Par:

The macOS implementation uses Notification Center to display native notifications. In order to use actions your notifications must use the alert style. This can be enabled by the user in system settings or by setting the NSUserNotificationAlertStyle value in Info.plist to alert. Please note that the user always has the option to change the notification style.

This class is derived, and can use functions, from:

wxEvtHandler

wxWidgets docs: wxNotificationMessage

Events

Event types emitted from this class:

notification_message_click

notification_message_dismissed

notification_message_action

Summary

Types

wxNotificationMessage()

Functions

addAction(This, Actionid)

Equivalent to addAction(This, Actionid, []).

addAction/3

Add an action to the notification.

close(This)

Hides the notification.

destroy(This)

Destroys the object

mSWUseToasts()

Equivalent to mSWUseToasts([]).

mSWUseToasts(Options)

Enables toast notifications available since Windows 8 and suppresses the additional icon in the notification area on Windows 10.

new()

Default constructor, use setParent/2, setTitle/2 and setMessage/2 to initialize the object before showing it.

new(Title)

Equivalent to new(Title, []).

new(Title, Options)

Create a notification object with the given attributes.

setFlags(This, Flags)

This parameter can be currently used to specify the icon to show in the notification.

setIcon(This, Icon)

Specify a custom icon to be displayed in the notification.

setMessage(This, Message)

Set the main text of the notification.

setParent(This, Parent)

Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default.

setTitle(This, Title)

Set the title, it must be a concise string (not more than 64 characters), use setMessage/2 to give the user more details.

show(This)

Equivalent to show(This, []).

show/2

Show the notification to the user and hides it after timeout seconds are elapsed.

useTaskBarIcon(Icon)

If the application already uses a wxTaskBarIcon, it should be connected to notifications by using this method.

Types

wxNotificationMessage()

-type wxNotificationMessage() :: wx:wx_object().

Functions

addAction(This, Actionid)

-spec addAction(This, Actionid) -> boolean() when This :: wxNotificationMessage(), Actionid :: integer().

Equivalent to addAction(This, Actionid, []).

addAction/3

-spec addAction(This, Actionid, [Option]) -> boolean()
                   when
                       This :: wxNotificationMessage(),
                       Actionid :: integer(),
                       Option :: {label, unicode:chardata()}.

Add an action to the notification.

If supported by the implementation this are usually buttons in the notification selectable by the user.

Return: false if the current implementation or OS version does not support actions in notifications.

Since: 3.1.0

close(This)

-spec close(This) -> boolean() when This :: wxNotificationMessage().

Hides the notification.

Returns true if it was hidden or false if it couldn't be done (e.g. on some systems automatically hidden notifications can't be hidden manually).

destroy(This)

-spec destroy(This :: wxNotificationMessage()) -> ok.

Destroys the object

mSWUseToasts()

-spec mSWUseToasts() -> boolean().

Equivalent to mSWUseToasts([]).

mSWUseToasts(Options)

-spec mSWUseToasts([Option]) -> boolean()
                      when Option :: {shortcutPath, unicode:chardata()} | {appId, unicode:chardata()}.

Enables toast notifications available since Windows 8 and suppresses the additional icon in the notification area on Windows 10.

Toast notifications require a shortcut to the application in the start menu. The start menu shortcut needs to contain an Application User Model ID. It is recommended that the applications setup creates the shortcut and the application specifies the setup created shortcut in shortcutPath. A call to this method will verify (and if necessary modify) the shortcut before enabling toast notifications.

Return: false if toast notifications could not be enabled.

Only for:wxmsw

Since: 3.1.0

new()

-spec new() -> wxNotificationMessage().

Default constructor, use setParent/2, setTitle/2 and setMessage/2 to initialize the object before showing it.

new(Title)

-spec new(Title) -> wxNotificationMessage() when Title :: unicode:chardata().

Equivalent to new(Title, []).

new(Title, Options)

-spec new(Title, [Option]) -> wxNotificationMessage()
             when
                 Title :: unicode:chardata(),
                 Option ::
                     {message, unicode:chardata()} | {parent, wxWindow:wxWindow()} | {flags, integer()}.

Create a notification object with the given attributes.

See setTitle/2, setMessage/2, setParent/2 and setFlags/2 for the description of the corresponding parameters.

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxNotificationMessage(), Flags :: integer().

This parameter can be currently used to specify the icon to show in the notification.

Valid values are wxICON_INFORMATION, wxICON_WARNING and wxICON_ERROR (notice that wxICON_QUESTION is not allowed here). Some implementations of this class may not support the icons.

See: setIcon/2

setIcon(This, Icon)

-spec setIcon(This, Icon) -> ok when This :: wxNotificationMessage(), Icon :: wxIcon:wxIcon().

Specify a custom icon to be displayed in the notification.

Some implementations of this class may not support custom icons.

See: setFlags/2

Since: 3.1.0

setMessage(This, Message)

-spec setMessage(This, Message) -> ok
                    when This :: wxNotificationMessage(), Message :: unicode:chardata().

Set the main text of the notification.

This should be a more detailed description than the title but still limited to reasonable length (not more than 256 characters).

setParent(This, Parent)

-spec setParent(This, Parent) -> ok when This :: wxNotificationMessage(), Parent :: wxWindow:wxWindow().

Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default.

setTitle(This, Title)

-spec setTitle(This, Title) -> ok when This :: wxNotificationMessage(), Title :: unicode:chardata().

Set the title, it must be a concise string (not more than 64 characters), use setMessage/2 to give the user more details.

show(This)

-spec show(This) -> boolean() when This :: wxNotificationMessage().

Equivalent to show(This, []).

show/2

-spec show(This, [Option]) -> boolean()
              when This :: wxNotificationMessage(), Option :: {timeout, integer()}.

Show the notification to the user and hides it after timeout seconds are elapsed.

Special values Timeout_Auto and Timeout_Never can be used here, notice that you shouldn't rely on timeout being exactly respected because the current platform may only support default timeout value and also because the user may be able to close the notification.

Note: When using native notifications in wxGTK, the timeout is ignored for the notifications with wxICON_WARNING or wxICON_ERROR flags, they always remain shown unless they're explicitly hidden by the user, i.e. behave as if Timeout_Auto were given.

Return: false if an error occurred.

useTaskBarIcon(Icon)

-spec useTaskBarIcon(Icon) -> wxTaskBarIcon:wxTaskBarIcon() when Icon :: wxTaskBarIcon:wxTaskBarIcon().

If the application already uses a wxTaskBarIcon, it should be connected to notifications by using this method.

This has no effect if toast notifications are used.

Return: the task bar icon which was used previously (may be NULL)

Only for:wxmsw

wxNotifyEvent

This class is not used by the event handlers by itself, but is a base class for other event classes (such as wxBookCtrlEvent).

It (or an object of a derived class) is sent when the controls state is being changed and allows the program to veto/1 this change if it wants to prevent it from happening.

See: wxBookCtrlEvent

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxNotifyEvent

Summary

Types

wxNotifyEvent()

Functions

allow(This)

This is the opposite of veto/1: it explicitly allows the event to be processed.

isAllowed(This)

Returns true if the change is allowed (veto/1 hasn't been called) or false otherwise (if it was).

veto(This)

Prevents the change announced by this event from happening.

Types

wxNotifyEvent()

-type wxNotifyEvent() :: wx:wx_object().

Functions

allow(This)

-spec allow(This) -> ok when This :: wxNotifyEvent().

This is the opposite of veto/1: it explicitly allows the event to be processed.

For most events it is not necessary to call this method as the events are allowed anyhow but some are forbidden by default (this will be mentioned in the corresponding event description).

isAllowed(This)

-spec isAllowed(This) -> boolean() when This :: wxNotifyEvent().

Returns true if the change is allowed (veto/1 hasn't been called) or false otherwise (if it was).

veto(This)

-spec veto(This) -> ok when This :: wxNotifyEvent().

Prevents the change announced by this event from happening.

It is in general a good idea to notify the user about the reasons for vetoing the change because otherwise the applications behaviour (which just refuses to do what the user wants) might be quite surprising.

wxOverlay

Creates an overlay over an existing window, allowing for manipulations like rubberbanding, etc.

On wxOSX the overlay is implemented with native platform APIs, on the other platforms it is simulated using wxMemoryDC.

See:

wxDCOverlay

wxDC

wxWidgets docs: wxOverlay

Summary

Types

wxOverlay()

Functions

destroy(This)

Destroys the object

new()

reset(This)

Clears the overlay without restoring the former state.

Types

wxOverlay()

-type wxOverlay() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxOverlay()) -> ok.

Destroys the object

new()

-spec new() -> wxOverlay().

reset(This)

-spec reset(This) -> ok when This :: wxOverlay().

Clears the overlay without restoring the former state.

To be done, for example, when the window content has been changed and repainted.

wxPageSetupDialog

This class represents the page setup common dialog.

The page setup dialog contains controls for paper size (letter, A4, A5 etc.), orientation (landscape or portrait), and, only under Windows currently, controls for setting left, top, right and bottom margin sizes in millimetres.

The exact appearance of this dialog varies among the platforms as a native dialog is used when available (currently the case for all major platforms).

When the dialog has been closed, you need to query the wxPageSetupDialogData object associated with the dialog.

Note that the OK and Cancel buttons do not destroy the dialog; this must be done by the application.

See:

Overview printing

wxPrintDialog

wxPageSetupDialogData

wxWidgets docs: wxPageSetupDialog

Summary

Types

wxPageSetupDialog()

Functions

destroy(This)

Destroys the object

getPageSetupData(This)

Returns the wxPageSetupDialogData object associated with the dialog.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

showModal(This)

Shows the dialog, returning wxID\_OK if the user pressed OK, and wxID\_CANCEL otherwise.

Types

wxPageSetupDialog()

-type wxPageSetupDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPageSetupDialog()) -> ok.

Destroys the object

getPageSetupData(This)

-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData()
                          when This :: wxPageSetupDialog().

Returns the wxPageSetupDialogData object associated with the dialog.

new(Parent)

-spec new(Parent) -> wxPageSetupDialog() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxPageSetupDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option :: {data, wxPageSetupDialogData:wxPageSetupDialogData()}.

Constructor.

Pass a parent window, and optionally a pointer to a block of page setup data, which will be copied to the print dialog's internal data.

showModal(This)

-spec showModal(This) -> integer() when This :: wxPageSetupDialog().

Shows the dialog, returning wxID\_OK if the user pressed OK, and wxID\_CANCEL otherwise.

wxPageSetupDialogData

This class holds a variety of information related to wxPageSetupDialog.

It contains a wxPrintData member which is used to hold basic printer configuration data (as opposed to the user-interface configuration settings stored by wxPageSetupDialogData).

See:

Overview printing

wxPageSetupDialog

wxWidgets docs: wxPageSetupDialogData

Summary

Types

wxPageSetupDialogData()

Functions

destroy(This)

Destroys the object

enableHelp(This, Flag)

Enables or disables the "Help" button (Windows only).

enableMargins(This, Flag)

Enables or disables the margin controls (Windows only).

enableOrientation(This, Flag)

Enables or disables the orientation control (Windows only).

enablePaper(This, Flag)

Enables or disables the paper size control (Windows only).

enablePrinter(This, Flag)

Enables or disables the "Printer" button, which invokes a printer setup dialog.

getDefaultInfo(This)

Returns true if the dialog will simply return default printer information (such as orientation) instead of showing a dialog (Windows only).

getDefaultMinMargins(This)

Returns true if the page setup dialog will take its minimum margin values from the currently selected printer properties (Windows only).

getEnableHelp(This)

Returns true if the printer setup button is enabled.

getEnableMargins(This)

Returns true if the margin controls are enabled (Windows only).

getEnableOrientation(This)

Returns true if the orientation control is enabled (Windows only).

getEnablePaper(This)

Returns true if the paper size control is enabled (Windows only).

getEnablePrinter(This)

Returns true if the printer setup button is enabled.

getMarginBottomRight(This)

Returns the right (x) and bottom (y) margins in millimetres.

getMarginTopLeft(This)

Returns the left (x) and top (y) margins in millimetres.

getMinMarginBottomRight(This)

Returns the right (x) and bottom (y) minimum margins the user can enter (Windows only).

getMinMarginTopLeft(This)

Returns the left (x) and top (y) minimum margins the user can enter (Windows only).

getPaperId(This)

Returns the paper id (stored in the internal wxPrintData object).

getPaperSize(This)

Returns the paper size in millimetres.

getPrintData(This)

isOk(This)

Returns true if the print data associated with the dialog data is valid.

new()

Default constructor.

new(PrintData)

Construct an object from a print data object.

setDefaultInfo(This, Flag)

Pass true if the dialog will simply return default printer information (such as orientation) instead of showing a dialog (Windows only).

setDefaultMinMargins(This, Flag)

Pass true if the page setup dialog will take its minimum margin values from the currently selected printer properties (Windows only).

setMarginBottomRight(This, Pt)

Sets the right (x) and bottom (y) margins in millimetres.

setMarginTopLeft(This, Pt)

Sets the left (x) and top (y) margins in millimetres.

setMinMarginBottomRight(This, Pt)

Sets the right (x) and bottom (y) minimum margins the user can enter (Windows only).

setMinMarginTopLeft(This, Pt)

Sets the left (x) and top (y) minimum margins the user can enter (Windows only).

setPaperId(This, Id)

Sets the paper size id.

setPaperSize(This, Size)

Sets the paper size in millimetres.

setPrintData(This, PrintData)

Sets the print data associated with this object.

Types

wxPageSetupDialogData()

-type wxPageSetupDialogData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPageSetupDialogData()) -> ok.

Destroys the object

enableHelp(This, Flag)

-spec enableHelp(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Enables or disables the "Help" button (Windows only).

enableMargins(This, Flag)

-spec enableMargins(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Enables or disables the margin controls (Windows only).

enableOrientation(This, Flag)

-spec enableOrientation(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Enables or disables the orientation control (Windows only).

enablePaper(This, Flag)

-spec enablePaper(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Enables or disables the paper size control (Windows only).

enablePrinter(This, Flag)

-spec enablePrinter(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Enables or disables the "Printer" button, which invokes a printer setup dialog.

getDefaultInfo(This)

-spec getDefaultInfo(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the dialog will simply return default printer information (such as orientation) instead of showing a dialog (Windows only).

getDefaultMinMargins(This)

-spec getDefaultMinMargins(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the page setup dialog will take its minimum margin values from the currently selected printer properties (Windows only).

getEnableHelp(This)

-spec getEnableHelp(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the printer setup button is enabled.

getEnableMargins(This)

-spec getEnableMargins(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the margin controls are enabled (Windows only).

getEnableOrientation(This)

-spec getEnableOrientation(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the orientation control is enabled (Windows only).

getEnablePaper(This)

-spec getEnablePaper(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the paper size control is enabled (Windows only).

getEnablePrinter(This)

-spec getEnablePrinter(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the printer setup button is enabled.

getMarginBottomRight(This)

-spec getMarginBottomRight(This) -> {X :: integer(), Y :: integer()}
                              when This :: wxPageSetupDialogData().

Returns the right (x) and bottom (y) margins in millimetres.

getMarginTopLeft(This)

-spec getMarginTopLeft(This) -> {X :: integer(), Y :: integer()} when This :: wxPageSetupDialogData().

Returns the left (x) and top (y) margins in millimetres.

getMinMarginBottomRight(This)

-spec getMinMarginBottomRight(This) -> {X :: integer(), Y :: integer()}
                                 when This :: wxPageSetupDialogData().

Returns the right (x) and bottom (y) minimum margins the user can enter (Windows only).

Units are in millimetres.

getMinMarginTopLeft(This)

-spec getMinMarginTopLeft(This) -> {X :: integer(), Y :: integer()} when This :: wxPageSetupDialogData().

Returns the left (x) and top (y) minimum margins the user can enter (Windows only).

Units are in millimetres.

getPaperId(This)

-spec getPaperId(This) -> wx:wx_enum() when This :: wxPageSetupDialogData().

Returns the paper id (stored in the internal wxPrintData object).

See: wxPrintData:setPaperId/2

getPaperSize(This)

-spec getPaperSize(This) -> {W :: integer(), H :: integer()} when This :: wxPageSetupDialogData().

Returns the paper size in millimetres.

getPrintData(This)

-spec getPrintData(This) -> wxPrintData:wxPrintData() when This :: wxPageSetupDialogData().

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPageSetupDialogData().

Returns true if the print data associated with the dialog data is valid.

This can return false on Windows if the current printer is not set, for example. On all other platforms, it returns true.

new()

-spec new() -> wxPageSetupDialogData().

Default constructor.

new(PrintData)

-spec new(PrintData) -> wxPageSetupDialogData()
             when PrintData :: wxPrintData:wxPrintData() | wxPageSetupDialogData:wxPageSetupDialogData().

Construct an object from a print data object.

setDefaultInfo(This, Flag)

-spec setDefaultInfo(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Pass true if the dialog will simply return default printer information (such as orientation) instead of showing a dialog (Windows only).

setDefaultMinMargins(This, Flag)

-spec setDefaultMinMargins(This, Flag) -> ok when This :: wxPageSetupDialogData(), Flag :: boolean().

Pass true if the page setup dialog will take its minimum margin values from the currently selected printer properties (Windows only).

Units are in millimetres.

setMarginBottomRight(This, Pt)

-spec setMarginBottomRight(This, Pt) -> ok
                              when
                                  This :: wxPageSetupDialogData(),
                                  Pt :: {X :: integer(), Y :: integer()}.

Sets the right (x) and bottom (y) margins in millimetres.

setMarginTopLeft(This, Pt)

-spec setMarginTopLeft(This, Pt) -> ok
                          when This :: wxPageSetupDialogData(), Pt :: {X :: integer(), Y :: integer()}.

Sets the left (x) and top (y) margins in millimetres.

setMinMarginBottomRight(This, Pt)

-spec setMinMarginBottomRight(This, Pt) -> ok
                                 when
                                     This :: wxPageSetupDialogData(),
                                     Pt :: {X :: integer(), Y :: integer()}.

Sets the right (x) and bottom (y) minimum margins the user can enter (Windows only).

Units are in millimetres.

setMinMarginTopLeft(This, Pt)

-spec setMinMarginTopLeft(This, Pt) -> ok
                             when
                                 This :: wxPageSetupDialogData(), Pt :: {X :: integer(), Y :: integer()}.

Sets the left (x) and top (y) minimum margins the user can enter (Windows only).

Units are in millimetres.

setPaperId(This, Id)

-spec setPaperId(This, Id) -> ok when This :: wxPageSetupDialogData(), Id :: wx:wx_enum().

Sets the paper size id.

Calling this function overrides the explicit paper dimensions passed in setPaperSize/2.

See: wxPrintData:setPaperId/2

setPaperSize(This, Size)

-spec setPaperSize(This, Size) -> ok
                      when This :: wxPageSetupDialogData(), Size :: {W :: integer(), H :: integer()}.

Sets the paper size in millimetres.

If a corresponding paper id is found, it will be set in the internal wxPrintData object, otherwise the paper size overrides the paper id.

setPrintData(This, PrintData)

-spec setPrintData(This, PrintData) -> ok
                      when This :: wxPageSetupDialogData(), PrintData :: wxPrintData:wxPrintData().

Sets the print data associated with this object.

wxPaintDC

A wxPaintDC must be constructed if an application wishes to paint on the client area of a window from within an EVT_PAINT() event handler.

This should normally be constructed as a temporary stack object; don't store a wxPaintDC object. If you have an EVT_PAINT() handler, you must create a wxPaintDC object within it even if you don't actually use it.

Using wxPaintDC within your EVT_PAINT() handler is important because it automatically sets the clipping area to the damaged area of the window. Attempts to draw outside this area do not appear.

A wxPaintDC object is initialized to use the same font and colours as the window it is associated with.

See:

wxDC

wxClientDC

wxMemoryDC

wxWindowDC

wxScreenDC

This class is derived, and can use functions, from:

wxWindowDC

wxDC

wxWidgets docs: wxPaintDC

Summary

Types

wxPaintDC()

Functions

destroy(This)

Destroys the object

new(Window)

Constructor.

Types

wxPaintDC()

-type wxPaintDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPaintDC()) -> ok.

Destroys the object

new(Window)

-spec new(Window) -> wxPaintDC() when Window :: wxWindow:wxWindow().

Constructor.

Pass a pointer to the window on which you wish to paint.

wxPaintEvent

A paint event is sent when a window's contents needs to be repainted.

The handler of this event must create a wxPaintDC object and use it for painting the window contents. For example:

Notice that you must not create other kinds of wxDC (e.g. wxClientDC or wxWindowDC) in EVT_PAINT handlers and also don't create wxPaintDC outside of this event handlers.

You can optimize painting by retrieving the rectangles that have been damaged and only repainting these. The rectangles are in terms of the client area, and are unscrolled, so you will need to do some calculations using the current view position to obtain logical, scrolled units. Here is an example of using the wxRegionIterator (not implemented in wx) class:

Remark: Please notice that in general it is impossible to change the drawing of a standard control (such as wxButton) and so you shouldn't attempt to handle paint events for them as even if it might work on some platforms, this is inherently not portable and won't work everywhere.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxPaintEvent

Events

Use wxEvtHandler:connect/3 with wxPaintEventType to subscribe to events of this type.

Summary

Types

wxPaint()

wxPaintEvent()

wxPaintEventType()

Types

wxPaint()

-type wxPaint() :: #wxPaint{type :: wxPaintEvent:wxPaintEventType()}.

wxPaintEvent()

-type wxPaintEvent() :: wx:wx_object().

wxPaintEventType()

-type wxPaintEventType() :: paint.

wxPalette

A palette is a table that maps pixel values to RGB colours.

It allows the colours of a low-depth bitmap, for example, to be mapped to the available colours in a display. The notion of palettes is becoming more and more obsolete nowadays and only the MSW port is still using a native palette. All other ports use generic code which is basically just an array of colours.

It is likely that in the future the only use for palettes within wxWidgets will be for representing colour indices from images (such as GIF or PNG). The image handlers for these formats have been modified to create a palette if there is such information in the original image file (usually 256 or less colour images). See wxImage for more information.

Predefined objects (include wx.hrl): ?wxNullPalette

See:

wxDC:setPalette/2

wxBitmap

wxWidgets docs: wxPalette

Summary

Types

wxPalette()

Functions

create(This, Red, Green, Blue)

Creates a palette from arrays of size n, one for each red, blue or green component.

destroy(This)

Destroys the object

getColoursCount(This)

Returns number of entries in palette.

getPixel(This, Red, Green, Blue)

Returns a pixel value (index into the palette) for the given RGB values.

getRGB(This, Pixel)

Returns RGB values for a given palette index.

isOk(This)

Returns true if palette data is present.

new()

Default constructor.

new(Palette)

Copy constructor, uses overview_refcount.

new(Red, Green, Blue)

Creates a palette from arrays of size n, one for each red, blue or green component.

ok(This)

Equivalent to: isOk/1

Types

wxPalette()

-type wxPalette() :: wx:wx_object().

Functions

create(This, Red, Green, Blue)

-spec create(This, Red, Green, Blue) -> boolean()
                when This :: wxPalette(), Red :: binary(), Green :: binary(), Blue :: binary().

Creates a palette from arrays of size n, one for each red, blue or green component.

Return: true if the creation was successful, false otherwise.

See: new/3

destroy(This)

-spec destroy(This :: wxPalette()) -> ok.

Destroys the object

getColoursCount(This)

-spec getColoursCount(This) -> integer() when This :: wxPalette().

Returns number of entries in palette.

getPixel(This, Red, Green, Blue)

-spec getPixel(This, Red, Green, Blue) -> integer()
                  when This :: wxPalette(), Red :: integer(), Green :: integer(), Blue :: integer().

Returns a pixel value (index into the palette) for the given RGB values.

Return: The nearest palette index or wxNOT_FOUND for unexpected errors.

See: getRGB/2

getRGB(This, Pixel)

-spec getRGB(This, Pixel) -> Result
                when
                    Result ::
                        {Res :: boolean(), Red :: integer(), Green :: integer(), Blue :: integer()},
                    This :: wxPalette(),
                    Pixel :: integer().

Returns RGB values for a given palette index.

Return: true if the operation was successful.

See: getPixel/4

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPalette().

Returns true if palette data is present.

new()

-spec new() -> wxPalette().

Default constructor.

new(Palette)

-spec new(Palette) -> wxPalette() when Palette :: wxPalette().

Copy constructor, uses overview_refcount.

new(Red, Green, Blue)

-spec new(Red, Green, Blue) -> wxPalette() when Red :: binary(), Green :: binary(), Blue :: binary().

Creates a palette from arrays of size n, one for each red, blue or green component.

See: create/4

ok(This)

-spec ok(This) -> boolean() when This :: wxPalette().

Equivalent to: isOk/1

wxPaletteChangedEvent

Functions for wxPaletteChangedEvent class

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxPaletteChangedEvent

Summary

Types

wxPaletteChanged()

wxPaletteChangedEvent()

wxPaletteChangedEventType()

Functions

getChangedWindow(This)

setChangedWindow(This, Win)

Types

wxPaletteChanged()

-type wxPaletteChanged() :: #wxPaletteChanged{type :: wxPaletteChangedEvent:wxPaletteChangedEventType()}.

wxPaletteChangedEvent()

-type wxPaletteChangedEvent() :: wx:wx_object().

wxPaletteChangedEventType()

-type wxPaletteChangedEventType() :: palette_changed.

Functions

getChangedWindow(This)

-spec getChangedWindow(This) -> wxWindow:wxWindow() when This :: wxPaletteChangedEvent().

setChangedWindow(This, Win)

-spec setChangedWindow(This, Win) -> ok when This :: wxPaletteChangedEvent(), Win :: wxWindow:wxWindow().

wxPanel

A panel is a window on which controls are placed.

It is usually placed within a frame. Its main feature over its parent class wxWindow is code for handling child windows and TAB traversal, which is implemented natively if possible (e.g. in wxGTK) or by wxWidgets itself otherwise.

Note: Tab traversal is implemented through an otherwise undocumented intermediate wxControlContainer class from which any class can derive in addition to the normal wxWindow base class. Please see and to find out how this is achieved.

Note: if not all characters are being intercepted by your OnKeyDown or OnChar handler, it may be because you are using the wxTAB_TRAVERSAL style, which grabs some keypresses for use by child controls.

Remark: By default, a panel has the same colouring as a dialog.

See: wxDialog

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxPanel

Events

Event types emitted from this class:

navigation_key

Summary

Types

wxPanel()

Functions

destroy(This)

Destroys the object

initDialog(This)

Sends a wxInitDialogEvent, which in turn transfers data to the dialog via validators.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

setFocusIgnoringChildren(This)

In contrast to wxWindow:setFocus/1 (see above) this will set the focus to the panel even if there are child windows in the panel.

Types

wxPanel()

-type wxPanel() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPanel()) -> ok.

Destroys the object

initDialog(This)

-spec initDialog(This) -> ok when This :: wxPanel().

Sends a wxInitDialogEvent, which in turn transfers data to the dialog via validators.

See: wxInitDialogEvent

new()

-spec new() -> wxPanel().

Default constructor.

new(Parent)

-spec new(Parent) -> wxPanel() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxPanel()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {winid, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

setFocusIgnoringChildren(This)

-spec setFocusIgnoringChildren(This) -> ok when This :: wxPanel().

In contrast to wxWindow:setFocus/1 (see above) this will set the focus to the panel even if there are child windows in the panel.

This is only rarely needed.

wxPasswordEntryDialog

This class represents a dialog that requests a one-line password string from the user.

It is implemented as a generic wxWidgets dialog.

See: Overview cmndlg

This class is derived, and can use functions, from:

wxTextEntryDialog

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxPasswordEntryDialog

Summary

Types

wxPasswordEntryDialog()

Functions

destroy(This)

Destroys the object

new(Parent, Message)

Equivalent to new(Parent, Message, []).

new/3

Constructor.

Types

wxPasswordEntryDialog()

-type wxPasswordEntryDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPasswordEntryDialog()) -> ok.

Destroys the object

new(Parent, Message)

-spec new(Parent, Message) -> wxPasswordEntryDialog()
             when Parent :: wxWindow:wxWindow(), Message :: unicode:chardata().

Equivalent to new(Parent, Message, []).

new/3

-spec new(Parent, Message, [Option]) -> wxPasswordEntryDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Option ::
                     {caption, unicode:chardata()} |
                     {value, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}}.

Constructor.

Use wxDialog:showModal/1 to show the dialog.

wxPen

A pen is a drawing tool for drawing outlines.

It is used for drawing lines and painting the outline of rectangles, ellipses, etc. It has a colour, a width and a style.

Note: On a monochrome display, wxWidgets shows all non-white pens as black.

Do not initialize objects on the stack before the program commences, since other required structures may not have been set up yet. Instead, define global pointers to objects and create them in wxApp::OnInit() (not implemented in wx) or when required.

An application may wish to dynamically create pens with different characteristics, and there is the consequent danger that a large number of duplicate pens will be created. Therefore an application may wish to get a pointer to a pen by using the global list of pens ?wxThePenList, and calling the member function wxPenList::FindOrCreatePen() (not implemented in wx). See wxPenList (not implemented in wx) for more info.

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

Predefined objects (include wx.hrl):

?wxNullPen

?wxBLACK_DASHED_PEN

?wxBLACK_PEN

?wxBLUE_PEN

?wxCYAN_PEN

?wxGREEN_PEN

?wxYELLOW_PEN

?wxGREY_PEN

?wxLIGHT_GREY_PEN

?wxMEDIUM_GREY_PEN

?wxRED_PEN

?wxTRANSPARENT_PEN

?wxWHITE_PEN

See:

wxDC

wxDC:setPen/2

wxWidgets docs: wxPen

Summary

Types

wxPen()

Functions

destroy(This)

Destroys the object

getCap(This)

Returns the pen cap style, which may be one of wxCAP\_ROUND, wxCAP\_PROJECTING and wxCAP\_BUTT.

getColour(This)

Returns a reference to the pen colour.

getJoin(This)

Returns the pen join style, which may be one of wxJOIN\_BEVEL, wxJOIN\_ROUND and wxJOIN\_MITER.

getStyle(This)

Returns the pen style.

getWidth(This)

Returns the pen width.

isOk(This)

Returns true if the pen is initialised.

new()

Default constructor.

new/1

Copy constructor, uses overview_refcount.

new(Colour, Options)

Constructs a pen from a colour object, pen width and style.

setCap(This, CapStyle)

Sets the pen cap style, which may be one of wxCAP\_ROUND, wxCAP\_PROJECTING and wxCAP\_BUTT.

setColour(This, Colour)

The pen's colour is changed to the given colour.

setColour(This, Red, Green, Blue)

setJoin(This, Join_style)

Sets the pen join style, which may be one of wxJOIN\_BEVEL, wxJOIN\_ROUND and wxJOIN\_MITER.

setStyle(This, Style)

Set the pen style.

setWidth(This, Width)

Sets the pen width.

Types

wxPen()

-type wxPen() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPen()) -> ok.

Destroys the object

getCap(This)

-spec getCap(This) -> wx:wx_enum() when This :: wxPen().

Returns the pen cap style, which may be one of wxCAP\_ROUND, wxCAP\_PROJECTING and wxCAP\_BUTT.

The default is wxCAP_ROUND.

See: setCap/2

getColour(This)

-spec getColour(This) -> wx:wx_colour4() when This :: wxPen().

Returns a reference to the pen colour.

See: setColour/4

getJoin(This)

-spec getJoin(This) -> wx:wx_enum() when This :: wxPen().

Returns the pen join style, which may be one of wxJOIN\_BEVEL, wxJOIN\_ROUND and wxJOIN\_MITER.

The default is wxJOIN_ROUND.

See: setJoin/2

getStyle(This)

-spec getStyle(This) -> wx:wx_enum() when This :: wxPen().

Returns the pen style.

See:

new/2

setStyle/2

getWidth(This)

-spec getWidth(This) -> integer() when This :: wxPen().

Returns the pen width.

See: setWidth/2

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPen().

Returns true if the pen is initialised.

Notice that an uninitialized pen object can't be queried for any pen properties and all calls to the accessor methods on it will result in an assert failure.

new()

-spec new() -> wxPen().

Default constructor.

The pen will be uninitialised, and isOk/1 will return false.

new/1

-spec new(Colour) -> wxPen() when Colour :: wx:wx_colour();
         (Pen) -> wxPen() when Pen :: wxPen().

Copy constructor, uses overview_refcount.

new(Colour, Options)

-spec new(Colour, [Option]) -> wxPen()
             when Colour :: wx:wx_colour(), Option :: {width, integer()} | {style, wx:wx_enum()}.

Constructs a pen from a colour object, pen width and style.

Remark: Different versions of Windows and different versions of other platforms support very different subsets of the styles above so handle with care.

See:

setStyle/2

setColour/4

setWidth/2

setCap(This, CapStyle)

-spec setCap(This, CapStyle) -> ok when This :: wxPen(), CapStyle :: wx:wx_enum().

Sets the pen cap style, which may be one of wxCAP\_ROUND, wxCAP\_PROJECTING and wxCAP\_BUTT.

The default is wxCAP_ROUND.

See: getCap/1

setColour(This, Colour)

-spec setColour(This, Colour) -> ok when This :: wxPen(), Colour :: wx:wx_colour().

The pen's colour is changed to the given colour.

See: getColour/1

setColour(This, Red, Green, Blue)

-spec setColour(This, Red, Green, Blue) -> ok
                   when This :: wxPen(), Red :: integer(), Green :: integer(), Blue :: integer().

setJoin(This, Join_style)

-spec setJoin(This, Join_style) -> ok when This :: wxPen(), Join_style :: wx:wx_enum().

Sets the pen join style, which may be one of wxJOIN\_BEVEL, wxJOIN\_ROUND and wxJOIN\_MITER.

The default is wxJOIN_ROUND.

See: getJoin/1

setStyle(This, Style)

-spec setStyle(This, Style) -> ok when This :: wxPen(), Style :: wx:wx_enum().

Set the pen style.

See: new/2

setWidth(This, Width)

-spec setWidth(This, Width) -> ok when This :: wxPen(), Width :: integer().

Sets the pen width.

See: getWidth/1

wxPickerBase

Base abstract class for all pickers which support an auxiliary text control.

This class handles all positioning and sizing of the text control like a an horizontal wxBoxSizer would do, with the text control on the left of the picker button.

The proportion (see wxSizer documentation for more info about proportion values) of the picker control defaults to 1 when there isn't a text control associated (see wxPB_USE_TEXTCTRL style) and to 0 otherwise.

Styles

This class supports the following styles:

wxPB_USE_TEXTCTRL: Creates a text control to the left of the picker which is completely managed by this wxPickerBase class.

See: wxColourPickerCtrl

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxPickerBase

Summary

Types

wxPickerBase()

Functions

getInternalMargin(This)

Returns the margin (in pixel) between the picker and the text control.

getPickerCtrlProportion(This)

Returns the proportion value of the picker.

getTextCtrl(This)

Returns a pointer to the text control handled by this window or NULL if the wxPB\_USE\_TEXTCTRL style was not specified when this control was created.

getTextCtrlProportion(This)

Returns the proportion value of the text control.

hasTextCtrl(This)

Returns true if this window has a valid text control (i.e. if the wxPB\_USE\_TEXTCTRL style was given when creating this control).

isPickerCtrlGrowable(This)

Returns true if the picker control is growable.

isTextCtrlGrowable(This)

Returns true if the text control is growable.

setInternalMargin(This, Margin)

Sets the margin (in pixel) between the picker and the text control.

setPickerCtrlGrowable(This)

Equivalent to setPickerCtrlGrowable(This, []).

setPickerCtrlGrowable/2

Sets the picker control as growable when grow is true.

setPickerCtrlProportion(This, Prop)

Sets the proportion value of the picker.

setTextCtrlGrowable(This)

Equivalent to setTextCtrlGrowable(This, []).

setTextCtrlGrowable/2

Sets the text control as growable when grow is true.

setTextCtrlProportion(This, Prop)

Sets the proportion value of the text control.

Types

wxPickerBase()

-type wxPickerBase() :: wx:wx_object().

Functions

getInternalMargin(This)

-spec getInternalMargin(This) -> integer() when This :: wxPickerBase().

Returns the margin (in pixel) between the picker and the text control.

This function can be used only when hasTextCtrl/1 returns true.

getPickerCtrlProportion(This)

-spec getPickerCtrlProportion(This) -> integer() when This :: wxPickerBase().

Returns the proportion value of the picker.

getTextCtrl(This)

-spec getTextCtrl(This) -> wxTextCtrl:wxTextCtrl() when This :: wxPickerBase().

Returns a pointer to the text control handled by this window or NULL if the wxPB\_USE\_TEXTCTRL style was not specified when this control was created.

Remark: The contents of the text control could be an invalid representation of the entity which can be chosen through the picker (e.g. when the user enters an invalid colour syntax because of a typo). Thus you should never parse the content of the textctrl to get the user's input; rather use the derived-class getter (e.g. wxColourPickerCtrl:getColour/1, wxFilePickerCtrl:getPath/1, etc).

getTextCtrlProportion(This)

-spec getTextCtrlProportion(This) -> integer() when This :: wxPickerBase().

Returns the proportion value of the text control.

This function can be used only when hasTextCtrl/1 returns true.

hasTextCtrl(This)

-spec hasTextCtrl(This) -> boolean() when This :: wxPickerBase().

Returns true if this window has a valid text control (i.e. if the wxPB\_USE\_TEXTCTRL style was given when creating this control).

isPickerCtrlGrowable(This)

-spec isPickerCtrlGrowable(This) -> boolean() when This :: wxPickerBase().

Returns true if the picker control is growable.

isTextCtrlGrowable(This)

-spec isTextCtrlGrowable(This) -> boolean() when This :: wxPickerBase().

Returns true if the text control is growable.

This function can be used only when hasTextCtrl/1 returns true.

setInternalMargin(This, Margin)

-spec setInternalMargin(This, Margin) -> ok when This :: wxPickerBase(), Margin :: integer().

Sets the margin (in pixel) between the picker and the text control.

This function can be used only when hasTextCtrl/1 returns true.

setPickerCtrlGrowable(This)

-spec setPickerCtrlGrowable(This) -> ok when This :: wxPickerBase().

Equivalent to setPickerCtrlGrowable(This, []).

setPickerCtrlGrowable/2

-spec setPickerCtrlGrowable(This, [Option]) -> ok
                               when This :: wxPickerBase(), Option :: {grow, boolean()}.

Sets the picker control as growable when grow is true.

setPickerCtrlProportion(This, Prop)

-spec setPickerCtrlProportion(This, Prop) -> ok when This :: wxPickerBase(), Prop :: integer().

Sets the proportion value of the picker.

Look at the detailed description of wxPickerBase for more info.

setTextCtrlGrowable(This)

-spec setTextCtrlGrowable(This) -> ok when This :: wxPickerBase().

Equivalent to setTextCtrlGrowable(This, []).

setTextCtrlGrowable/2

-spec setTextCtrlGrowable(This, [Option]) -> ok when This :: wxPickerBase(), Option :: {grow, boolean()}.

Sets the text control as growable when grow is true.

This function can be used only when hasTextCtrl/1 returns true.

setTextCtrlProportion(This, Prop)

-spec setTextCtrlProportion(This, Prop) -> ok when This :: wxPickerBase(), Prop :: integer().

Sets the proportion value of the text control.

Look at the detailed description of wxPickerBase for more info.

This function can be used only when hasTextCtrl/1 returns true.

wxPopupTransientWindow

A wxPopupWindow which disappears automatically when the user clicks mouse outside it or if it loses focus in any other way.

This window can be useful for implementing custom combobox-like controls for example.

See: wxPopupWindow

This class is derived, and can use functions, from:

wxPopupWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxPopupTransientWindow

Summary

Types

wxPopupTransientWindow()

Functions

destroy(This)

Destroys the object

dismiss(This)

Hide the window.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

popup(This)

Equivalent to popup(This, []).

popup/2

Popup the window (this will show it too).

Types

wxPopupTransientWindow()

-type wxPopupTransientWindow() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPopupTransientWindow()) -> ok.

Destroys the object

dismiss(This)

-spec dismiss(This) -> ok when This :: wxPopupTransientWindow().

Hide the window.

new()

-spec new() -> wxPopupTransientWindow().

Default constructor.

new(Parent)

-spec new(Parent) -> wxPopupTransientWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxPopupTransientWindow()
             when Parent :: wxWindow:wxWindow(), Option :: {style, integer()}.

Constructor.

popup(This)

-spec popup(This) -> ok when This :: wxPopupTransientWindow().

Equivalent to popup(This, []).

popup/2

-spec popup(This, [Option]) -> ok
               when This :: wxPopupTransientWindow(), Option :: {focus, wxWindow:wxWindow()}.

Popup the window (this will show it too).

If focus is non-NULL, it will be kept focused while this window is shown if supported by the current platform, otherwise the popup itself will receive focus. In any case, the popup will disappear automatically if it loses focus because of a user action.

See: dismiss/1

wxPopupWindow

A special kind of top level window used for popup menus, combobox popups and such.

Styles

This class supports the following styles:

wxPU_CONTAINS_CONTROLS: By default in wxMSW, a popup window will not take focus from its parent window. However many standard controls, including common ones such as wxTextCtrl, need focus to function correctly and will not work when placed on a default popup. This flag can be used to make the popup take focus and let all controls work but at the price of not allowing the parent window to keep focus while the popup is shown, which can also be sometimes desirable. This style is currently only implemented in MSW and simply does nothing under the other platforms (it's new since wxWidgets 3.1.3).

See:

wxDialog

wxFrame

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxPopupWindow

Summary

Types

wxPopupWindow()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Create method for two-step creation.

destroy(This)

Destroys the object

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

position(This, PtOrigin, SizePopup)

Move the popup window to the right position, i.e. such that it is entirely visible.

Types

wxPopupWindow()

-type wxPopupWindow() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxPopupWindow(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxPopupWindow(), Parent :: wxWindow:wxWindow(), Option :: {flags, integer()}.

Create method for two-step creation.

destroy(This)

-spec destroy(This :: wxPopupWindow()) -> ok.

Destroys the object

new()

-spec new() -> wxPopupWindow().

Default constructor.

new(Parent)

-spec new(Parent) -> wxPopupWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxPopupWindow()
             when Parent :: wxWindow:wxWindow(), Option :: {flags, integer()}.

Constructor.

position(This, PtOrigin, SizePopup)

-spec position(This, PtOrigin, SizePopup) -> ok
                  when
                      This :: wxPopupWindow(),
                      PtOrigin :: {X :: integer(), Y :: integer()},
                      SizePopup :: {W :: integer(), H :: integer()}.

Move the popup window to the right position, i.e. such that it is entirely visible.

The popup is positioned at ptOrigin + size if it opens below and to the right (default), at ptOrigin - sizePopup if it opens above and to the left etc.

wxPostScriptDC

This defines the wxWidgets Encapsulated PostScript device context, which can write PostScript files on any platform.

See wxDC for descriptions of the member functions.

Starting a document

Document should be started with call to wxDC:startDoc/2 prior to calling any function to execute a drawing operation. However, some functions, like wxDC:setFont/2, may be legitimately called even before wxDC:startDoc/2.

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxPostScriptDC

Summary

Types

wxPostScriptDC()

Functions

destroy(This)

Destroys the object

new()

new(PrintData)

Constructs a PostScript printer device context from a wxPrintData object.

Types

wxPostScriptDC()

-type wxPostScriptDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPostScriptDC()) -> ok.

Destroys the object

new()

-spec new() -> wxPostScriptDC().

new(PrintData)

-spec new(PrintData) -> wxPostScriptDC() when PrintData :: wxPrintData:wxPrintData().

Constructs a PostScript printer device context from a wxPrintData object.

wxPreviewCanvas

A preview canvas is the default canvas used by the print preview system to display the preview.

See:

wxPreviewFrame

wxPreviewControlBar

wxPrintPreview

This class is derived, and can use functions, from:

wxScrolledWindow

wxPanel

wxWindow

wxEvtHandler

wxWidgets docs: wxPreviewCanvas

Summary

Types

wxPreviewCanvas()

Types

wxPreviewCanvas()

-type wxPreviewCanvas() :: wx:wx_object().

wxPreviewControlBar

This is the default implementation of the preview control bar, a panel with buttons and a zoom control.

You can derive a new class from this and override some or all member functions to change the behaviour and appearance; or you can leave it as it is.

See:

wxPreviewFrame

wxPreviewCanvas

wxPrintPreview

This class is derived, and can use functions, from:

wxPanel

wxWindow

wxEvtHandler

wxWidgets docs: wxPreviewControlBar

Summary

Types

wxPreviewControlBar()

Functions

createButtons(This)

Creates buttons, according to value of the button style flags.

destroy(This)

Destroys the object

getPrintPreview(This)

Gets the print preview object associated with the control bar.

getZoomControl(This)

Gets the current zoom setting in percent.

new(Preview, Buttons, Parent)

Equivalent to new(Preview, Buttons, Parent, []).

new/4

Constructor.

setZoomControl(This, Percent)

Sets the zoom control.

Types

wxPreviewControlBar()

-type wxPreviewControlBar() :: wx:wx_object().

Functions

createButtons(This)

-spec createButtons(This) -> ok when This :: wxPreviewControlBar().

Creates buttons, according to value of the button style flags.

destroy(This)

-spec destroy(This :: wxPreviewControlBar()) -> ok.

Destroys the object

getPrintPreview(This)

-spec getPrintPreview(This) -> wxPrintPreview:wxPrintPreview() when This :: wxPreviewControlBar().

Gets the print preview object associated with the control bar.

getZoomControl(This)

-spec getZoomControl(This) -> integer() when This :: wxPreviewControlBar().

Gets the current zoom setting in percent.

new(Preview, Buttons, Parent)

-spec new(Preview, Buttons, Parent) -> wxPreviewControlBar()
             when
                 Preview :: wxPrintPreview:wxPrintPreview(),
                 Buttons :: integer(),
                 Parent :: wxWindow:wxWindow().

Equivalent to new(Preview, Buttons, Parent, []).

new/4

-spec new(Preview, Buttons, Parent, [Option]) -> wxPreviewControlBar()
             when
                 Preview :: wxPrintPreview:wxPrintPreview(),
                 Buttons :: integer(),
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

The buttons parameter may be a combination of the following, using the bitwise 'or' operator:

wxPREVIEW_PRINT: Create a print button.

wxPREVIEW_NEXT: Create a next page button.

wxPREVIEW_PREVIOUS: Create a previous page button.

wxPREVIEW_ZOOM: Create a zoom control.

wxPREVIEW_DEFAULT: Equivalent to a combination of wxPREVIEW_PREVIOUS, wxPREVIEW_NEXT and wxPREVIEW_ZOOM.

setZoomControl(This, Percent)

-spec setZoomControl(This, Percent) -> ok when This :: wxPreviewControlBar(), Percent :: integer().

Sets the zoom control.

wxPreviewFrame

This class provides the default method of managing the print preview interface.

Member functions may be overridden to replace functionality, or the class may be used without derivation.

See:

wxPreviewCanvas

wxPreviewControlBar

wxPrintPreview

This class is derived, and can use functions, from:

wxFrame

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxPreviewFrame

Summary

Types

wxPreviewFrame()

Functions

createCanvas(This)

Creates a wxPreviewCanvas.

createControlBar(This)

Creates a wxPreviewControlBar.

destroy(This)

Destroys the object

initialize(This)

Initializes the frame elements and prepares for showing it.

new(Preview, Parent)

Equivalent to new(Preview, Parent, []).

new/3

Constructor.

onCloseWindow(This, Event)

Enables any disabled frames in the application, and deletes the print preview object, implicitly deleting any printout objects associated with the print preview object.

Types

wxPreviewFrame()

-type wxPreviewFrame() :: wx:wx_object().

Functions

createCanvas(This)

-spec createCanvas(This) -> ok when This :: wxPreviewFrame().

Creates a wxPreviewCanvas.

Override this function to allow a user-defined preview canvas object to be created.

createControlBar(This)

-spec createControlBar(This) -> ok when This :: wxPreviewFrame().

Creates a wxPreviewControlBar.

Override this function to allow a user-defined preview control bar object to be created.

destroy(This)

-spec destroy(This :: wxPreviewFrame()) -> ok.

Destroys the object

initialize(This)

-spec initialize(This) -> ok when This :: wxPreviewFrame().

Initializes the frame elements and prepares for showing it.

Calling this method is equivalent to calling InitializeWithModality() (not implemented in wx) with wxPreviewFrame_AppModal argument, please see its documentation for more details.

Please notice that this function is virtual mostly for backwards compatibility only, there is no real need to override it as it's never called by wxWidgets itself.

new(Preview, Parent)

-spec new(Preview, Parent) -> wxPreviewFrame()
             when Preview :: wxPrintPreview:wxPrintPreview(), Parent :: wxWindow:wxWindow().

Equivalent to new(Preview, Parent, []).

new/3

-spec new(Preview, Parent, [Option]) -> wxPreviewFrame()
             when
                 Preview :: wxPrintPreview:wxPrintPreview(),
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {title, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

Pass a print preview object plus other normal frame arguments. The print preview object will be destroyed by the frame when it closes.

onCloseWindow(This, Event)

-spec onCloseWindow(This, Event) -> ok
                       when This :: wxPreviewFrame(), Event :: wxCloseEvent:wxCloseEvent().

Enables any disabled frames in the application, and deletes the print preview object, implicitly deleting any printout objects associated with the print preview object.

wxPrintData

This class holds a variety of information related to printers and printer device contexts.

This class is used to create a wxPrinterDC (not implemented in wx) and a wxPostScriptDC. It is also used as a data member of wxPrintDialogData and wxPageSetupDialogData, as part of the mechanism for transferring data between the print dialogs and the application.

See:

Overview printing

wxPrintDialog

wxPageSetupDialog

wxPrintDialogData

wxPageSetupDialogData

Overview cmndlg

wxPostScriptDC

wxWidgets docs: wxPrintData

Summary

Types

wxPrintData()

Functions

destroy(This)

Destroys the object

getBin(This)

Returns the current bin (papersource).

getCollate(This)

Returns true if collation is on.

getColour(This)

Returns true if colour printing is on.

getDuplex(This)

Returns the duplex mode.

getNoCopies(This)

Returns the number of copies requested by the user.

getOrientation(This)

Gets the orientation.

getPaperId(This)

Returns the paper size id.

getPrinterName(This)

Returns the printer name.

getQuality(This)

Returns the current print quality.

isOk(This)

Returns true if the print data is valid for using in print dialogs.

new()

Default constructor.

new(Data)

Copy constructor.

setBin(This, Flag)

Sets the current bin.

setCollate(This, Flag)

Sets collation to on or off.

setColour(This, Flag)

Sets colour printing on or off.

setDuplex(This, Mode)

Returns the duplex mode.

setNoCopies(This, N)

Sets the default number of copies to be printed out.

setOrientation(This, Orientation)

Sets the orientation.

setPaperId(This, PaperId)

Sets the paper id.

setPrinterName(This, PrinterName)

Sets the printer name.

setQuality(This, Quality)

Sets the desired print quality.

Types

wxPrintData()

-type wxPrintData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPrintData()) -> ok.

Destroys the object

getBin(This)

-spec getBin(This) -> wx:wx_enum() when This :: wxPrintData().

Returns the current bin (papersource).

By default, the system is left to select the bin (wxPRINTBIN_DEFAULT is returned).

See setBin/2 for the full list of bin values.

getCollate(This)

-spec getCollate(This) -> boolean() when This :: wxPrintData().

Returns true if collation is on.

getColour(This)

-spec getColour(This) -> boolean() when This :: wxPrintData().

Returns true if colour printing is on.

getDuplex(This)

-spec getDuplex(This) -> wx:wx_enum() when This :: wxPrintData().

Returns the duplex mode.

One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL.

getNoCopies(This)

-spec getNoCopies(This) -> integer() when This :: wxPrintData().

Returns the number of copies requested by the user.

getOrientation(This)

-spec getOrientation(This) -> wx:wx_enum() when This :: wxPrintData().

Gets the orientation.

This can be wxLANDSCAPE or wxPORTRAIT.

getPaperId(This)

-spec getPaperId(This) -> wx:wx_enum() when This :: wxPrintData().

Returns the paper size id.

See: setPaperId/2

getPrinterName(This)

-spec getPrinterName(This) -> unicode:charlist() when This :: wxPrintData().

Returns the printer name.

If the printer name is the empty string, it indicates that the default printer should be used.

getQuality(This)

-spec getQuality(This) -> integer() when This :: wxPrintData().

Returns the current print quality.

This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers:

wxPRINT_QUALITY_HIGH

wxPRINT_QUALITY_MEDIUM

wxPRINT_QUALITY_LOW

wxPRINT_QUALITY_DRAFT

On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting.

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPrintData().

Returns true if the print data is valid for using in print dialogs.

This can return false on Windows if the current printer is not set, for example. On all other platforms, it returns true.

new()

-spec new() -> wxPrintData().

Default constructor.

new(Data)

-spec new(Data) -> wxPrintData() when Data :: wxPrintData().

Copy constructor.

setBin(This, Flag)

-spec setBin(This, Flag) -> ok when This :: wxPrintData(), Flag :: wx:wx_enum().

Sets the current bin.

setCollate(This, Flag)

-spec setCollate(This, Flag) -> ok when This :: wxPrintData(), Flag :: boolean().

Sets collation to on or off.

setColour(This, Flag)

-spec setColour(This, Flag) -> ok when This :: wxPrintData(), Flag :: boolean().

Sets colour printing on or off.

setDuplex(This, Mode)

-spec setDuplex(This, Mode) -> ok when This :: wxPrintData(), Mode :: wx:wx_enum().

Returns the duplex mode.

One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL.

setNoCopies(This, N)

-spec setNoCopies(This, N) -> ok when This :: wxPrintData(), N :: integer().

Sets the default number of copies to be printed out.

setOrientation(This, Orientation)

-spec setOrientation(This, Orientation) -> ok when This :: wxPrintData(), Orientation :: wx:wx_enum().

Sets the orientation.

This can be wxLANDSCAPE or wxPORTRAIT.

setPaperId(This, PaperId)

-spec setPaperId(This, PaperId) -> ok when This :: wxPrintData(), PaperId :: wx:wx_enum().

Sets the paper id.

This indicates the type of paper to be used. For a mapping between paper id, paper size and string name, see wxPrintPaperDatabase in "paper.h" (not yet documented).

setPrinterName(This, PrinterName)

-spec setPrinterName(This, PrinterName) -> ok
                        when This :: wxPrintData(), PrinterName :: unicode:chardata().

Sets the printer name.

This can be the empty string to indicate that the default printer should be used.

setQuality(This, Quality)

-spec setQuality(This, Quality) -> ok when This :: wxPrintData(), Quality :: integer().

Sets the desired print quality.

This can be a positive integer, denoting the number of dots per inch, or one of the following identifiers:

wxPRINT_QUALITY_HIGH

wxPRINT_QUALITY_MEDIUM

wxPRINT_QUALITY_LOW

wxPRINT_QUALITY_DRAFT

On input you should pass one of these identifiers, but on return you may get back a positive integer indicating the current resolution setting.

wxPrintDialog

This class represents the print and print setup common dialogs.

You may obtain a wxPrinterDC (not implemented in wx) device context from a successfully dismissed print dialog.

See:

Overview printing

Overview cmndlg

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxPrintDialog

Summary

Types

wxPrintDialog()

Functions

destroy(This)

Destroys the object

getPrintDC(This)

Returns the device context created by the print dialog, if any.

getPrintDialogData(This)

Returns the print dialog data associated with the print dialog.

new(Parent)

Equivalent to new(Parent, []).

new/2

Types

wxPrintDialog()

-type wxPrintDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPrintDialog()) -> ok.

Destroys the object

getPrintDC(This)

-spec getPrintDC(This) -> wxDC:wxDC() when This :: wxPrintDialog().

Returns the device context created by the print dialog, if any.

When this function has been called, the ownership of the device context is transferred to the application, so it must then be deleted explicitly.

getPrintDialogData(This)

-spec getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData() when This :: wxPrintDialog().

Returns the print dialog data associated with the print dialog.

new(Parent)

-spec new(Parent) -> wxPrintDialog() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxPrintDialog()
             when Parent :: wxWindow:wxWindow(), Option :: {data, wxPrintDialogData:wxPrintDialogData()};
         (Parent, Data) -> wxPrintDialog()
             when Parent :: wxWindow:wxWindow(), Data :: wxPrintData:wxPrintData().

wxPrintDialogData

This class holds information related to the visual characteristics of wxPrintDialog.

It contains a wxPrintData object with underlying printing settings.

See:

Overview printing

wxPrintDialog

Overview cmndlg

wxWidgets docs: wxPrintDialogData

Summary

Types

wxPrintDialogData()

Functions

destroy(This)

Destroys the object

enableHelp(This, Flag)

Enables or disables the "Help" button.

enablePageNumbers(This, Flag)

Enables or disables the "Page numbers" controls.

enablePrintToFile(This, Flag)

Enables or disables the "Print to file" checkbox.

enableSelection(This, Flag)

Enables or disables the "Selection" radio button.

getAllPages(This)

Returns true if the user requested that all pages be printed.

getCollate(This)

Returns true if the user requested that the document(s) be collated.

getFromPage(This)

Returns the from page number, as entered by the user.

getMaxPage(This)

Returns the maximum page number.

getMinPage(This)

Returns the minimum page number.

getNoCopies(This)

Returns the number of copies requested by the user.

getPrintData(This)

Returns a reference to the internal wxPrintData object.

getPrintToFile(This)

Returns true if the user has selected printing to a file.

getSelection(This)

Returns true if the user requested that the selection be printed (where "selection" is a concept specific to the application).

getToPage(This)

Returns the "print to" page number, as entered by the user.

isOk(This)

Returns true if the print data is valid for using in print dialogs.

new()

Default constructor.

new(DialogData)

Copy constructor.

setCollate(This, Flag)

Sets the "Collate" checkbox to true or false.

setFromPage(This, Page)

Sets the from page number.

setMaxPage(This, Page)

Sets the maximum page number.

setMinPage(This, Page)

Sets the minimum page number.

setNoCopies(This, N)

Sets the default number of copies the user has requested to be printed out.

setPrintData(This, PrintData)

Sets the internal wxPrintData.

setPrintToFile(This, Flag)

Sets the "Print to file" checkbox to true or false.

setSelection(This, Flag)

Selects the "Selection" radio button.

setToPage(This, Page)

Sets the "print to" page number.

Types

wxPrintDialogData()

-type wxPrintDialogData() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPrintDialogData()) -> ok.

Destroys the object

enableHelp(This, Flag)

-spec enableHelp(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Enables or disables the "Help" button.

enablePageNumbers(This, Flag)

-spec enablePageNumbers(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Enables or disables the "Page numbers" controls.

enablePrintToFile(This, Flag)

-spec enablePrintToFile(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Enables or disables the "Print to file" checkbox.

enableSelection(This, Flag)

-spec enableSelection(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Enables or disables the "Selection" radio button.

getAllPages(This)

-spec getAllPages(This) -> boolean() when This :: wxPrintDialogData().

Returns true if the user requested that all pages be printed.

getCollate(This)

-spec getCollate(This) -> boolean() when This :: wxPrintDialogData().

Returns true if the user requested that the document(s) be collated.

getFromPage(This)

-spec getFromPage(This) -> integer() when This :: wxPrintDialogData().

Returns the from page number, as entered by the user.

getMaxPage(This)

-spec getMaxPage(This) -> integer() when This :: wxPrintDialogData().

Returns the maximum page number.

getMinPage(This)

-spec getMinPage(This) -> integer() when This :: wxPrintDialogData().

Returns the minimum page number.

getNoCopies(This)

-spec getNoCopies(This) -> integer() when This :: wxPrintDialogData().

Returns the number of copies requested by the user.

getPrintData(This)

-spec getPrintData(This) -> wxPrintData:wxPrintData() when This :: wxPrintDialogData().

Returns a reference to the internal wxPrintData object.

getPrintToFile(This)

-spec getPrintToFile(This) -> boolean() when This :: wxPrintDialogData().

Returns true if the user has selected printing to a file.

getSelection(This)

-spec getSelection(This) -> boolean() when This :: wxPrintDialogData().

Returns true if the user requested that the selection be printed (where "selection" is a concept specific to the application).

getToPage(This)

-spec getToPage(This) -> integer() when This :: wxPrintDialogData().

Returns the "print to" page number, as entered by the user.

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPrintDialogData().

Returns true if the print data is valid for using in print dialogs.

This can return false on Windows if the current printer is not set, for example. On all other platforms, it returns true.

new()

-spec new() -> wxPrintDialogData().

Default constructor.

new(DialogData)

-spec new(DialogData) -> wxPrintDialogData()
             when DialogData :: wxPrintDialogData:wxPrintDialogData() | wxPrintData:wxPrintData().

Copy constructor.

setCollate(This, Flag)

-spec setCollate(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Sets the "Collate" checkbox to true or false.

setFromPage(This, Page)

-spec setFromPage(This, Page) -> ok when This :: wxPrintDialogData(), Page :: integer().

Sets the from page number.

setMaxPage(This, Page)

-spec setMaxPage(This, Page) -> ok when This :: wxPrintDialogData(), Page :: integer().

Sets the maximum page number.

setMinPage(This, Page)

-spec setMinPage(This, Page) -> ok when This :: wxPrintDialogData(), Page :: integer().

Sets the minimum page number.

setNoCopies(This, N)

-spec setNoCopies(This, N) -> ok when This :: wxPrintDialogData(), N :: integer().

Sets the default number of copies the user has requested to be printed out.

setPrintData(This, PrintData)

-spec setPrintData(This, PrintData) -> ok
                      when This :: wxPrintDialogData(), PrintData :: wxPrintData:wxPrintData().

Sets the internal wxPrintData.

setPrintToFile(This, Flag)

-spec setPrintToFile(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Sets the "Print to file" checkbox to true or false.

setSelection(This, Flag)

-spec setSelection(This, Flag) -> ok when This :: wxPrintDialogData(), Flag :: boolean().

Selects the "Selection" radio button.

The effect of printing the selection depends on how the application implements this command, if at all.

setToPage(This, Page)

-spec setToPage(This, Page) -> ok when This :: wxPrintDialogData(), Page :: integer().

Sets the "print to" page number.

wxPrintPreview

Objects of this class manage the print preview process.

The object is passed a wxPrintout object, and the wxPrintPreview object itself is passed to a wxPreviewFrame object. Previewing is started by initializing and showing the preview frame. Unlike wxPrinter:print/4, flow of control returns to the application immediately after the frame is shown.

Note: The preview shown is only exact on Windows. On other platforms, the wxDC used for preview is different from what is used for printing and the results may be significantly different, depending on how is the output created. In particular, printing code relying on wxDC:getTextExtent/3 heavily (for example, wxHtmlEasyPrinting and other wxHTML classes do) is affected. It is recommended to use native preview functionality on platforms that offer it (macOS, GTK+).

See:

Overview printing

wxPrintDialog

wxPrintout

wxPrinter

wxPreviewCanvas

wxPreviewControlBar

wxPreviewFrame

wxWidgets docs: wxPrintPreview

Summary

Types

wxPrintPreview()

Functions

destroy(This)

Destroys the object

getCanvas(This)

Gets the preview window used for displaying the print preview image.

getCurrentPage(This)

Gets the page currently being previewed.

getFrame(This)

Gets the frame used for displaying the print preview canvas and control bar.

getMaxPage(This)

Returns the maximum page number.

getMinPage(This)

Returns the minimum page number.

getPrintout(This)

Gets the preview printout object associated with the wxPrintPreview object.

getPrintoutForPrinting(This)

Gets the printout object to be used for printing from within the preview interface, or NULL if none exists.

isOk(This)

Returns true if the wxPrintPreview is valid, false otherwise.

new(Printout)

Equivalent to new(Printout, []).

new/2

Constructor.

new(Printout, PrintoutForPrinting, Data)

paintPage(This, Canvas, Dc)

This refreshes the preview window with the preview image.

print(This, Prompt)

Invokes the print process using the second wxPrintout object supplied in the wxPrintPreview constructor.

renderPage(This, PageNum)

Renders a page into a wxMemoryDC.

setCanvas(This, Window)

Sets the window to be used for displaying the print preview image.

setCurrentPage(This, PageNum)

Sets the current page to be previewed.

setFrame(This, Frame)

Sets the frame to be used for displaying the print preview canvas and control bar.

setPrintout(This, Printout)

Associates a printout object with the wxPrintPreview object.

setZoom(This, Percent)

Sets the percentage preview zoom, and refreshes the preview canvas accordingly.

Types

wxPrintPreview()

-type wxPrintPreview() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPrintPreview()) -> ok.

Destroys the object

getCanvas(This)

-spec getCanvas(This) -> wxPreviewCanvas:wxPreviewCanvas() when This :: wxPrintPreview().

Gets the preview window used for displaying the print preview image.

getCurrentPage(This)

-spec getCurrentPage(This) -> integer() when This :: wxPrintPreview().

Gets the page currently being previewed.

getFrame(This)

-spec getFrame(This) -> wxFrame:wxFrame() when This :: wxPrintPreview().

Gets the frame used for displaying the print preview canvas and control bar.

getMaxPage(This)

-spec getMaxPage(This) -> integer() when This :: wxPrintPreview().

Returns the maximum page number.

getMinPage(This)

-spec getMinPage(This) -> integer() when This :: wxPrintPreview().

Returns the minimum page number.

getPrintout(This)

-spec getPrintout(This) -> wxPrintout:wxPrintout() when This :: wxPrintPreview().

Gets the preview printout object associated with the wxPrintPreview object.

getPrintoutForPrinting(This)

-spec getPrintoutForPrinting(This) -> wxPrintout:wxPrintout() when This :: wxPrintPreview().

Gets the printout object to be used for printing from within the preview interface, or NULL if none exists.

isOk(This)

-spec isOk(This) -> boolean() when This :: wxPrintPreview().

Returns true if the wxPrintPreview is valid, false otherwise.

It could return false if there was a problem initializing the printer device context (current printer not set, for example).

new(Printout)

-spec new(Printout) -> wxPrintPreview() when Printout :: wxPrintout:wxPrintout().

Equivalent to new(Printout, []).

new/2

-spec new(Printout, [Option]) -> wxPrintPreview()
             when
                 Printout :: wxPrintout:wxPrintout(),
                 Option ::
                     {printoutForPrinting, wxPrintout:wxPrintout()} |
                     {data, wxPrintDialogData:wxPrintDialogData()}.

Constructor.

Pass a printout object, an optional printout object to be used for actual printing, and the address of an optional block of printer data, which will be copied to the print preview object's print data.

If printoutForPrinting is non-NULL, a "Print..." button will be placed on the preview frame so that the user can print directly from the preview interface.

Remark: Do not explicitly delete the printout objects once this constructor has been called, since they will be deleted in the wxPrintPreview destructor. The same does not apply to the data argument.

Use isOk/1 to check whether the wxPrintPreview object was created correctly.

new(Printout, PrintoutForPrinting, Data)

-spec new(Printout, PrintoutForPrinting, Data) -> wxPrintPreview()
             when
                 Printout :: wxPrintout:wxPrintout(),
                 PrintoutForPrinting :: wxPrintout:wxPrintout(),
                 Data :: wxPrintData:wxPrintData().

paintPage(This, Canvas, Dc)

-spec paintPage(This, Canvas, Dc) -> boolean()
                   when
                       This :: wxPrintPreview(),
                       Canvas :: wxPreviewCanvas:wxPreviewCanvas(),
                       Dc :: wxDC:wxDC().

This refreshes the preview window with the preview image.

It must be called from the preview window's OnPaint member.

The implementation simply blits the preview bitmap onto the canvas, creating a new preview bitmap if none exists.

print(This, Prompt)

-spec print(This, Prompt) -> boolean() when This :: wxPrintPreview(), Prompt :: boolean().

Invokes the print process using the second wxPrintout object supplied in the wxPrintPreview constructor.

Will normally be called by the Print... panel item on the preview frame's control bar.

Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.

renderPage(This, PageNum)

-spec renderPage(This, PageNum) -> boolean() when This :: wxPrintPreview(), PageNum :: integer().

Renders a page into a wxMemoryDC.

Used internally by wxPrintPreview.

setCanvas(This, Window)

-spec setCanvas(This, Window) -> ok
                   when This :: wxPrintPreview(), Window :: wxPreviewCanvas:wxPreviewCanvas().

Sets the window to be used for displaying the print preview image.

setCurrentPage(This, PageNum)

-spec setCurrentPage(This, PageNum) -> boolean() when This :: wxPrintPreview(), PageNum :: integer().

Sets the current page to be previewed.

setFrame(This, Frame)

-spec setFrame(This, Frame) -> ok when This :: wxPrintPreview(), Frame :: wxFrame:wxFrame().

Sets the frame to be used for displaying the print preview canvas and control bar.

setPrintout(This, Printout)

-spec setPrintout(This, Printout) -> ok
                     when This :: wxPrintPreview(), Printout :: wxPrintout:wxPrintout().

Associates a printout object with the wxPrintPreview object.

setZoom(This, Percent)

-spec setZoom(This, Percent) -> ok when This :: wxPrintPreview(), Percent :: integer().

Sets the percentage preview zoom, and refreshes the preview canvas accordingly.

wxPrinter

This class represents the Windows or PostScript printer, and is the vehicle through which printing may be launched by an application.

Printing can also be achieved through using of lower functions and classes, but this and associated classes provide a more convenient and general method of printing.

See:

Overview printing

wxPrintDialog

wxPrintout

wxPrintPreview

wxWidgets docs: wxPrinter

Summary

Types

wxPrinter()

Functions

createAbortWindow(This, Parent, Printout)

Creates the default printing abort window, with a cancel button.

destroy(This)

Destroys the object

getAbort(This)

Returns true if the user has aborted the print job.

getLastError()

Return last error.

getPrintDialogData(This)

Returns the print data associated with the printer object.

new()

Equivalent to new([]).

new(Options)

Constructor.

print(This, Parent, Printout)

Equivalent to print(This, Parent, Printout, []).

print/4

Starts the printing process.

printDialog(This, Parent)

Invokes the print dialog.

reportError(This, Parent, Printout, Message)

Default error-reporting function.

setup(This, Parent)

Invokes the print setup dialog.

Types

wxPrinter()

-type wxPrinter() :: wx:wx_object().

Functions

createAbortWindow(This, Parent, Printout)

-spec createAbortWindow(This, Parent, Printout) -> wxDialog:wxDialog()
                           when
                               This :: wxPrinter(),
                               Parent :: wxWindow:wxWindow(),
                               Printout :: wxPrintout:wxPrintout().

Creates the default printing abort window, with a cancel button.

destroy(This)

-spec destroy(This :: wxPrinter()) -> ok.

Destroys the object

getAbort(This)

-spec getAbort(This) -> boolean() when This :: wxPrinter().

Returns true if the user has aborted the print job.

getLastError()

-spec getLastError() -> wx:wx_enum().

Return last error.

Valid after calling print/4, printDialog/2 or wxPrintPreview:print/2.

These functions set last error to wxPRINTER_NO_ERROR if no error happened.

Returned value is one of the following:

getPrintDialogData(This)

-spec getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData() when This :: wxPrinter().

Returns the print data associated with the printer object.

new()

-spec new() -> wxPrinter().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxPrinter() when Option :: {data, wxPrintDialogData:wxPrintDialogData()}.

Constructor.

Pass an optional pointer to a block of print dialog data, which will be copied to the printer object's local data.

See:

wxPrintDialogData

wxPrintData

print(This, Parent, Printout)

-spec print(This, Parent, Printout) -> boolean()
               when
                   This :: wxPrinter(),
                   Parent :: wxWindow:wxWindow(),
                   Printout :: wxPrintout:wxPrintout().

Equivalent to print(This, Parent, Printout, []).

print/4

-spec print(This, Parent, Printout, [Option]) -> boolean()
               when
                   This :: wxPrinter(),
                   Parent :: wxWindow:wxWindow(),
                   Printout :: wxPrintout:wxPrintout(),
                   Option :: {prompt, boolean()}.

Starts the printing process.

Provide a parent window, a user-defined wxPrintout object which controls the printing of a document, and whether the print dialog should be invoked first.

print/4 could return false if there was a problem initializing the printer device context (current printer not set, for example) or the user cancelled printing. Call getLastError/0 to get detailed information about the kind of the error.

printDialog(This, Parent)

-spec printDialog(This, Parent) -> wxDC:wxDC() when This :: wxPrinter(), Parent :: wxWindow:wxWindow().

Invokes the print dialog.

If successful (the user did not press Cancel and no error occurred), a suitable device context will be returned; otherwise NULL is returned; call getLastError/0 to get detailed information about the kind of the error.

Remark: The application must delete this device context to avoid a memory leak.

reportError(This, Parent, Printout, Message)

-spec reportError(This, Parent, Printout, Message) -> ok
                     when
                         This :: wxPrinter(),
                         Parent :: wxWindow:wxWindow(),
                         Printout :: wxPrintout:wxPrintout(),
                         Message :: unicode:chardata().

Default error-reporting function.

setup(This, Parent)

-spec setup(This, Parent) -> boolean() when This :: wxPrinter(), Parent :: wxWindow:wxWindow().

Invokes the print setup dialog.

Deprecated:

The setup dialog is obsolete, though retained for backward compatibility.

wxPrintout

This class encapsulates the functionality of printing out an application document.

A new class must be derived and members overridden to respond to calls such as OnPrintPage() (not implemented in wx) and HasPage() (not implemented in wx) and to render the print image onto an associated wxDC. Instances of this class are passed to wxPrinter:print/4 or to a wxPrintPreview object to initiate printing or previewing.

Your derived wxPrintout is responsible for drawing both the preview image and the printed page. If your windows' drawing routines accept an arbitrary DC as an argument, you can re-use those routines within your wxPrintout subclass to draw the printout image. You may also add additional drawing elements within your wxPrintout subclass, like headers, footers, and/or page numbers. However, the image on the printed page will often differ from the image drawn on the screen, as will the print preview image - not just in the presence of headers and footers, but typically in scale. A high-resolution printer presents a much larger drawing surface (i.e., a higher-resolution DC); a zoomed-out preview image presents a much smaller drawing surface (lower-resolution DC). By using the routines FitThisSizeToXXX() and/or MapScreenSizeToXXX() within your wxPrintout subclass to set the user scale and origin of the associated DC, you can easily use a single drawing routine to draw on your application's windows, to create the print preview image, and to create the printed paper image, and achieve a common appearance to the preview image and the printed page.

See:

Overview printing

wxPrintDialog

wxPageSetupDialog

wxPrinter

wxPrintPreview

wxWidgets docs: wxPrintout

Summary

Types

wxPrintout()

Functions

destroy(This)

Destroys the object

fitThisSizeToPage(This, ImageSize)

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page rectangle and the origin is at the top left corner of the page rectangle.

fitThisSizeToPageMargins(This, ImageSize, PageSetupData)

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page margins set in the given wxPageSetupDialogData object.

fitThisSizeToPaper(This, ImageSize)

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the paper and the origin is at the top left corner of the paper.

getDC(This)

Returns the device context associated with the printout (given to the printout at start of printing or previewing).

getLogicalPageMarginsRect(This, PageSetupData)

Return the rectangle corresponding to the page margins specified by the given wxPageSetupDialogData object in the associated wxDC's logical coordinates for the current user scale and device origin.

getLogicalPageRect(This)

Return the rectangle corresponding to the page in the associated wxDC 's logical coordinates for the current user scale and device origin.

getLogicalPaperRect(This)

Return the rectangle corresponding to the paper in the associated wxDC 's logical coordinates for the current user scale and device origin.

getPageSizeMM(This)

Returns the size of the printer page in millimetres.

getPageSizePixels(This)

Returns the size of the printer page in pixels, called the page rectangle.

getPaperRectPixels(This)

Returns the rectangle that corresponds to the entire paper in pixels, called the paper rectangle.

getPPIPrinter(This)

Returns the number of pixels per logical inch of the printer device context.

getPPIScreen(This)

Returns the number of pixels per logical inch of the screen device context.

getTitle(This)

Returns the title of the printout.

isPreview(This)

Returns true if the printout is currently being used for previewing.

mapScreenSizeToDevice(This)

Set the user scale and device origin of the wxDC associated with this wxPrintout so that one screen pixel maps to one device pixel on the DC.

mapScreenSizeToPage(This)

This sets the user scale of the wxDC associated with this wxPrintout to the same scale as mapScreenSizeToPaper/1 but sets the logical origin to the top left corner of the page rectangle.

mapScreenSizeToPageMargins(This, PageSetupData)

This sets the user scale of the wxDC associated with this wxPrintout to the same scale as mapScreenSizeToPageMargins/2 but sets the logical origin to the top left corner of the page margins specified by the given wxPageSetupDialogData object.

mapScreenSizeToPaper(This)

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the printed page matches the screen size as closely as possible and the logical origin is in the top left corner of the paper rectangle.

new(Title, OnPrintPage)

Equivalent to new/3.

new(Title, OnPrintPage, Opts)

Constructor.

offsetLogicalOrigin(This, Xoff, Yoff)

Shift the device origin by an amount specified in logical coordinates.

setLogicalOrigin(This, X, Y)

Set the device origin of the associated wxDC so that the current logical point becomes the new logical origin.

Types

wxPrintout()

-type wxPrintout() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxPrintout()) -> ok.

Destroys the object

fitThisSizeToPage(This, ImageSize)

-spec fitThisSizeToPage(This, ImageSize) -> ok
                           when This :: wxPrintout(), ImageSize :: {W :: integer(), H :: integer()}.

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page rectangle and the origin is at the top left corner of the page rectangle.

On MSW and Mac, the page rectangle is the printable area of the page. On other platforms and PostScript printing, the page rectangle is the entire paper.

Use this if you want your printed image as large as possible, but with the caveat that on some platforms, portions of the image might be cut off at the edges.

fitThisSizeToPageMargins(This, ImageSize, PageSetupData)

-spec fitThisSizeToPageMargins(This, ImageSize, PageSetupData) -> ok
                                  when
                                      This :: wxPrintout(),
                                      ImageSize :: {W :: integer(), H :: integer()},
                                      PageSetupData :: wxPageSetupDialogData:wxPageSetupDialogData().

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page margins set in the given wxPageSetupDialogData object.

This function provides the greatest consistency across all platforms because it does not depend on having access to the printable area of the paper.

Remark: On Mac, the native wxPageSetupDialog does not let you set the page margins; you'll have to provide your own mechanism, or you can use the Mac-only class wxMacPageMarginsDialog.

fitThisSizeToPaper(This, ImageSize)

-spec fitThisSizeToPaper(This, ImageSize) -> ok
                            when This :: wxPrintout(), ImageSize :: {W :: integer(), H :: integer()}.

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the paper and the origin is at the top left corner of the paper.

Use this if you're managing your own page margins.

Note: With most printers, the region around the edges of the paper are not printable so that the edges of the image could be cut off.

getDC(This)

-spec getDC(This) -> wxDC:wxDC() when This :: wxPrintout().

Returns the device context associated with the printout (given to the printout at start of printing or previewing).

The application can use getDC/1 to obtain a device context to draw on.

This will be a wxPrinterDC (not implemented in wx) if printing under Windows or Mac, a wxPostScriptDC if printing on other platforms, and a wxMemoryDC if previewing.

getLogicalPageMarginsRect(This, PageSetupData)

-spec getLogicalPageMarginsRect(This, PageSetupData) ->
                                   {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                                   when
                                       This :: wxPrintout(),
                                       PageSetupData :: wxPageSetupDialogData:wxPageSetupDialogData().

Return the rectangle corresponding to the page margins specified by the given wxPageSetupDialogData object in the associated wxDC's logical coordinates for the current user scale and device origin.

The page margins are specified with respect to the edges of the paper on all platforms.

getLogicalPageRect(This)

-spec getLogicalPageRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                            when This :: wxPrintout().

Return the rectangle corresponding to the page in the associated wxDC 's logical coordinates for the current user scale and device origin.

On MSW and Mac, this will be the printable area of the paper. On other platforms and PostScript printing, this will be the full paper rectangle.

getLogicalPaperRect(This)

-spec getLogicalPaperRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                             when This :: wxPrintout().

Return the rectangle corresponding to the paper in the associated wxDC 's logical coordinates for the current user scale and device origin.

getPageSizeMM(This)

-spec getPageSizeMM(This) -> {W :: integer(), H :: integer()} when This :: wxPrintout().

Returns the size of the printer page in millimetres.

getPageSizePixels(This)

-spec getPageSizePixels(This) -> {W :: integer(), H :: integer()} when This :: wxPrintout().

Returns the size of the printer page in pixels, called the page rectangle.

The page rectangle has a top left corner at (0,0) and a bottom right corner at (w,h). These values may not be the same as the values returned from wxDC:getSize/1;if the printout is being used for previewing, a memory device context is used, which uses a bitmap size reflecting the current preview zoom. The application must take this discrepancy into account if previewing is to be supported.

getPaperRectPixels(This)

-spec getPaperRectPixels(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                            when This :: wxPrintout().

Returns the rectangle that corresponds to the entire paper in pixels, called the paper rectangle.

This distinction between paper rectangle and page rectangle reflects the fact that most printers cannot print all the way to the edge of the paper. The page rectangle is a rectangle whose top left corner is at (0,0) and whose width and height are given by wxDC::GetPageSizePixels().

On MSW and Mac, the page rectangle gives the printable area of the paper, while the paper rectangle represents the entire paper, including non-printable borders. Thus, the rectangle returned by wxDC::GetPaperRectPixels() will have a top left corner whose coordinates are small negative numbers and the bottom right corner will have values somewhat larger than the width and height given by wxDC::GetPageSizePixels().

On other platforms and for PostScript printing, the paper is treated as if its entire area were printable, so this function will return the same rectangle as the page rectangle.

getPPIPrinter(This)

-spec getPPIPrinter(This) -> {W :: integer(), H :: integer()} when This :: wxPrintout().

Returns the number of pixels per logical inch of the printer device context.

Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer.

Remember to multiply this by a scaling factor to take the preview DC size into account. Or you can just use the FitThisSizeToXXX() and MapScreenSizeToXXX routines below, which do most of the scaling calculations for you.

getPPIScreen(This)

-spec getPPIScreen(This) -> {W :: integer(), H :: integer()} when This :: wxPrintout().

Returns the number of pixels per logical inch of the screen device context.

Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer.

If you are doing your own scaling, remember to multiply this by a scaling factor to take the preview DC size into account.

getTitle(This)

-spec getTitle(This) -> unicode:charlist() when This :: wxPrintout().

Returns the title of the printout.

isPreview(This)

-spec isPreview(This) -> boolean() when This :: wxPrintout().

Returns true if the printout is currently being used for previewing.

mapScreenSizeToDevice(This)

-spec mapScreenSizeToDevice(This) -> ok when This :: wxPrintout().

Set the user scale and device origin of the wxDC associated with this wxPrintout so that one screen pixel maps to one device pixel on the DC.

That is, the user scale is set to (1,1) and the device origin is set to (0,0).

Use this if you want to do your own scaling prior to calling wxDC drawing calls, for example, if your underlying model is floating-point and you want to achieve maximum drawing precision on high-resolution printers.

You can use the GetLogicalXXXRect() routines below to obtain the paper rectangle, page rectangle, or page margins rectangle to perform your own scaling.

Note: While the underlying drawing model of macOS is floating-point, wxWidgets's drawing model scales from integer coordinates.

mapScreenSizeToPage(This)

-spec mapScreenSizeToPage(This) -> ok when This :: wxPrintout().

This sets the user scale of the wxDC associated with this wxPrintout to the same scale as mapScreenSizeToPaper/1 but sets the logical origin to the top left corner of the page rectangle.

mapScreenSizeToPageMargins(This, PageSetupData)

-spec mapScreenSizeToPageMargins(This, PageSetupData) -> ok
                                    when
                                        This :: wxPrintout(),
                                        PageSetupData :: wxPageSetupDialogData:wxPageSetupDialogData().

This sets the user scale of the wxDC associated with this wxPrintout to the same scale as mapScreenSizeToPageMargins/2 but sets the logical origin to the top left corner of the page margins specified by the given wxPageSetupDialogData object.

mapScreenSizeToPaper(This)

-spec mapScreenSizeToPaper(This) -> ok when This :: wxPrintout().

Set the user scale and device origin of the wxDC associated with this wxPrintout so that the printed page matches the screen size as closely as possible and the logical origin is in the top left corner of the paper rectangle.

That is, a 100-pixel object on screen should appear at the same size on the printed page. (It will, of course, be larger or smaller in the preview image, depending on the zoom factor.)

Use this if you want WYSIWYG behaviour, e.g., in a text editor.

new(Title, OnPrintPage)

-spec new(Title :: string(), OnPrintPage :: function()) -> wxPrintout:wxPrintout().

Equivalent to new/3.

new(Title, OnPrintPage, Opts)

-spec new(Title :: string(), OnPrintPage, [Option]) -> wxPrintout:wxPrintout()
             when
                 OnPrintPage :: fun((wxPrintout(), Page :: integer()) -> boolean()),
                 Option ::
                     {onPreparePrinting, fun((wxPrintout()) -> ok)} |
                     {onBeginPrinting, fun((wxPrintout()) -> ok)} |
                     {onEndPrinting, fun((wxPrintout()) -> ok)} |
                     {onBeginDocument,
                      fun((wxPrintout(), StartPage :: integer(), EndPage :: integer()) -> boolean())} |
                     {onEndDocument, fun((wxPrintout()) -> ok)} |
                     {hasPage, fun((wxPrintout(), Page :: integer()) -> ok)} |
                     {getPageInfo,
                      fun((wxPrintout()) ->
                              {MinPage :: integer(),
                               MaxPage :: integer(),
                               PageFrom :: integer(),
                               PageTo :: integer()})}.

Constructor.

Creates a wxPrintout object with a callback fun and optionally other callback funs. The This argument is the wxPrintout object reference to this object

Notice: The callbacks may not call other processes.

offsetLogicalOrigin(This, Xoff, Yoff)

-spec offsetLogicalOrigin(This, Xoff, Yoff) -> ok
                             when This :: wxPrintout(), Xoff :: integer(), Yoff :: integer().

Shift the device origin by an amount specified in logical coordinates.

setLogicalOrigin(This, X, Y)

-spec setLogicalOrigin(This, X, Y) -> ok when This :: wxPrintout(), X :: integer(), Y :: integer().

Set the device origin of the associated wxDC so that the current logical point becomes the new logical origin.

wxProgressDialog

If supported by the platform this class will provide the platform's native progress dialog, else it will simply be the wxGenericProgressDialog (not implemented in wx).

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxProgressDialog

Summary

Types

wxProgressDialog()

Functions

destroy(This)

Destroys the object

new(Title, Message)

Equivalent to new(Title, Message, []).

new(Title, Message, Options)

resume(This)

Can be used to continue with the dialog, after the user had clicked the "Abort" button.

update(This, Value)

Equivalent to update(This, Value, []).

update/3

Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.

Types

wxProgressDialog()

-type wxProgressDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxProgressDialog()) -> ok.

Destroys the object

new(Title, Message)

-spec new(Title, Message) -> wxProgressDialog()
             when Title :: unicode:chardata(), Message :: unicode:chardata().

Equivalent to new(Title, Message, []).

new(Title, Message, Options)

-spec new(Title, Message, [Option]) -> wxProgressDialog()
             when
                 Title :: unicode:chardata(),
                 Message :: unicode:chardata(),
                 Option :: {maximum, integer()} | {parent, wxWindow:wxWindow()} | {style, integer()}.

resume(This)

-spec resume(This) -> ok when This :: wxProgressDialog().

Can be used to continue with the dialog, after the user had clicked the "Abort" button.

update(This, Value)

-spec update(This, Value) -> boolean() when This :: wxProgressDialog(), Value :: integer().

Equivalent to update(This, Value, []).

update/3

-spec update(This, Value, [Option]) -> boolean()
                when
                    This :: wxProgressDialog(),
                    Value :: integer(),
                    Option :: {newmsg, unicode:chardata()}.

Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified.

Returns true unless the "Cancel" button has been pressed.

If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation and if the abort is not confirmed the dialog may be resumed with resume/1 function.

If value is the maximum value for the dialog, the behaviour of the function depends on whether wxPD_AUTO_HIDE was used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not return until this happens.

Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you may call wxWindow:fit/1 explicitly. However the native MSW implementation of this class does make the dialog shorter if the new text has fewer lines of text than the old one, so it is recommended to keep the number of lines of text constant in order to avoid jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog, wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces (wxString (not implemented in wx)(L'\u00a0', 100)) to it.

wxQueryNewPaletteEvent

Functions for wxQueryNewPaletteEvent class

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxQueryNewPaletteEvent

Summary

Types

wxQueryNewPalette()

wxQueryNewPaletteEvent()

wxQueryNewPaletteEventType()

Functions

getPaletteRealized(This)

setPaletteRealized(This, Realized)

Types

wxQueryNewPalette()

-type wxQueryNewPalette() ::
          #wxQueryNewPalette{type :: wxQueryNewPaletteEvent:wxQueryNewPaletteEventType()}.

wxQueryNewPaletteEvent()

-type wxQueryNewPaletteEvent() :: wx:wx_object().

wxQueryNewPaletteEventType()

-type wxQueryNewPaletteEventType() :: query_new_palette.

Functions

getPaletteRealized(This)

-spec getPaletteRealized(This) -> boolean() when This :: wxQueryNewPaletteEvent().

setPaletteRealized(This, Realized)

-spec setPaletteRealized(This, Realized) -> ok
                            when This :: wxQueryNewPaletteEvent(), Realized :: boolean().

wxRadioBox

A radio box item is used to select one of number of mutually exclusive choices.

It is displayed as a vertical column or horizontal row of labelled buttons.

Styles

This class supports the following styles:

wxRA_SPECIFY_ROWS: The major dimension parameter refers to the maximum number of rows.

wxRA_SPECIFY_COLS: The major dimension parameter refers to the maximum number of columns.

See:

Overview events

wxRadioButton

wxCheckBox

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxRadioBox

Events

Event types emitted from this class:

command_radiobox_selected

Summary

Types

wxRadioBox()

Functions

create(This, Parent, Id, Label, Pos, Size, Choices)

Equivalent to create(This, Parent, Id, Label, Pos, Size, Choices, []).

create/8

Creates the radiobox for two-step construction.

destroy(This)

Destroys the object

enable(This)

Equivalent to enable(This, []).

enable/2

Enables or disables the radiobox.

enable/3

Enables or disables an individual button in the radiobox.

getColumnCount(This)

Returns the number of columns in the radiobox.

getItemFromPoint(This, Pt)

Returns a radio box item under the point, a zero-based item index, or wxNOT\_FOUND if no item is under the point.

getItemHelpText(This, Item)

Returns the helptext associated with the specified item if any or wxEmptyString.

getItemToolTip(This, Item)

Returns the tooltip associated with the specified item if any or NULL.

getRowCount(This)

Returns the number of rows in the radiobox.

getSelection(This)

Returns the index of the selected item or wxNOT\_FOUND if no item is selected.

getString(This, N)

Returns the label of the item with the given index.

isItemEnabled(This, N)

Returns true if the item is enabled or false if it was disabled using enable/3.

isItemShown(This, N)

Returns true if the item is currently shown or false if it was hidden using show/3.

new(Parent, Id, Label, Pos, Size, Choices)

Equivalent to new(Parent, Id, Label, Pos, Size, Choices, []).

new/7

Constructor, creating and showing a radiobox.

setItemHelpText(This, Item, Helptext)

Sets the helptext for an item.

setItemToolTip(This, Item, Text)

Sets the tooltip text for the specified item in the radio group.

setSelection(This, N)

Sets the selection to the given item.

show(This, Item)

Equivalent to show(This, Item, []).

show/3

Shows or hides individual buttons.

Types

wxRadioBox()

-type wxRadioBox() :: wx:wx_object().

Functions

create(This, Parent, Id, Label, Pos, Size, Choices)

-spec create(This, Parent, Id, Label, Pos, Size, Choices) -> boolean()
                when
                    This :: wxRadioBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()].

Equivalent to create(This, Parent, Id, Label, Pos, Size, Choices, []).

create/8

-spec create(This, Parent, Id, Label, Pos, Size, Choices, [Option]) -> boolean()
                when
                    This :: wxRadioBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Pos :: {X :: integer(), Y :: integer()},
                    Size :: {W :: integer(), H :: integer()},
                    Choices :: [unicode:chardata()],
                    Option :: {majorDim, integer()} | {style, integer()} | {val, wx:wx_object()}.

Creates the radiobox for two-step construction.

See new/7 for further details.

destroy(This)

-spec destroy(This :: wxRadioBox()) -> ok.

Destroys the object

enable(This)

-spec enable(This) -> boolean() when This :: wxRadioBox().

Equivalent to enable(This, []).

enable/2

-spec enable(This, N) -> boolean() when This :: wxRadioBox(), N :: integer();
            (This, [Option]) -> boolean() when This :: wxRadioBox(), Option :: {enable, boolean()}.

Enables or disables the radiobox.

See: wxWindow:enable/2

enable/3

-spec enable(This, N, [Option]) -> boolean()
                when This :: wxRadioBox(), N :: integer(), Option :: {enable, boolean()}.

Enables or disables an individual button in the radiobox.

See: wxWindow:enable/2

getColumnCount(This)

-spec getColumnCount(This) -> integer() when This :: wxRadioBox().

Returns the number of columns in the radiobox.

getItemFromPoint(This, Pt)

-spec getItemFromPoint(This, Pt) -> integer()
                          when This :: wxRadioBox(), Pt :: {X :: integer(), Y :: integer()}.

Returns a radio box item under the point, a zero-based item index, or wxNOT\_FOUND if no item is under the point.

getItemHelpText(This, Item)

-spec getItemHelpText(This, Item) -> unicode:charlist() when This :: wxRadioBox(), Item :: integer().

Returns the helptext associated with the specified item if any or wxEmptyString.

See: setItemHelpText/3

getItemToolTip(This, Item)

-spec getItemToolTip(This, Item) -> wxToolTip:wxToolTip() when This :: wxRadioBox(), Item :: integer().

Returns the tooltip associated with the specified item if any or NULL.

See:

setItemToolTip/3

wxWindow:getToolTip/1

getRowCount(This)

-spec getRowCount(This) -> integer() when This :: wxRadioBox().

Returns the number of rows in the radiobox.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxRadioBox().

Returns the index of the selected item or wxNOT\_FOUND if no item is selected.

Return: The position of the current selection.

Remark: This method can be used with single selection list boxes only, you should use wxListBox:getSelections/1 for the list boxes with wxLB_MULTIPLE style.

See:

setSelection/2

wxControlWithItems:getStringSelection/1

getString(This, N)

-spec getString(This, N) -> unicode:charlist() when This :: wxRadioBox(), N :: integer().

Returns the label of the item with the given index.

Return: The label of the item or an empty string if the position was invalid.

isItemEnabled(This, N)

-spec isItemEnabled(This, N) -> boolean() when This :: wxRadioBox(), N :: integer().

Returns true if the item is enabled or false if it was disabled using enable/3.

This function is currently only implemented in wxMSW, wxGTK, wxQT and wxUniversal and always returns true in the other ports.

isItemShown(This, N)

-spec isItemShown(This, N) -> boolean() when This :: wxRadioBox(), N :: integer().

Returns true if the item is currently shown or false if it was hidden using show/3.

Note that this function returns true for an item which hadn't been hidden even if the entire radiobox is not currently shown.

This function is currently only implemented in wxMSW, wxGTK, wxQT and wxUniversal and always returns true in the other ports.

new(Parent, Id, Label, Pos, Size, Choices)

-spec new(Parent, Id, Label, Pos, Size, Choices) -> wxRadioBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Pos :: {X :: integer(), Y :: integer()},
                 Size :: {W :: integer(), H :: integer()},
                 Choices :: [unicode:chardata()].

Equivalent to new(Parent, Id, Label, Pos, Size, Choices, []).

new/7

-spec new(Parent, Id, Label, Pos, Size, Choices, [Option]) -> wxRadioBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Pos :: {X :: integer(), Y :: integer()},
                 Size :: {W :: integer(), H :: integer()},
                 Choices :: [unicode:chardata()],
                 Option :: {majorDim, integer()} | {style, integer()} | {val, wx:wx_object()}.

Constructor, creating and showing a radiobox.

See: create/8

setItemHelpText(This, Item, Helptext)

-spec setItemHelpText(This, Item, Helptext) -> ok
                         when This :: wxRadioBox(), Item :: integer(), Helptext :: unicode:chardata().

Sets the helptext for an item.

Empty string erases any existing helptext.

See: getItemHelpText/2

setItemToolTip(This, Item, Text)

-spec setItemToolTip(This, Item, Text) -> ok
                        when This :: wxRadioBox(), Item :: integer(), Text :: unicode:chardata().

Sets the tooltip text for the specified item in the radio group.

This function is currently only implemented in wxMSW and wxGTK2 and does nothing in the other ports.

See:

getItemToolTip/2

wxWindow:setToolTip/2

setSelection(This, N)

-spec setSelection(This, N) -> ok when This :: wxRadioBox(), N :: integer().

Sets the selection to the given item.

Notice that a radio box always has selection, so n must be valid here and passing wxNOT_FOUND is not allowed.

show(This, Item)

-spec show(This, Item) -> boolean() when This :: wxRadioBox(), Item :: integer().

Equivalent to show(This, Item, []).

show/3

-spec show(This, Item, [Option]) -> boolean()
              when This :: wxRadioBox(), Item :: integer(), Option :: {show, boolean()}.

Shows or hides individual buttons.

Return: true if the item has been shown or hidden or false if nothing was done because it already was in the requested state.

See: show/3

wxRadioButton

A radio button item is a button which usually denotes one of several mutually exclusive options.

It has a text label next to a (usually) round button.

You can create a group of mutually-exclusive radio buttons by specifying wxRB_GROUP for the first in the group. The group ends when another radio button group is created, or there are no more radio buttons.

Styles

This class supports the following styles:

wxRB_GROUP: Marks the beginning of a new group of radio buttons.

wxRB_SINGLE: In some circumstances, radio buttons that are not consecutive siblings trigger a hang bug in Windows (only). If this happens, add this style to mark the button as not belonging to a group, and implement the mutually-exclusive group behaviour yourself.

See:

Overview events

wxRadioBox

wxCheckBox

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxRadioButton

Events

Event types emitted from this class:

command_radiobutton_selected

Summary

Types

wxRadioButton()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creates the choice for two-step construction.

destroy(This)

Destroys the object

getValue(This)

Returns true if the radio button is checked, false otherwise.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a radio button.

setValue(This, Value)

Sets the radio button to checked or unchecked status.

Types

wxRadioButton()

-type wxRadioButton() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxRadioButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxRadioButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the choice for two-step construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxRadioButton()) -> ok.

Destroys the object

getValue(This)

-spec getValue(This) -> boolean() when This :: wxRadioButton().

Returns true if the radio button is checked, false otherwise.

new()

-spec new() -> wxRadioButton().

Default constructor.

See: create/5

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxRadioButton()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxRadioButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a radio button.

See: create/5

setValue(This, Value)

-spec setValue(This, Value) -> ok when This :: wxRadioButton(), Value :: boolean().

Sets the radio button to checked or unchecked status.

This does not cause a wxEVT_RADIOBUTTON event to get emitted.

If the radio button belongs to a radio group exactly one button in the group may be checked and so this method can be only called with value set to true. To uncheck a radio button in a group you must check another button in the same group.

Note: Under MSW, the focused radio button is always selected, i.e. its value is true. And, conversely, calling SetValue(true) will also set focus to the radio button if the focus had previously been on another radio button in the same group - as otherwise setting it on wouldn't work.

wxRegion

A wxRegion represents a simple or complex region on a device context or window.

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

Predefined objects (include wx.hrl):

?wxNullRegion

wxWidgets docs: wxRegion

Summary

Types

wxRegion()

Functions

clear(This)

Clears the current region.

contains/2

Returns a value indicating whether the given rectangle is contained within the region.

contains(This, X, Y)

Returns a value indicating whether the given point is contained within the region.

contains(This, X, Y, Width, Height)

Returns a value indicating whether the given rectangle is contained within the region.

convertToBitmap(This)

Convert the region to a black and white bitmap with the white pixels being inside the region.

destroy(This)

Destroys the object

getBox(This)

intersect/2

Finds the intersection of this region and another region.

intersect(This, X, Y, Width, Height)

Finds the intersection of this region and another, rectangular region, specified using position and size.

isEmpty(This)

Returns true if the region is empty, false otherwise.

new()

Default constructor.

new/1

Constructs a region using a bitmap.

new(TopLeft, BottomRight)

Constructs a rectangular region from the top left point and the bottom right point.

new(X, Y, Width, Height)

Constructs a rectangular region with the given position and size.

offset(This, Pt)

offset(This, X, Y)

Moves the region by the specified offsets in horizontal and vertical directions.

subtract/2

Subtracts a region from this region.

union/2

Finds the union of this region and another, rectangular region.

union(This, Bmp, TransColour)

Equivalent to union(This, Bmp, TransColour, []).

union/4

Finds the union of this region and the non-transparent pixels of a bitmap.

union(This, X, Y, Width, Height)

Finds the union of this region and another, rectangular region, specified using position and size.

'Xor'/2

Finds the Xor of this region and another region.

'Xor'(This, X, Y, Width, Height)

Finds the Xor of this region and another, rectangular region, specified using position and size.

Types

wxRegion()

-type wxRegion() :: wx:wx_object().

Functions

clear(This)

-spec clear(This) -> ok when This :: wxRegion().

Clears the current region.

The object becomes invalid, or null, after being cleared.

contains/2

-spec contains(This, Pt) -> wx:wx_enum() when This :: wxRegion(), Pt :: {X :: integer(), Y :: integer()};
              (This, Rect) -> wx:wx_enum()
                  when
                      This :: wxRegion(),
                      Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Returns a value indicating whether the given rectangle is contained within the region.

This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.

Return: One of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.

Note: On Windows, only ?wxOutRegion and ?wxInRegion are returned; a value ?wxInRegion then indicates that all or some part of the region is contained in this region.

contains(This, X, Y)

-spec contains(This, X, Y) -> wx:wx_enum() when This :: wxRegion(), X :: integer(), Y :: integer().

Returns a value indicating whether the given point is contained within the region.

This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.

Return: The return value is one of wxOutRegion and wxInRegion.

contains(This, X, Y, Width, Height)

-spec contains(This, X, Y, Width, Height) -> wx:wx_enum()
                  when
                      This :: wxRegion(),
                      X :: integer(),
                      Y :: integer(),
                      Width :: integer(),
                      Height :: integer().

Returns a value indicating whether the given rectangle is contained within the region.

This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.

Return: One of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.

Note: On Windows, only ?wxOutRegion and ?wxInRegion are returned; a value ?wxInRegion then indicates that all or some part of the region is contained in this region.

convertToBitmap(This)

-spec convertToBitmap(This) -> wxBitmap:wxBitmap() when This :: wxRegion().

Convert the region to a black and white bitmap with the white pixels being inside the region.

This method can't be used for invalid region.

destroy(This)

-spec destroy(This :: wxRegion()) -> ok.

Destroys the object

getBox(This)

-spec getBox(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                when This :: wxRegion().

intersect/2

-spec intersect(This, Rect) -> boolean()
                   when
                       This :: wxRegion(),
                       Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()};
               (This, Region) -> boolean() when This :: wxRegion(), Region :: wxRegion().

Finds the intersection of this region and another region.

This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.

Return: true if successful, false otherwise.

Remark: Creates the intersection of the two regions, that is, the parts which are in both regions. The result is stored in this region.

intersect(This, X, Y, Width, Height)

-spec intersect(This, X, Y, Width, Height) -> boolean()
                   when
                       This :: wxRegion(),
                       X :: integer(),
                       Y :: integer(),
                       Width :: integer(),
                       Height :: integer().

Finds the intersection of this region and another, rectangular region, specified using position and size.

This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.

Return: true if successful, false otherwise.

Remark: Creates the intersection of the two regions, that is, the parts which are in both regions. The result is stored in this region.

isEmpty(This)

-spec isEmpty(This) -> boolean() when This :: wxRegion().

Returns true if the region is empty, false otherwise.

Always returns true if the region is invalid.

new()

-spec new() -> wxRegion().

Default constructor.

This constructor creates an invalid, or null, object, i.e. calling IsOk() on it returns false and isEmpty/1 returns true.

new/1

-spec new(Rect) -> wxRegion()
             when Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()};
         (Bmp) -> wxRegion() when Bmp :: wxBitmap:wxBitmap().

Constructs a region using a bitmap.

See union/5 for more details.

new(TopLeft, BottomRight)

-spec new(TopLeft, BottomRight) -> wxRegion()
             when
                 TopLeft :: {X :: integer(), Y :: integer()},
                 BottomRight :: {X :: integer(), Y :: integer()}.

Constructs a rectangular region from the top left point and the bottom right point.

new(X, Y, Width, Height)

-spec new(X, Y, Width, Height) -> wxRegion()
             when X :: integer(), Y :: integer(), Width :: integer(), Height :: integer().

Constructs a rectangular region with the given position and size.

offset(This, Pt)

-spec offset(This, Pt) -> boolean() when This :: wxRegion(), Pt :: {X :: integer(), Y :: integer()}.

offset(This, X, Y)

-spec offset(This, X, Y) -> boolean() when This :: wxRegion(), X :: integer(), Y :: integer().

Moves the region by the specified offsets in horizontal and vertical directions.

This method can't be called if the region is invalid as it doesn't make sense to offset it then. Attempts to do it will result in assert failure.

Return: true if successful, false otherwise (the region is unchanged then).

subtract/2

-spec subtract(This, Rect) -> boolean()
                  when
                      This :: wxRegion(),
                      Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()};
              (This, Region) -> boolean() when This :: wxRegion(), Region :: wxRegion().

Subtracts a region from this region.

This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.

Return: true if successful, false otherwise.

Remark: This operation combines the parts of 'this' region that are not part of the second region. The result is stored in this region.

union/2

-spec union(This, Region) -> boolean()
               when This :: wxRegion(), Region :: wxRegion:wxRegion() | wxBitmap:wxBitmap();
           (This, Rect) -> boolean()
               when
                   This :: wxRegion(),
                   Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Finds the union of this region and another, rectangular region.

This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.

Return: true if successful, false otherwise.

Remark: This operation creates a region that combines all of this region and the second region. The result is stored in this region.

union(This, Bmp, TransColour)

-spec union(This, Bmp, TransColour) -> boolean()
               when This :: wxRegion(), Bmp :: wxBitmap:wxBitmap(), TransColour :: wx:wx_colour().

Equivalent to union(This, Bmp, TransColour, []).

union/4

-spec union(This, Bmp, TransColour, [Option]) -> boolean()
               when
                   This :: wxRegion(),
                   Bmp :: wxBitmap:wxBitmap(),
                   TransColour :: wx:wx_colour(),
                   Option :: {tolerance, integer()}.

Finds the union of this region and the non-transparent pixels of a bitmap.

Colour to be treated as transparent is specified in the transColour argument, along with an optional colour tolerance value.

Return: true if successful, false otherwise.

Remark: This operation creates a region that combines all of this region and the second region. The result is stored in this region.

union(This, X, Y, Width, Height)

-spec union(This, X, Y, Width, Height) -> boolean()
               when
                   This :: wxRegion(),
                   X :: integer(),
                   Y :: integer(),
                   Width :: integer(),
                   Height :: integer().

Finds the union of this region and another, rectangular region, specified using position and size.

This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.

Return: true if successful, false otherwise.

Remark: This operation creates a region that combines all of this region and the second region. The result is stored in this region.

'Xor'/2

-spec 'Xor'(This, Rect) -> boolean()
               when
                   This :: wxRegion(),
                   Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()};
           (This, Region) -> boolean() when This :: wxRegion(), Region :: wxRegion().

Finds the Xor of this region and another region.

This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given region.

Return: true if successful, false otherwise.

Remark: This operation creates a region that combines all of this region and the second region, except for any overlapping areas. The result is stored in this region.

'Xor'(This, X, Y, Width, Height)

-spec 'Xor'(This, X, Y, Width, Height) -> boolean()
               when
                   This :: wxRegion(),
                   X :: integer(),
                   Y :: integer(),
                   Width :: integer(),
                   Height :: integer().

Finds the Xor of this region and another, rectangular region, specified using position and size.

This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.

Return: true if successful, false otherwise.

Remark: This operation creates a region that combines all of this region and the second region, except for any overlapping areas. The result is stored in this region.

wxSashEvent

A sash event is sent when the sash of a wxSashWindow has been dragged by the user.

Remark: When a sash belonging to a sash window is dragged by the user, and then released, this event is sent to the window, where it may be processed by an event table entry in a derived class, a plug-in event handler or an ancestor class. Note that the wxSashWindow doesn't change the window's size itself. It relies on the application's event handler to do that. This is because the application may have to handle other consequences of the resize, or it may wish to veto it altogether. The event handler should look at the drag rectangle: see getDragRect/1 to see what the new size of the window would be if the resize were to be applied. It should also call getDragStatus/1 to see whether the drag was OK or out of the current allowed range.

See:

wxSashWindow

Overview events

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxSashEvent

Events

Use wxEvtHandler:connect/3 with wxSashEventType to subscribe to events of this type.

Summary

Types

wxSash()

wxSashEvent()

wxSashEventType()

Functions

getDragRect(This)

Returns the rectangle representing the new size the window would be if the resize was applied.

getDragStatus(This)

Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.

getEdge(This)

Returns the dragged edge.

Types

wxSash()

-type wxSash() ::
          #wxSash{type :: wxSashEvent:wxSashEventType(),
                  edge :: wx:wx_enum(),
                  dragRect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                  dragStatus :: wx:wx_enum()}.

wxSashEvent()

-type wxSashEvent() :: wx:wx_object().

wxSashEventType()

-type wxSashEventType() :: sash_dragged.

Functions

getDragRect(This)

-spec getDragRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                     when This :: wxSashEvent().

Returns the rectangle representing the new size the window would be if the resize was applied.

It is up to the application to set the window size if required.

getDragStatus(This)

-spec getDragStatus(This) -> wx:wx_enum() when This :: wxSashEvent().

Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.

If the drag caused the notional bounding box of the window to flip over, for example, the drag will be out of rage.

getEdge(This)

-spec getEdge(This) -> wx:wx_enum() when This :: wxSashEvent().

Returns the dragged edge.

The return value is one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.

wxSashLayoutWindow

wxSashLayoutWindow responds to OnCalculateLayout events generated by wxLayoutAlgorithm.

It allows the application to use simple accessors to specify how the window should be laid out, rather than having to respond to events.

The fact that the class derives from wxSashWindow allows sashes to be used if required, to allow the windows to be user-resizable.

The documentation for wxLayoutAlgorithm explains the purpose of this class in more detail.

For the window styles see wxSashWindow.

This class handles the EVT_QUERY_LAYOUT_INFO and EVT_CALCULATE_LAYOUT events for you. However, if you use sashes, see wxSashWindow for relevant event information. See also wxLayoutAlgorithm for information about the layout events.

See:

wxLayoutAlgorithm

wxSashWindow

Overview events

This class is derived, and can use functions, from:

wxSashWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxSashLayoutWindow

Summary

Types

wxSashLayoutWindow()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window.

destroy(This)

Destroys the object

getAlignment(This)

Returns the alignment of the window: one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.

getOrientation(This)

Returns the orientation of the window: one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window.

setAlignment(This, Alignment)

Sets the alignment of the window (which edge of the available parent client area the window is attached to).

setDefaultSize(This, Size)

Sets the default dimensions of the window.

setOrientation(This, Orientation)

Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area).

Types

wxSashLayoutWindow()

-type wxSashLayoutWindow() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxSashLayoutWindow(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxSashLayoutWindow(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window.

destroy(This)

-spec destroy(This :: wxSashLayoutWindow()) -> ok.

Destroys the object

getAlignment(This)

-spec getAlignment(This) -> wx:wx_enum() when This :: wxSashLayoutWindow().

Returns the alignment of the window: one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.

getOrientation(This)

-spec getOrientation(This) -> wx:wx_enum() when This :: wxSashLayoutWindow().

Returns the orientation of the window: one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.

new()

-spec new() -> wxSashLayoutWindow().

Default ctor.

new(Parent)

-spec new(Parent) -> wxSashLayoutWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxSashLayoutWindow()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window.

setAlignment(This, Alignment)

-spec setAlignment(This, Alignment) -> ok when This :: wxSashLayoutWindow(), Alignment :: wx:wx_enum().

Sets the alignment of the window (which edge of the available parent client area the window is attached to).

alignment is one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM.

setDefaultSize(This, Size)

-spec setDefaultSize(This, Size) -> ok
                        when This :: wxSashLayoutWindow(), Size :: {W :: integer(), H :: integer()}.

Sets the default dimensions of the window.

The dimension other than the orientation will be fixed to this value, and the orientation dimension will be ignored and the window stretched to fit the available space.

setOrientation(This, Orientation)

-spec setOrientation(This, Orientation) -> ok
                        when This :: wxSashLayoutWindow(), Orientation :: wx:wx_enum().

Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area).

orientation is one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL.

wxSashWindow

wxSashWindow allows any of its edges to have a sash which can be dragged to resize the window.

The actual content window will be created by the application as a child of wxSashWindow.

The window (or an ancestor) will be notified of a drag via a wxSashEvent notification.

Styles

This class supports the following styles:

wxSW_3D: Draws a 3D effect sash and border.

wxSW_3DSASH: Draws a 3D effect sash.

wxSW_3DBORDER: Draws a 3D effect border.

wxSW_BORDER: Draws a thin black border.

See:

wxSashEvent

wxSashLayoutWindow

Overview events

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxSashWindow

Events

Event types emitted from this class:

sash_dragged

Summary

Types

wxSashWindow()

Functions

destroy(This)

Destroys the object

getMaximumSizeX(This)

Gets the maximum window size in the x direction.

getMaximumSizeY(This)

Gets the maximum window size in the y direction.

getMinimumSizeX(This)

Gets the minimum window size in the x direction.

getMinimumSizeY(This)

Gets the minimum window size in the y direction.

getSashVisible(This, Edge)

Returns true if a sash is visible on the given edge, false otherwise.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructs a sash window, which can be a child of a frame, dialog or any other non-control window.

setMaximumSizeX(This, Min)

Sets the maximum window size in the x direction.

setMaximumSizeY(This, Min)

Sets the maximum window size in the y direction.

setMinimumSizeX(This, Min)

Sets the minimum window size in the x direction.

setMinimumSizeY(This, Min)

Sets the minimum window size in the y direction.

setSashVisible(This, Edge, Visible)

Call this function to make a sash visible or invisible on a particular edge.

Types

wxSashWindow()

-type wxSashWindow() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxSashWindow()) -> ok.

Destroys the object

getMaximumSizeX(This)

-spec getMaximumSizeX(This) -> integer() when This :: wxSashWindow().

Gets the maximum window size in the x direction.

getMaximumSizeY(This)

-spec getMaximumSizeY(This) -> integer() when This :: wxSashWindow().

Gets the maximum window size in the y direction.

getMinimumSizeX(This)

-spec getMinimumSizeX(This) -> integer() when This :: wxSashWindow().

Gets the minimum window size in the x direction.

getMinimumSizeY(This)

-spec getMinimumSizeY(This) -> integer() when This :: wxSashWindow().

Gets the minimum window size in the y direction.

getSashVisible(This, Edge)

-spec getSashVisible(This, Edge) -> boolean() when This :: wxSashWindow(), Edge :: wx:wx_enum().

Returns true if a sash is visible on the given edge, false otherwise.

See: setSashVisible/3

new()

-spec new() -> wxSashWindow().

Default ctor.

new(Parent)

-spec new(Parent) -> wxSashWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxSashWindow()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructs a sash window, which can be a child of a frame, dialog or any other non-control window.

setMaximumSizeX(This, Min)

-spec setMaximumSizeX(This, Min) -> ok when This :: wxSashWindow(), Min :: integer().

Sets the maximum window size in the x direction.

setMaximumSizeY(This, Min)

-spec setMaximumSizeY(This, Min) -> ok when This :: wxSashWindow(), Min :: integer().

Sets the maximum window size in the y direction.

setMinimumSizeX(This, Min)

-spec setMinimumSizeX(This, Min) -> ok when This :: wxSashWindow(), Min :: integer().

Sets the minimum window size in the x direction.

setMinimumSizeY(This, Min)

-spec setMinimumSizeY(This, Min) -> ok when This :: wxSashWindow(), Min :: integer().

Sets the minimum window size in the y direction.

setSashVisible(This, Edge, Visible)

-spec setSashVisible(This, Edge, Visible) -> ok
                        when This :: wxSashWindow(), Edge :: wx:wx_enum(), Visible :: boolean().

Call this function to make a sash visible or invisible on a particular edge.

See: getSashVisible/2

wxScreenDC

A wxScreenDC can be used to paint on the screen.

This should normally be constructed as a temporary stack object; don't store a wxScreenDC object.

When using multiple monitors, wxScreenDC corresponds to the entire virtual screen composed of all of them. Notice that coordinates on wxScreenDC can be negative in this case, see wxDisplay:getGeometry/1 for more.

See:

wxDC

wxMemoryDC

wxPaintDC

wxClientDC

wxWindowDC

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxScreenDC

Summary

Types

wxScreenDC()

Functions

destroy(This)

Destroys the object

new()

Constructor.

Types

wxScreenDC()

-type wxScreenDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxScreenDC()) -> ok.

Destroys the object

new()

-spec new() -> wxScreenDC().

Constructor.

wxScrollBar

A wxScrollBar is a control that represents a horizontal or vertical scrollbar.

It is distinct from the two scrollbars that some windows provide automatically, but the two types of scrollbar share the way events are received.

Remark: A scrollbar has the following main attributes: range, thumb size, page size, and position. The range is the total number of units associated with the view represented by the scrollbar. For a table with 15 columns, the range would be 15. The thumb size is the number of units that are currently visible. For the table example, the window might be sized so that only 5 columns are currently visible, in which case the application would set the thumb size to 5. When the thumb size becomes the same as or greater than the range, the scrollbar will be automatically hidden on most platforms. The page size is the number of units that the scrollbar should scroll by, when 'paging' through the data. This value is normally the same as the thumb size length, because it is natural to assume that the visible window size defines a page. The scrollbar position is the current thumb position. Most applications will find it convenient to provide a function called AdjustScrollbars() which can be called initially, from an OnSize event handler, and whenever the application data changes in size. It will adjust the view, object and page size according to the size of the window and the size of the data.

Styles

This class supports the following styles:

wxSB_HORIZONTAL: Specifies a horizontal scrollbar.

wxSB_VERTICAL: Specifies a vertical scrollbar.

The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED

The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event).

The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen).

In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/moving has finished independently of the way it had started. Please see the page_samples_widgets ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action.

See:

Overview scrolling

Overview events

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxScrollBar

Events

Event types emitted from this class:

scroll_top

scroll_bottom

scroll_lineup

scroll_linedown

scroll_pageup

scroll_pagedown

scroll_thumbtrack

scroll_thumbrelease

scroll_changed

scroll_top

scroll_bottom

scroll_lineup

scroll_linedown

scroll_pageup

scroll_pagedown

scroll_thumbtrack

scroll_thumbrelease

scroll_changed

Summary

Types

wxScrollBar()

Functions

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Scrollbar creation function called by the scrollbar constructor.

destroy(This)

Destroys the object

getPageSize(This)

Returns the page size of the scrollbar.

getRange(This)

Returns the length of the scrollbar.

getThumbPosition(This)

Returns the current position of the scrollbar thumb.

getThumbSize(This)

Returns the thumb or 'view' size.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a scrollbar.

setScrollbar(This, Position, ThumbSize, Range, PageSize)

Equivalent to setScrollbar(This, Position, ThumbSize, Range, PageSize, []).

setScrollbar/6

Sets the scrollbar properties.

setThumbPosition(This, ViewStart)

Sets the position of the scrollbar.

Types

wxScrollBar()

-type wxScrollBar() :: wx:wx_object().

Functions

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxScrollBar(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxScrollBar(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Scrollbar creation function called by the scrollbar constructor.

See new/3 for details.

destroy(This)

-spec destroy(This :: wxScrollBar()) -> ok.

Destroys the object

getPageSize(This)

-spec getPageSize(This) -> integer() when This :: wxScrollBar().

Returns the page size of the scrollbar.

This is the number of scroll units that will be scrolled when the user pages up or down. Often it is the same as the thumb size.

See: setScrollbar/6

getRange(This)

-spec getRange(This) -> integer() when This :: wxScrollBar().

Returns the length of the scrollbar.

See: setScrollbar/6

getThumbPosition(This)

-spec getThumbPosition(This) -> integer() when This :: wxScrollBar().

Returns the current position of the scrollbar thumb.

See: setThumbPosition/2

getThumbSize(This)

-spec getThumbSize(This) -> integer() when This :: wxScrollBar().

Returns the thumb or 'view' size.

See: setScrollbar/6

new()

-spec new() -> wxScrollBar().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxScrollBar() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxScrollBar()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a scrollbar.

See: create/4

setScrollbar(This, Position, ThumbSize, Range, PageSize)

-spec setScrollbar(This, Position, ThumbSize, Range, PageSize) -> ok
                      when
                          This :: wxScrollBar(),
                          Position :: integer(),
                          ThumbSize :: integer(),
                          Range :: integer(),
                          PageSize :: integer().

Equivalent to setScrollbar(This, Position, ThumbSize, Range, PageSize, []).

setScrollbar/6

-spec setScrollbar(This, Position, ThumbSize, Range, PageSize, [Option]) -> ok
                      when
                          This :: wxScrollBar(),
                          Position :: integer(),
                          ThumbSize :: integer(),
                          Range :: integer(),
                          PageSize :: integer(),
                          Option :: {refresh, boolean()}.

Sets the scrollbar properties.

Remark: Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use: The page size is 1 less than the thumb size so that the last line of the previous page will be visible on the next page, to help orient the user. Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines are currently visible by dividing the current view size by the character height in pixels. When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and setScrollbar/6 call into a function named AdjustScrollbars, which can be called initially and also from a wxSizeEvent event handler function.

setThumbPosition(This, ViewStart)

-spec setThumbPosition(This, ViewStart) -> ok when This :: wxScrollBar(), ViewStart :: integer().

Sets the position of the scrollbar.

See: getThumbPosition/1

wxScrollEvent

A scroll event holds information about events sent from stand-alone scrollbars (see wxScrollBar) and sliders (see wxSlider).

Note that scrolled windows send the wxScrollWinEvent which does not derive from wxCommandEvent, but from wxEvent directly - don't confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls.

The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED

The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event).

The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen).

In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/ moving has finished independently of the way it had started. Please see the page_samples_widgets ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action.

Remark: Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with getOrientation/1, since horizontal and vertical scroll events are processed using the same event handler.

See:

wxScrollBar

wxSlider

wxSpinButton

wxScrollWinEvent

Overview events

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxScrollEvent

Events

Use wxEvtHandler:connect/3 with wxScrollEventType to subscribe to events of this type.

Summary

Types

wxScroll()

wxScrollEvent()

wxScrollEventType()

Functions

getOrientation(This)

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

getPosition(This)

Returns the position of the scrollbar.

Types

wxScroll()

-type wxScroll() ::
          #wxScroll{type :: wxScrollEvent:wxScrollEventType(),
                    commandInt :: integer(),
                    extraLong :: integer()}.

wxScrollEvent()

-type wxScrollEvent() :: wx:wx_object().

wxScrollEventType()

-type wxScrollEventType() ::
          scroll_top | scroll_bottom | scroll_lineup | scroll_linedown | scroll_pageup |
          scroll_pagedown | scroll_thumbtrack | scroll_thumbrelease | scroll_changed.

Functions

getOrientation(This)

-spec getOrientation(This) -> integer() when This :: wxScrollEvent().

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

getPosition(This)

-spec getPosition(This) -> integer() when This :: wxScrollEvent().

Returns the position of the scrollbar.

wxScrollWinEvent

A scroll event holds information about events sent from scrolling windows.

Note that you can use the EVT_SCROLLWIN* macros for intercepting scroll window events from the receiving window.

See:

wxScrollEvent

Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxScrollWinEvent

Events

Use wxEvtHandler:connect/3 with wxScrollWinEventType to subscribe to events of this type.

Summary

Types

wxScrollWin()

wxScrollWinEvent()

wxScrollWinEventType()

Functions

getOrientation(This)

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

getPosition(This)

Returns the position of the scrollbar for the thumb track and release events.

Types

wxScrollWin()

-type wxScrollWin() ::
          #wxScrollWin{type :: wxScrollWinEvent:wxScrollWinEventType(),
                       commandInt :: integer(),
                       extraLong :: integer()}.

wxScrollWinEvent()

-type wxScrollWinEvent() :: wx:wx_object().

wxScrollWinEventType()

-type wxScrollWinEventType() ::
          scrollwin_top | scrollwin_bottom | scrollwin_lineup | scrollwin_linedown | scrollwin_pageup |
          scrollwin_pagedown | scrollwin_thumbtrack | scrollwin_thumbrelease.

Functions

getOrientation(This)

-spec getOrientation(This) -> integer() when This :: wxScrollWinEvent().

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

getPosition(This)

-spec getPosition(This) -> integer() when This :: wxScrollWinEvent().

Returns the position of the scrollbar for the thumb track and release events.

Note that this field can't be used for the other events, you need to query the window itself for the current position in that case.

wxScrolledWindow

The wxScrolled (not implemented in wx) class manages scrolling for its client area, transforming the coordinates according to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.

There are two commonly used (but not the only possible!) specializations of this class:

?wxScrolledWindow, aka wxScrolled<wxPanel>, is equivalent to ?wxScrolledWindow from earlier versions. Derived from wxPanel, it shares wxPanel's behaviour with regard to TAB traversal and focus handling. Use this if the scrolled window will have child controls.

?wxScrolledCanvas, aka wxScrolled<wxWindow>, derives from wxWindow and so doesn't handle children specially. This is suitable e.g. for implementing scrollable controls such as tree or list controls.

Note: See wxScrolled::Create() (not implemented in wx) if you want to use wxScrolled (not implemented in wx) with a custom class.

Starting from version 2.4 of wxWidgets, there are several ways to use a ?wxScrolledWindow (and now wxScrolled (not implemented in wx)). In particular, there are three ways to set the size of the scrolling area:

One way is to set the scrollbars directly using a call to setScrollbars/6. This is the way it used to be in any previous version of wxWidgets and it will be kept for backwards compatibility.

An additional method of manual control, which requires a little less computation of your own, is to set the total size of the scrolling area by calling either wxWindow:setVirtualSize/3, or wxWindow:fitInside/1, and setting the scrolling increments for it by calling setScrollRate/3. Scrolling in some orientation is enabled by setting a non-zero increment for it.

The most automatic and newest way is to simply let sizers determine the scrolling area. This is now the default when you set an interior sizer into a wxScrolled (not implemented in wx) with wxWindow:setSizer/3. The scrolling area will be set to the size requested by the sizer and the scrollbars will be assigned for each orientation according to the need for them and the scrolling increment set by setScrollRate/3. As above, scrolling is only enabled in orientations with a non-zero increment. You can influence the minimum size of the scrolled area controlled by a sizer by calling wxWindow::SetVirtualSizeHints(). (Calling setScrollbars/6 has analogous effects in wxWidgets 2.4 - in later versions it may not continue to override the sizer.)

Note that if maximum size hints are still supported by wxWindow::SetVirtualSizeHints(), use them at your own dire risk. They may or may not have been removed for 2.4, but it really only makes sense to set minimum size hints here. We should probably replace wxWindow::SetVirtualSizeHints() with wxWindow::SetMinVirtualSize() or similar and remove it entirely in future.

As with all windows, an application can draw onto a wxScrolled (not implemented in wx) using a device context.

You have the option of handling the OnPaint handler or overriding the wxScrolled::OnDraw() (not implemented in wx) function, which is passed a pre-scrolled device context (prepared by doPrepareDC/2).

If you don't wish to calculate your own scrolling, you must call doPrepareDC/2 when not drawing from within OnDraw() (not implemented in wx), to set the device origin for the device context according to the current scroll position.

A wxScrolled (not implemented in wx) will normally scroll itself and therefore its child windows as well. It might however be desired to scroll a different window than itself: e.g. when designing a spreadsheet, you will normally only have to scroll the (usually white) cell area, whereas the (usually grey) label area will scroll very differently. For this special purpose, you can call setTargetWindow/2 which means that pressing the scrollbars will scroll a different window.

Note that the underlying system knows nothing about scrolling coordinates, so that all system functions (mouse events, expose events, refresh calls etc) as well as the position of subwindows are relative to the "physical" origin of the scrolled window. If the user insert a child window at position (10,10) and scrolls the window down 100 pixels (moving the child window out of the visible area), the child window will report a position of (10,-90).

Styles

This class supports the following styles:

wxHSCROLL: If this style is specified and ?wxVSCROLL isn't, the window will be scrollable only in horizontal direction (by default, i.e. if neither this style nor ?wxVSCROLL is specified, it scrolls in both directions).

wxVSCROLL: If this style is specified and ?wxHSCROLL isn't, the window will be scrollable only in vertical direction (by default, i.e. if neither this style nor ?wxHSCROLL is specified, it scrolls in both directions).

wxALWAYS_SHOW_SB: Since wxWidgets 2.9.5, specifying this style makes the window always show its scrollbars, even if they are not used. See ShowScrollbars() (not implemented in wx).

wxRETAINED: Uses a backing pixmap to speed refreshes. Motif only.

See:

wxScrollBar

wxClientDC

wxPaintDC

This class is derived, and can use functions, from:

wxPanel

wxWindow

wxEvtHandler

wxWidgets docs: wxScrolledWindow

Events

Event types emitted from this class:

scrollwin_top

scrollwin_bottom

scrollwin_lineup

scrollwin_linedown

scrollwin_pageup

scrollwin_pagedown

scrollwin_thumbtrack

scrollwin_thumbrelease

Summary

Types

wxScrolledWindow()

Functions

calcScrolledPosition(This, Pt)

calcScrolledPosition(This, X, Y)

Translates the logical coordinates to the device ones.

calcUnscrolledPosition(This, Pt)

calcUnscrolledPosition(This, X, Y)

Translates the device coordinates to the logical ones.

destroy(This)

Destroys the object

doPrepareDC(This, Dc)

Call this function to prepare the device context for drawing a scrolled image.

enableScrolling(This, XScrolling, YScrolling)

Enable or disable use of wxWindow:scrollWindow/4 for scrolling.

getScrollPixelsPerUnit(This)

Get the number of pixels per scroll unit (line), in each direction, as set by setScrollbars/6.

getViewStart(This)

This is a simple overload of GetViewStart(int,int); see that function for more info.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor.

prepareDC(This, Dc)

This function is for backwards compatibility only and simply calls doPrepareDC/2 now.

scroll(This, Pt)

This is an overload of scroll/3;see that function for more info.

scroll(This, X, Y)

Scrolls a window so the view start is at the given point.

setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY)

Equivalent to setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY, []).

setScrollbars/6

Sets up vertical and/or horizontal scrollbars.

setScrollRate(This, Xstep, Ystep)

Set the horizontal and vertical scrolling increment only.

setTargetWindow(This, Window)

Call this function to tell wxScrolled (not implemented in wx) to perform the actual scrolling on a different window (and not on itself).

Types

wxScrolledWindow()

-type wxScrolledWindow() :: wx:wx_object().

Functions

calcScrolledPosition(This, Pt)

-spec calcScrolledPosition(This, Pt) -> {X :: integer(), Y :: integer()}
                              when This :: wxScrolledWindow(), Pt :: {X :: integer(), Y :: integer()}.

calcScrolledPosition(This, X, Y)

-spec calcScrolledPosition(This, X, Y) -> {Xx :: integer(), Yy :: integer()}
                              when This :: wxScrolledWindow(), X :: integer(), Y :: integer().

Translates the logical coordinates to the device ones.

For example, if a window is scrolled 10 pixels to the bottom, the device coordinates of the origin are (0, 0) (as always), but the logical coordinates are (0, 10) and so the call to CalcScrolledPosition(0, 10, xx, yy) will return 0 in yy.

See: calcUnscrolledPosition/3

calcUnscrolledPosition(This, Pt)

-spec calcUnscrolledPosition(This, Pt) -> {X :: integer(), Y :: integer()}
                                when This :: wxScrolledWindow(), Pt :: {X :: integer(), Y :: integer()}.

calcUnscrolledPosition(This, X, Y)

-spec calcUnscrolledPosition(This, X, Y) -> {Xx :: integer(), Yy :: integer()}
                                when This :: wxScrolledWindow(), X :: integer(), Y :: integer().

Translates the device coordinates to the logical ones.

For example, if a window is scrolled 10 pixels to the bottom, the device coordinates of the origin are (0, 0) (as always), but the logical coordinates are (0, 10) and so the call to CalcUnscrolledPosition(0, 0, xx, yy) will return 10 in yy.

See: calcScrolledPosition/3

destroy(This)

-spec destroy(This :: wxScrolledWindow()) -> ok.

Destroys the object

doPrepareDC(This, Dc)

-spec doPrepareDC(This, Dc) -> ok when This :: wxScrolledWindow(), Dc :: wxDC:wxDC().

Call this function to prepare the device context for drawing a scrolled image.

It sets the device origin according to the current scroll position. doPrepareDC/2 is called automatically within the default wxEVT_PAINT event handler, so your OnDraw() (not implemented in wx) override will be passed an already 'pre-scrolled' device context. However, if you wish to draw from outside of OnDraw() (not implemented in wx) (e.g. from your own wxEVT_PAINT handler), you must call this function yourself.

For example:

Notice that the function sets the origin by moving it relatively to the current origin position, so you shouldn't change the origin before calling doPrepareDC/2 or, if you do, reset it to (0, 0) later. If you call doPrepareDC/2 immediately after device context creation, as in the example above, this problem doesn't arise, of course, so it is customary to do it like this.

enableScrolling(This, XScrolling, YScrolling)

-spec enableScrolling(This, XScrolling, YScrolling) -> ok
                         when
                             This :: wxScrolledWindow(),
                             XScrolling :: boolean(),
                             YScrolling :: boolean().

Enable or disable use of wxWindow:scrollWindow/4 for scrolling.

By default, when a scrolled window is logically scrolled, wxWindow:scrollWindow/4 is called on the underlying window which scrolls the window contents and only invalidates the part of the window newly brought into view. If false is passed as an argument, then this "physical scrolling" is disabled and the window is entirely invalidated whenever it is scrolled by calling wxWindow:refresh/2.

It should be rarely necessary to disable physical scrolling, so this method shouldn't be called in normal circumstances.

getScrollPixelsPerUnit(This)

-spec getScrollPixelsPerUnit(This) -> {XUnit :: integer(), YUnit :: integer()}
                                when This :: wxScrolledWindow().

Get the number of pixels per scroll unit (line), in each direction, as set by setScrollbars/6.

A value of zero indicates no scrolling in that direction.

See:

setScrollbars/6

wxWindow:getVirtualSize/1

getViewStart(This)

-spec getViewStart(This) -> {X :: integer(), Y :: integer()} when This :: wxScrolledWindow().

This is a simple overload of GetViewStart(int,int); see that function for more info.

new()

-spec new() -> wxScrolledWindow().

Default constructor.

new(Parent)

-spec new(Parent) -> wxScrolledWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxScrolledWindow()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {winid, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor.

Remark: The window is initially created without visible scrollbars. Call setScrollbars/6 to specify how big the virtual window size should be.

prepareDC(This, Dc)

-spec prepareDC(This, Dc) -> ok when This :: wxScrolledWindow(), Dc :: wxDC:wxDC().

This function is for backwards compatibility only and simply calls doPrepareDC/2 now.

Notice that it is not called by the default paint event handle (doPrepareDC/2 is), so overriding this method in your derived class is useless.

scroll(This, Pt)

-spec scroll(This, Pt) -> ok when This :: wxScrolledWindow(), Pt :: {X :: integer(), Y :: integer()}.

This is an overload of scroll/3;see that function for more info.

scroll(This, X, Y)

-spec scroll(This, X, Y) -> ok when This :: wxScrolledWindow(), X :: integer(), Y :: integer().

Scrolls a window so the view start is at the given point.

Remark: The positions are in scroll units, not pixels, so to convert to pixels you will have to multiply by the number of pixels per scroll increment. If either parameter is ?wxDefaultCoord (-1), that position will be ignored (no change in that direction).

See:

setScrollbars/6

getScrollPixelsPerUnit/1

setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY)

-spec setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY) -> ok
                       when
                           This :: wxScrolledWindow(),
                           PixelsPerUnitX :: integer(),
                           PixelsPerUnitY :: integer(),
                           NoUnitsX :: integer(),
                           NoUnitsY :: integer().

Equivalent to setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY, []).

setScrollbars/6

-spec setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY, [Option]) -> ok
                       when
                           This :: wxScrolledWindow(),
                           PixelsPerUnitX :: integer(),
                           PixelsPerUnitY :: integer(),
                           NoUnitsX :: integer(),
                           NoUnitsY :: integer(),
                           Option :: {xPos, integer()} | {yPos, integer()} | {noRefresh, boolean()}.

Sets up vertical and/or horizontal scrollbars.

The first pair of parameters give the number of pixels per 'scroll step', i.e. amount moved when the up or down scroll arrows are pressed. The second pair gives the length of scrollbar in scroll steps, which sets the size of the virtual window.

xPos and yPos optionally specify a position to scroll to immediately.

For example, the following gives a window horizontal and vertical scrollbars with 20 pixels per scroll step, and a size of 50 steps (1000 pixels) in each direction:

wxScrolled (not implemented in wx) manages the page size itself, using the current client window size as the page size.

Note that for more sophisticated scrolling applications, for example where scroll steps may be variable according to the position in the document, it will be necessary to derive a new class from wxWindow, overriding OnSize() and adjusting the scrollbars appropriately.

See: wxWindow:setVirtualSize/3

setScrollRate(This, Xstep, Ystep)

-spec setScrollRate(This, Xstep, Ystep) -> ok
                       when This :: wxScrolledWindow(), Xstep :: integer(), Ystep :: integer().

Set the horizontal and vertical scrolling increment only.

See the pixelsPerUnit parameter in setScrollbars/6.

setTargetWindow(This, Window)

-spec setTargetWindow(This, Window) -> ok when This :: wxScrolledWindow(), Window :: wxWindow:wxWindow().

Call this function to tell wxScrolled (not implemented in wx) to perform the actual scrolling on a different window (and not on itself).

This method is useful when only a part of the window should be scrolled. A typical example is a control consisting of a fixed header and the scrollable contents window: the scrollbars are attached to the main window itself, hence it, and not the contents window must be derived from wxScrolled (not implemented in wx), but only the contents window scrolls when the scrollbars are used. To implement such setup, you need to call this method with the contents window as argument.

Notice that if this method is used, GetSizeAvailableForScrollTarget() (not implemented in wx) method must be overridden.

wxSetCursorEvent

A wxSetCursorEvent is generated from wxWindow when the mouse cursor is about to be set as a result of mouse motion.

This event gives the application the chance to perform specific mouse cursor processing based on the current position of the mouse within the window. Use setCursor/2 to specify the cursor you want to be displayed.

See:

wx_misc:setCursor/1

wxWindow:setCursor/2

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxSetCursorEvent

Events

Use wxEvtHandler:connect/3 with wxSetCursorEventType to subscribe to events of this type.

Summary

Types

wxSetCursor()

wxSetCursorEvent()

wxSetCursorEventType()

Functions

getCursor(This)

Returns a reference to the cursor specified by this event.

getX(This)

Returns the X coordinate of the mouse in client coordinates.

getY(This)

Returns the Y coordinate of the mouse in client coordinates.

hasCursor(This)

Returns true if the cursor specified by this event is a valid cursor.

setCursor(This, Cursor)

Sets the cursor associated with this event.

Types

wxSetCursor()

-type wxSetCursor() ::
          #wxSetCursor{type :: wxSetCursorEvent:wxSetCursorEventType(),
                       x :: integer(),
                       y :: integer(),
                       cursor :: wxCursor:wxCursor()}.

wxSetCursorEvent()

-type wxSetCursorEvent() :: wx:wx_object().

wxSetCursorEventType()

-type wxSetCursorEventType() :: set_cursor.

Functions

getCursor(This)

-spec getCursor(This) -> wxCursor:wxCursor() when This :: wxSetCursorEvent().

Returns a reference to the cursor specified by this event.

getX(This)

-spec getX(This) -> integer() when This :: wxSetCursorEvent().

Returns the X coordinate of the mouse in client coordinates.

getY(This)

-spec getY(This) -> integer() when This :: wxSetCursorEvent().

Returns the Y coordinate of the mouse in client coordinates.

hasCursor(This)

-spec hasCursor(This) -> boolean() when This :: wxSetCursorEvent().

Returns true if the cursor specified by this event is a valid cursor.

Remark: You cannot specify wxNullCursor with this event, as it is not considered a valid cursor.

setCursor(This, Cursor)

-spec setCursor(This, Cursor) -> ok when This :: wxSetCursorEvent(), Cursor :: wxCursor:wxCursor().

Sets the cursor associated with this event.

wxShowEvent

An event being sent when the window is shown or hidden.

The event is triggered by calls to wxWindow:show/2, and any user action showing a previously hidden window or vice versa (if allowed by the current platform and/or window manager). Notice that the event is not triggered when the application is iconized (minimized) or restored under wxMSW.

See:

Overview events

wxWindow:show/2

wxWindow:isShown/1

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxShowEvent

Events

Use wxEvtHandler:connect/3 with wxShowEventType to subscribe to events of this type.

Summary

Types

wxShow()

wxShowEvent()

wxShowEventType()

Functions

isShown(This)

Return true if the window has been shown, false if it has been hidden.

setShow(This, Show)

Set whether the windows was shown or hidden.

Types

wxShow()

-type wxShow() :: #wxShow{type :: wxShowEvent:wxShowEventType(), show :: boolean()}.

wxShowEvent()

-type wxShowEvent() :: wx:wx_object().

wxShowEventType()

-type wxShowEventType() :: show.

Functions

isShown(This)

-spec isShown(This) -> boolean() when This :: wxShowEvent().

Return true if the window has been shown, false if it has been hidden.

setShow(This, Show)

-spec setShow(This, Show) -> ok when This :: wxShowEvent(), Show :: boolean().

Set whether the windows was shown or hidden.

wxSingleChoiceDialog

This class represents a dialog that shows a list of strings, and allows the user to select one.

Double-clicking on a list item is equivalent to single-clicking and then pressing OK.

Styles

This class supports the following styles:

wxOK: Show an OK button.

wxCANCEL: Show a Cancel button.

wxCENTRE: Centre the message.

See:

Overview cmndlg

wxMultiChoiceDialog

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxSingleChoiceDialog

Summary

Types

wxSingleChoiceDialog()

Functions

destroy(This)

Destroys the object

getSelection(This)

Returns the index of selected item.

getStringSelection(This)

Returns the selected string.

new(Parent, Message, Caption, Choices)

Equivalent to new(Parent, Message, Caption, Choices, []).

new/5

Constructor, taking an array of wxString (not implemented in wx) choices and optional client data.

setSelection(This, Selection)

Sets the index of the initially selected item.

Types

wxSingleChoiceDialog()

-type wxSingleChoiceDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxSingleChoiceDialog()) -> ok.

Destroys the object

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxSingleChoiceDialog().

Returns the index of selected item.

getStringSelection(This)

-spec getStringSelection(This) -> unicode:charlist() when This :: wxSingleChoiceDialog().

Returns the selected string.

new(Parent, Message, Caption, Choices)

-spec new(Parent, Message, Caption, Choices) -> wxSingleChoiceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Caption :: unicode:chardata(),
                 Choices :: [unicode:chardata()].

Equivalent to new(Parent, Message, Caption, Choices, []).

new/5

-spec new(Parent, Message, Caption, Choices, [Option]) -> wxSingleChoiceDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Caption :: unicode:chardata(),
                 Choices :: [unicode:chardata()],
                 Option :: {style, integer()} | {pos, {X :: integer(), Y :: integer()}}.

Constructor, taking an array of wxString (not implemented in wx) choices and optional client data.

Remark: Use wxDialog:showModal/1 to show the dialog.

setSelection(This, Selection)

-spec setSelection(This, Selection) -> ok when This :: wxSingleChoiceDialog(), Selection :: integer().

Sets the index of the initially selected item.

wxSizeEvent

A size event holds information about size change events of wxWindow.

The EVT_SIZE handler function will be called when the window has been resized.

You may wish to use this for frames to resize their child windows as appropriate.

Note that the size passed is of the whole window: call wxWindow:getClientSize/1 for the area which may be used by the application.

When a window is resized, usually only a small part of the window is damaged and you may only need to repaint that area. However, if your drawing depends on the size of the window, you may need to clear the DC explicitly and repaint the whole window. In which case, you may need to call wxWindow:refresh/2 to invalidate the entire window.

Important : Sizers (see overview_sizer ) rely on size events to function correctly. Therefore, in a sizer-based layout, do not forget to call Skip on all size events you catch (and don't catch size events at all when you don't need to).

See:

{Width,Height}

Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxSizeEvent

Events

Use wxEvtHandler:connect/3 with wxSizeEventType to subscribe to events of this type.

Summary

Types

wxSize()

wxSizeEvent()

wxSizeEventType()

Functions

getRect(This)

getSize(This)

Returns the entire size of the window generating the size change event.

Types

wxSize()

-type wxSize() ::
          #wxSize{type :: wxSizeEvent:wxSizeEventType(),
                  size :: {W :: integer(), H :: integer()},
                  rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}}.

wxSizeEvent()

-type wxSizeEvent() :: wx:wx_object().

wxSizeEventType()

-type wxSizeEventType() :: size.

Functions

getRect(This)

-spec getRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                 when This :: wxSizeEvent().

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxSizeEvent().

Returns the entire size of the window generating the size change event.

This is the new total size of the window, i.e. the same size as would be returned by wxWindow:getSize/1 if it were called now. Use wxWindow:getClientSize/1 if you catch this event in a top level window such as wxFrame to find the size available for the window contents.

wxSizer

wxSizer is the abstract base class used for laying out subwindows in a window.

You cannot use wxSizer directly; instead, you will have to use one of the sizer classes derived from it. Currently there are wxBoxSizer, wxStaticBoxSizer, wxGridSizer, wxFlexGridSizer, wxWrapSizer (not implemented in wx) and wxGridBagSizer.

The layout algorithm used by sizers in wxWidgets is closely related to layout in other GUI toolkits, such as Java's AWT, the GTK toolkit or the Qt toolkit. It is based upon the idea of the individual subwindows reporting their minimal required size and their ability to get stretched if the size of the parent window has changed.

This will most often mean that the programmer does not set the original size of a dialog in the beginning, rather the dialog will be assigned a sizer and this sizer will be queried about the recommended size. The sizer in turn will query its children, which can be normal windows, empty space or other sizers, so that a hierarchy of sizers can be constructed. Note that wxSizer does not derive from wxWindow and thus does not interfere with tab ordering and requires very little resources compared to a real window on screen.

What makes sizers so well fitted for use in wxWidgets is the fact that every control reports its own minimal size and the algorithm can handle differences in font sizes or different window (dialog item) sizes on different platforms without problems. If e.g. the standard font as well as the overall design of Motif widgets requires more space than on Windows, the initial dialog size will automatically be bigger on Motif than on Windows.

Sizers may also be used to control the layout of custom drawn items on the window. The add/4, insert/5, and prepend/4 functions return a pointer to the newly added wxSizerItem. Just add empty space of the desired size and attributes, and then use the wxSizerItem:getRect/1 method to determine where the drawing operations should take place.

Please notice that sizers, like child windows, are owned by the library and will be deleted by it which implies that they must be allocated on the heap. However if you create a sizer and do not add it to another sizer or window, the library wouldn't be able to delete such an orphan sizer and in this, and only this, case it should be deleted explicitly.

wxSizer flags

The "flag" argument accepted by wxSizerItem constructors and other functions, e.g. add/4, is an OR-combination of the following flags. Two main behaviours are defined using these flags. One is the border around a window: the border parameter determines the border width whereas the flags given here determine which side(s) of the item that the border will be added. The other flags determine how the sizer item behaves when the space allotted to the sizer changes, and is somewhat dependent on the specific kind of sizer used.

See: Overview sizer

wxWidgets docs: wxSizer

Summary

Types

wxSizer()

Functions

add(This, Window)

Equivalent to add(This, Window, []).

add/3

Appends a child to the sizer.

add/4

Appends a spacer child to the sizer.

addSpacer(This, Size)

This base function adds non-stretchable space to both the horizontal and vertical orientation of the sizer.

addStretchSpacer(This)

Equivalent to addStretchSpacer(This, []).

addStretchSpacer/2

Adds stretchable space to the sizer.

calcMin(This)

This method is abstract and has to be overwritten by any derived class.

clear(This)

Equivalent to clear(This, []).

clear/2

Detaches all children from the sizer.

detach/2

Detach a item at position index from the sizer without destroying it.

fit(This, Window)

Tell the sizer to resize the window so that its client area matches the sizer's minimal size (ComputeFittingClientSize() (not implemented in wx) is called to determine it).

fitInside(This, Window)

Tell the sizer to resize the virtual size of the window to match the sizer's minimal size.

getChildren(This)

getItem/2

Finds wxSizerItem which is located in the sizer at position index.

getItem/3

Finds wxSizerItem which holds the given window.

getMinSize(This)

Returns the minimal size of the sizer.

getPosition(This)

Returns the current position of the sizer.

getSize(This)

Returns the current size of the sizer.

hide/2

Hides the item at position index.

hide/3

Hides the child window.

insert(This, Index, Item)

insert/4

Insert a child into the sizer before any existing item at index.

insert/5

Insert a child into the sizer before any existing item at index.

insertSpacer(This, Index, Size)

Inserts non-stretchable space to the sizer.

insertStretchSpacer(This, Index)

Equivalent to insertStretchSpacer(This, Index, []).

insertStretchSpacer/3

Inserts stretchable space to the sizer.

isShown/2

Returns true if the item at index is shown.

layout(This)

Call this to force layout of the children anew, e.g. after having added a child to or removed a child (window, other sizer or space) from the sizer while keeping the current dimension.

prepend(This, Item)

prepend/3

Same as add/4, but prepends the items to the beginning of the list of items (windows, subsizers or spaces) owned by this sizer.

prepend/4

Same as add/4, but prepends the items to the beginning of the list of items (windows, subsizers or spaces) owned by this sizer.

prependSpacer(This, Size)

Prepends non-stretchable space to the sizer.

prependStretchSpacer(This)

Equivalent to prependStretchSpacer(This, []).

prependStretchSpacer/2

Prepends stretchable space to the sizer.

recalcSizes(This)

Equivalent to: layout/1

remove/2

Removes a sizer child from the sizer and destroys it.

replace/3

Detaches the given item at position index from the sizer and replaces it with the given wxSizerItem newitem.

replace/4

Detaches the given oldwin from the sizer and replaces it with the given newwin.

setDimension(This, Pos, Size)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setDimension(This, X, Y, Width, Height)

Call this to force the sizer to take the given dimension and thus force the items owned by the sizer to resize themselves according to the rules defined by the parameter in the add/4 and prepend/4 methods.

setItemMinSize/3

setItemMinSize/4

setMinSize(This, Size)

Call this to give the sizer a minimal size.

setMinSize(This, Width, Height)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSizeHints(This, Window)

This method first calls fit/2 and then setSizeHints/2 on the window passed to it.

setVirtualSizeHints(This, Window)

Equivalent to: fitInside/2

show/2

show/3

Shows the item at index.

showItems(This, Show)

Show or hide all items managed by the sizer.

Types

wxSizer()

-type wxSizer() :: wx:wx_object().

Functions

add(This, Window)

-spec add(This, Window) -> wxSizerItem:wxSizerItem()
             when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer().

Equivalent to add(This, Window, []).

add/3

-spec add(This, Width, Height) -> wxSizerItem:wxSizerItem()
             when This :: wxSizer(), Width :: integer(), Height :: integer();
         (This, Window, Flags) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxSizer(),
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                 Flags :: wxSizerFlags:wxSizerFlags();
         (This, Window, [Option]) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxSizer(),
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                 Option ::
                     {proportion, integer()} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()}.

Appends a child to the sizer.

wxSizer itself is an abstract class, but the parameters are equivalent in the derived classes that you will instantiate to use it so they are described here:

add/4

-spec add(This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxSizer(),
                 Width :: integer(),
                 Height :: integer(),
                 Option ::
                     {proportion, integer()} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()};
         (This, Width, Height, Flags) -> wxSizerItem:wxSizerItem()
             when
                 This :: wxSizer(),
                 Width :: integer(),
                 Height :: integer(),
                 Flags :: wxSizerFlags:wxSizerFlags().

Appends a spacer child to the sizer.

addSpacer(This, Size)

-spec addSpacer(This, Size) -> wxSizerItem:wxSizerItem() when This :: wxSizer(), Size :: integer().

This base function adds non-stretchable space to both the horizontal and vertical orientation of the sizer.

More readable way of calling:

See: addSpacer/2

addStretchSpacer(This)

-spec addStretchSpacer(This) -> wxSizerItem:wxSizerItem() when This :: wxSizer().

Equivalent to addStretchSpacer(This, []).

addStretchSpacer/2

-spec addStretchSpacer(This, [Option]) -> wxSizerItem:wxSizerItem()
                          when This :: wxSizer(), Option :: {prop, integer()}.

Adds stretchable space to the sizer.

More readable way of calling:

calcMin(This)

-spec calcMin(This) -> {W :: integer(), H :: integer()} when This :: wxSizer().

This method is abstract and has to be overwritten by any derived class.

Here, the sizer will do the actual calculation of its children's minimal sizes.

clear(This)

-spec clear(This) -> ok when This :: wxSizer().

Equivalent to clear(This, []).

clear/2

-spec clear(This, [Option]) -> ok when This :: wxSizer(), Option :: {delete_windows, boolean()}.

Detaches all children from the sizer.

If delete_windows is true then child windows will also be deleted.

Notice that child sizers are always deleted, as a general consequence of the principle that sizers own their sizer children, but don't own their window children (because they are already owned by their parent windows).

detach/2

-spec detach(This, Window) -> boolean()
                when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
            (This, Index) -> boolean() when This :: wxSizer(), Index :: integer().

Detach a item at position index from the sizer without destroying it.

This method does not cause any layout or resizing to take place, call layout/1 to update the layout "on screen" after detaching a child from the sizer. Returns true if the child item was found and detached, false otherwise.

See: remove/2

fit(This, Window)

-spec fit(This, Window) -> {W :: integer(), H :: integer()}
             when This :: wxSizer(), Window :: wxWindow:wxWindow().

Tell the sizer to resize the window so that its client area matches the sizer's minimal size (ComputeFittingClientSize() (not implemented in wx) is called to determine it).

This is commonly done in the constructor of the window itself, see sample in the description of wxBoxSizer.

Return: The new window size.

fitInside(This, Window)

-spec fitInside(This, Window) -> ok when This :: wxSizer(), Window :: wxWindow:wxWindow().

Tell the sizer to resize the virtual size of the window to match the sizer's minimal size.

This will not alter the on screen size of the window, but may cause the addition/removal/alteration of scrollbars required to view the virtual area in windows which manage it.

See:

wxScrolledWindow:setScrollbars/6

setVirtualSizeHints/2

getChildren(This)

-spec getChildren(This) -> [wxSizerItem:wxSizerItem()] when This :: wxSizer().

getItem/2

-spec getItem(This, Window) -> wxSizerItem:wxSizerItem()
                 when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
             (This, Index) -> wxSizerItem:wxSizerItem() when This :: wxSizer(), Index :: integer().

Finds wxSizerItem which is located in the sizer at position index.

Use parameter recursive to search in subsizers too. Returns pointer to item or NULL.

getItem/3

-spec getItem(This, Window, [Option]) -> wxSizerItem:wxSizerItem()
                 when
                     This :: wxSizer(),
                     Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Option :: {recursive, boolean()}.

Finds wxSizerItem which holds the given window.

Use parameter recursive to search in subsizers too. Returns pointer to item or NULL.

getMinSize(This)

-spec getMinSize(This) -> {W :: integer(), H :: integer()} when This :: wxSizer().

Returns the minimal size of the sizer.

This is either the combined minimal size of all the children and their borders or the minimal size set by setMinSize/3, depending on which is bigger. Note that the returned value is client size, not window size. In particular, if you use the value to set toplevel window's minimal or actual size, use wxWindow::SetMinClientSize() (not implemented in wx) or wxWindow:setClientSize/3, not wxWindow:setMinSize/2 or wxWindow:setSize/6.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxSizer().

Returns the current position of the sizer.

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxSizer().

Returns the current size of the sizer.

hide/2

-spec hide(This, Window) -> boolean()
              when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
          (This, Index) -> boolean() when This :: wxSizer(), Index :: integer().

Hides the item at position index.

To make a sizer item disappear, use hide/3 followed by layout/1.

Use parameter recursive to hide elements found in subsizers. Returns true if the child item was found, false otherwise.

See:

isShown/2

show/3

hide/3

-spec hide(This, Window, [Option]) -> boolean()
              when
                  This :: wxSizer(),
                  Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                  Option :: {recursive, boolean()}.

Hides the child window.

To make a sizer item disappear, use hide/3 followed by layout/1.

Use parameter recursive to hide elements found in subsizers. Returns true if the child item was found, false otherwise.

See:

isShown/2

show/3

insert(This, Index, Item)

-spec insert(This, Index, Item) -> wxSizerItem:wxSizerItem()
                when This :: wxSizer(), Index :: integer(), Item :: wxSizerItem:wxSizerItem().

insert/4

-spec insert(This, Index, Width, Height) -> wxSizerItem:wxSizerItem()
                when This :: wxSizer(), Index :: integer(), Width :: integer(), Height :: integer();
            (This, Index, Window, Flags) -> wxSizerItem:wxSizerItem()
                when
                    This :: wxSizer(),
                    Index :: integer(),
                    Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                    Flags :: wxSizerFlags:wxSizerFlags();
            (This, Index, Window, [Option]) -> wxSizerItem:wxSizerItem()
                when
                    This :: wxSizer(),
                    Index :: integer(),
                    Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                    Option ::
                        {proportion, integer()} |
                        {flag, integer()} |
                        {border, integer()} |
                        {userData, wx:wx_object()}.

Insert a child into the sizer before any existing item at index.

See add/4 for the meaning of the other parameters.

insert/5

-spec insert(This, Index, Width, Height, [Option]) -> wxSizerItem:wxSizerItem()
                when
                    This :: wxSizer(),
                    Index :: integer(),
                    Width :: integer(),
                    Height :: integer(),
                    Option ::
                        {proportion, integer()} |
                        {flag, integer()} |
                        {border, integer()} |
                        {userData, wx:wx_object()};
            (This, Index, Width, Height, Flags) -> wxSizerItem:wxSizerItem()
                when
                    This :: wxSizer(),
                    Index :: integer(),
                    Width :: integer(),
                    Height :: integer(),
                    Flags :: wxSizerFlags:wxSizerFlags().

Insert a child into the sizer before any existing item at index.

See add/4 for the meaning of the other parameters.

insertSpacer(This, Index, Size)

-spec insertSpacer(This, Index, Size) -> wxSizerItem:wxSizerItem()
                      when This :: wxSizer(), Index :: integer(), Size :: integer().

Inserts non-stretchable space to the sizer.

More readable way of calling wxSizer::Insert(index, size, size).

insertStretchSpacer(This, Index)

-spec insertStretchSpacer(This, Index) -> wxSizerItem:wxSizerItem()
                             when This :: wxSizer(), Index :: integer().

Equivalent to insertStretchSpacer(This, Index, []).

insertStretchSpacer/3

-spec insertStretchSpacer(This, Index, [Option]) -> wxSizerItem:wxSizerItem()
                             when This :: wxSizer(), Index :: integer(), Option :: {prop, integer()}.

Inserts stretchable space to the sizer.

More readable way of calling wxSizer::Insert(0, 0, prop).

isShown/2

-spec isShown(This, Window) -> boolean()
                 when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
             (This, Index) -> boolean() when This :: wxSizer(), Index :: integer().

Returns true if the item at index is shown.

See:

hide/3

show/3

wxSizerItem:isShown/1

layout(This)

-spec layout(This) -> ok when This :: wxSizer().

Call this to force layout of the children anew, e.g. after having added a child to or removed a child (window, other sizer or space) from the sizer while keeping the current dimension.

prepend(This, Item)

-spec prepend(This, Item) -> wxSizerItem:wxSizerItem()
                 when This :: wxSizer(), Item :: wxSizerItem:wxSizerItem().

prepend/3

-spec prepend(This, Width, Height) -> wxSizerItem:wxSizerItem()
                 when This :: wxSizer(), Width :: integer(), Height :: integer();
             (This, Window, Flags) -> wxSizerItem:wxSizerItem()
                 when
                     This :: wxSizer(),
                     Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Flags :: wxSizerFlags:wxSizerFlags();
             (This, Window, [Option]) -> wxSizerItem:wxSizerItem()
                 when
                     This :: wxSizer(),
                     Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Option ::
                         {proportion, integer()} |
                         {flag, integer()} |
                         {border, integer()} |
                         {userData, wx:wx_object()}.

Same as add/4, but prepends the items to the beginning of the list of items (windows, subsizers or spaces) owned by this sizer.

prepend/4

-spec prepend(This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem()
                 when
                     This :: wxSizer(),
                     Width :: integer(),
                     Height :: integer(),
                     Option ::
                         {proportion, integer()} |
                         {flag, integer()} |
                         {border, integer()} |
                         {userData, wx:wx_object()};
             (This, Width, Height, Flags) -> wxSizerItem:wxSizerItem()
                 when
                     This :: wxSizer(),
                     Width :: integer(),
                     Height :: integer(),
                     Flags :: wxSizerFlags:wxSizerFlags().

Same as add/4, but prepends the items to the beginning of the list of items (windows, subsizers or spaces) owned by this sizer.

prependSpacer(This, Size)

-spec prependSpacer(This, Size) -> wxSizerItem:wxSizerItem() when This :: wxSizer(), Size :: integer().

Prepends non-stretchable space to the sizer.

More readable way of calling wxSizer::Prepend(size, size, 0).

prependStretchSpacer(This)

-spec prependStretchSpacer(This) -> wxSizerItem:wxSizerItem() when This :: wxSizer().

Equivalent to prependStretchSpacer(This, []).

prependStretchSpacer/2

-spec prependStretchSpacer(This, [Option]) -> wxSizerItem:wxSizerItem()
                              when This :: wxSizer(), Option :: {prop, integer()}.

Prepends stretchable space to the sizer.

More readable way of calling wxSizer::Prepend(0, 0, prop).

recalcSizes(This)

-spec recalcSizes(This) -> ok when This :: wxSizer().

Equivalent to: layout/1

remove/2

-spec remove(This, Index) -> boolean() when This :: wxSizer(), Index :: integer();
            (This, Sizer) -> boolean() when This :: wxSizer(), Sizer :: wxSizer().

Removes a sizer child from the sizer and destroys it.

Note: This method does not cause any layout or resizing to take place, call layout/1 to update the layout "on screen" after removing a child from the sizer.

Return: true if the child item was found and removed, false otherwise.

replace/3

-spec replace(This, Oldwin, Newwin) -> boolean()
                 when
                     This :: wxSizer(),
                     Oldwin :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Newwin :: wxWindow:wxWindow() | wxSizer:wxSizer();
             (This, Index, Newitem) -> boolean()
                 when This :: wxSizer(), Index :: integer(), Newitem :: wxSizerItem:wxSizerItem().

Detaches the given item at position index from the sizer and replaces it with the given wxSizerItem newitem.

The detached child is deleted only if it is a sizer or a spacer (but not if it is a wxWindow because windows are owned by their parent window, not the sizer).

This method does not cause any layout or resizing to take place, call layout/1 to update the layout "on screen" after replacing a child from the sizer.

Returns true if the child item was found and removed, false otherwise.

replace/4

-spec replace(This, Oldwin, Newwin, [Option]) -> boolean()
                 when
                     This :: wxSizer(),
                     Oldwin :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Newwin :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                     Option :: {recursive, boolean()}.

Detaches the given oldwin from the sizer and replaces it with the given newwin.

The detached child window is not deleted (because windows are owned by their parent window, not the sizer).

Use parameter recursive to search the given element recursively in subsizers.

This method does not cause any layout or resizing to take place, call layout/1 to update the layout "on screen" after replacing a child from the sizer.

Returns true if the child item was found and removed, false otherwise.

setDimension(This, Pos, Size)

-spec setDimension(This, Pos, Size) -> ok
                      when
                          This :: wxSizer(),
                          Pos :: {X :: integer(), Y :: integer()},
                          Size :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setDimension(This, X, Y, Width, Height)

-spec setDimension(This, X, Y, Width, Height) -> ok
                      when
                          This :: wxSizer(),
                          X :: integer(),
                          Y :: integer(),
                          Width :: integer(),
                          Height :: integer().

Call this to force the sizer to take the given dimension and thus force the items owned by the sizer to resize themselves according to the rules defined by the parameter in the add/4 and prepend/4 methods.

setItemMinSize/3

-spec setItemMinSize(This, Window, Size) -> boolean()
                        when
                            This :: wxSizer(),
                            Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                            Size :: {W :: integer(), H :: integer()};
                    (This, Index, Size) -> boolean()
                        when
                            This :: wxSizer(),
                            Index :: integer(),
                            Size :: {W :: integer(), H :: integer()}.

setItemMinSize/4

-spec setItemMinSize(This, Window, Width, Height) -> boolean()
                        when
                            This :: wxSizer(),
                            Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                            Width :: integer(),
                            Height :: integer();
                    (This, Index, Width, Height) -> boolean()
                        when
                            This :: wxSizer(),
                            Index :: integer(),
                            Width :: integer(),
                            Height :: integer().

setMinSize(This, Size)

-spec setMinSize(This, Size) -> ok when This :: wxSizer(), Size :: {W :: integer(), H :: integer()}.

Call this to give the sizer a minimal size.

Normally, the sizer will calculate its minimal size based purely on how much space its children need. After calling this method getMinSize/1 will return either the minimal size as requested by its children or the minimal size set here, depending on which is bigger.

setMinSize(This, Width, Height)

-spec setMinSize(This, Width, Height) -> ok
                    when This :: wxSizer(), Width :: integer(), Height :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSizeHints(This, Window)

-spec setSizeHints(This, Window) -> ok when This :: wxSizer(), Window :: wxWindow:wxWindow().

This method first calls fit/2 and then setSizeHints/2 on the window passed to it.

This only makes sense when window is actually a wxTopLevelWindow such as a wxFrame or a wxDialog, since SetSizeHints only has any effect in these classes. It does nothing in normal windows or controls.

This method is implicitly used by wxWindow:setSizerAndFit/3 which is commonly invoked in the constructor of a toplevel window itself (see the sample in the description of wxBoxSizer) if the toplevel window is resizable.

setVirtualSizeHints(This, Window)

-spec setVirtualSizeHints(This, Window) -> ok when This :: wxSizer(), Window :: wxWindow:wxWindow().

Equivalent to: fitInside/2

show/2

-spec show(This, Window) -> boolean()
              when This :: wxSizer(), Window :: wxWindow:wxWindow() | wxSizer:wxSizer();
          (This, Index) -> boolean() when This :: wxSizer(), Index :: integer();
          (This, Show) -> ok when This :: wxSizer(), Show :: boolean().

show/3

-spec show(This, Window, [Option]) -> boolean()
              when
                  This :: wxSizer(),
                  Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                  Option :: {show, boolean()} | {recursive, boolean()};
          (This, Index, [Option]) -> boolean()
              when This :: wxSizer(), Index :: integer(), Option :: {show, boolean()}.

Shows the item at index.

To make a sizer item disappear or reappear, use show/3 followed by layout/1.

Returns true if the child item was found, false otherwise.

See:

hide/3

isShown/2

showItems(This, Show)

-spec showItems(This, Show) -> ok when This :: wxSizer(), Show :: boolean().

Show or hide all items managed by the sizer.

wxSizerFlags

Container for sizer items flags providing readable names for them.

Normally, when you add an item to a sizer via wxSizer:add/4, you have to specify a lot of flags and parameters which can be unwieldy. This is where wxSizerFlags comes in: it allows you to specify all parameters using the named methods instead. For example, instead of

you can now write

This is more readable and also allows you to create wxSizerFlags objects which can be reused for several sizer items.

Note that by specification, all methods of wxSizerFlags return the wxSizerFlags object itself to allowing chaining multiple methods calls like in the examples above.

See: wxSizer

wxWidgets docs: wxSizerFlags

Summary

Types

wxSizerFlags()

Functions

align(This, Alignment)

Sets the alignment of this wxSizerFlags to align.

border(This)

Equivalent to border(This, []).

border/2

Sets the wxSizerFlags to have a border with size as returned by GetDefaultBorder() (not implemented in wx).

border(This, Direction, Borderinpixels)

Sets the wxSizerFlags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction.

center(This)

Sets the object of the wxSizerFlags to center itself in the area it is given.

centre(This)

Equivalent to: center/1

destroy(This)

Destroys the object

expand(This)

Sets the object of the wxSizerFlags to expand to fill as much area as it can.

left(This)

Aligns the object to the left, similar for Align(wxALIGN\_LEFT).

new()

Equivalent to new([]).

new(Options)

Creates the wxSizer with the proportion specified by proportion.

proportion(This, Proportion)

Sets the proportion of this wxSizerFlags to proportion.

right(This)

Aligns the object to the right, similar for Align(wxALIGN\_RIGHT).

Types

wxSizerFlags()

-type wxSizerFlags() :: wx:wx_object().

Functions

align(This, Alignment)

-spec align(This, Alignment) -> wxSizerFlags() when This :: wxSizerFlags(), Alignment :: integer().

Sets the alignment of this wxSizerFlags to align.

This method replaces the previously set alignment with the specified one.

See:

left/1

right/1

centre/1

border(This)

-spec border(This) -> wxSizerFlags() when This :: wxSizerFlags().

Equivalent to border(This, []).

border/2

-spec border(This, [Option]) -> wxSizerFlags()
                when This :: wxSizerFlags(), Option :: {direction, integer()}.

Sets the wxSizerFlags to have a border with size as returned by GetDefaultBorder() (not implemented in wx).

border(This, Direction, Borderinpixels)

-spec border(This, Direction, Borderinpixels) -> wxSizerFlags()
                when This :: wxSizerFlags(), Direction :: integer(), Borderinpixels :: integer().

Sets the wxSizerFlags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction.

Prefer to use the overload below or DoubleBorder() (not implemented in wx) or TripleBorder() (not implemented in wx) versions instead of hard-coding the border value in pixels to avoid too small borders on devices with high DPI displays.

center(This)

-spec center(This) -> wxSizerFlags() when This :: wxSizerFlags().

Sets the object of the wxSizerFlags to center itself in the area it is given.

centre(This)

-spec centre(This) -> wxSizerFlags() when This :: wxSizerFlags().

Equivalent to: center/1

destroy(This)

-spec destroy(This :: wxSizerFlags()) -> ok.

Destroys the object

expand(This)

-spec expand(This) -> wxSizerFlags() when This :: wxSizerFlags().

Sets the object of the wxSizerFlags to expand to fill as much area as it can.

left(This)

-spec left(This) -> wxSizerFlags() when This :: wxSizerFlags().

Aligns the object to the left, similar for Align(wxALIGN\_LEFT).

Unlike align/2, this method doesn't change the vertical alignment of the item.

new()

-spec new() -> wxSizerFlags().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxSizerFlags() when Option :: {proportion, integer()}.

Creates the wxSizer with the proportion specified by proportion.

proportion(This, Proportion)

-spec proportion(This, Proportion) -> wxSizerFlags()
                    when This :: wxSizerFlags(), Proportion :: integer().

Sets the proportion of this wxSizerFlags to proportion.

right(This)

-spec right(This) -> wxSizerFlags() when This :: wxSizerFlags().

Aligns the object to the right, similar for Align(wxALIGN\_RIGHT).

Unlike align/2, this method doesn't change the vertical alignment of the item.

wxSizerItem

The wxSizerItem class is used to track the position, size and other attributes of each item managed by a wxSizer.

It is not usually necessary to use this class because the sizer elements can also be identified by their positions or window or sizer pointers but sometimes it may be more convenient to use it directly.

wxWidgets docs: wxSizerItem

Summary

Types

wxSizerItem()

Functions

assignSizer(This, Sizer)

Set the sizer tracked by this item.

assignSpacer(This, Size)

Set the size of the spacer tracked by this item.

assignSpacer(This, W, H)

assignWindow(This, Window)

Set the window to be tracked by this item.

calcMin(This)

Calculates the minimum desired size for the item, including any space needed by borders.

deleteWindows(This)

Destroy the window or the windows in a subsizer, depending on the type of item.

destroy(This)

Destroys the object

detachSizer(This)

Enable deleting the SizerItem without destroying the contained sizer.

getBorder(This)

Return the border attribute.

getFlag(This)

Return the flags attribute.

getMinSize(This)

Get the minimum size needed for the item.

getPosition(This)

What is the current position of the item, as set in the last Layout.

getProportion(This)

Get the proportion item attribute.

getRatio(This)

Get the ratio item attribute.

getRect(This)

Get the rectangle of the item on the parent window, excluding borders.

getSize(This)

Get the current size of the item, as set in the last Layout.

getSizer(This)

If this item is tracking a sizer, return it.

getSpacer(This)

If this item is tracking a spacer, return its size.

getUserData(This)

Get the userData item attribute.

getWindow(This)

If this item is tracking a window then return it.

isShown(This)

Returns true if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden.

isSizer(This)

Is this item a sizer?

isSpacer(This)

Is this item a spacer?

isWindow(This)

Is this item a window?

new(Window)

Equivalent to new(Window, []).

new/2

new(Width, Height, Options)

Construct a sizer item for tracking a spacer.

setBorder(This, Border)

Set the border item attribute.

setDimension(This, Pos, Size)

Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account.

setFlag(This, Flag)

Set the flag item attribute.

setInitSize(This, X, Y)

Sets the minimum size to be allocated for this item.

setMinSize(This, Size)

Sets the minimum size to be allocated for this item.

setMinSize(This, X, Y)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setProportion(This, Proportion)

Set the proportion item attribute.

setRatio/2

setRatio(This, Width, Height)

Set the ratio item attribute.

show(This, Show)

Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.

Types

wxSizerItem()

-type wxSizerItem() :: wx:wx_object().

Functions

assignSizer(This, Sizer)

-spec assignSizer(This, Sizer) -> ok when This :: wxSizerItem(), Sizer :: wxSizer:wxSizer().

Set the sizer tracked by this item.

Old sizer, if any, is deleted.

assignSpacer(This, Size)

-spec assignSpacer(This, Size) -> ok
                      when This :: wxSizerItem(), Size :: {W :: integer(), H :: integer()}.

Set the size of the spacer tracked by this item.

Old spacer, if any, is deleted.

assignSpacer(This, W, H)

-spec assignSpacer(This, W, H) -> ok when This :: wxSizerItem(), W :: integer(), H :: integer().

assignWindow(This, Window)

-spec assignWindow(This, Window) -> ok when This :: wxSizerItem(), Window :: wxWindow:wxWindow().

Set the window to be tracked by this item.

Note: This is a low-level method which is dangerous if used incorrectly, avoid using it if possible, i.e. if higher level methods such as wxSizer:replace/4 can be used instead.

If the sizer item previously contained a window, it is dissociated from the sizer containing this sizer item (if any), but this object doesn't have the pointer to the containing sizer and so it's the caller's responsibility to call wxWindow:setContainingSizer/2 on window. Failure to do this can result in memory corruption when the window is destroyed later, so it is crucial to not forget to do it.

Also note that the previously contained window is not deleted, so it's also the callers responsibility to do it, if necessary.

calcMin(This)

-spec calcMin(This) -> {W :: integer(), H :: integer()} when This :: wxSizerItem().

Calculates the minimum desired size for the item, including any space needed by borders.

deleteWindows(This)

-spec deleteWindows(This) -> ok when This :: wxSizerItem().

Destroy the window or the windows in a subsizer, depending on the type of item.

destroy(This)

-spec destroy(This :: wxSizerItem()) -> ok.

Destroys the object

detachSizer(This)

-spec detachSizer(This) -> ok when This :: wxSizerItem().

Enable deleting the SizerItem without destroying the contained sizer.

getBorder(This)

-spec getBorder(This) -> integer() when This :: wxSizerItem().

Return the border attribute.

getFlag(This)

-spec getFlag(This) -> integer() when This :: wxSizerItem().

Return the flags attribute.

See wxSizer flags list (not implemented in wx) for details.

getMinSize(This)

-spec getMinSize(This) -> {W :: integer(), H :: integer()} when This :: wxSizerItem().

Get the minimum size needed for the item.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxSizerItem().

What is the current position of the item, as set in the last Layout.

getProportion(This)

-spec getProportion(This) -> integer() when This :: wxSizerItem().

Get the proportion item attribute.

getRatio(This)

-spec getRatio(This) -> number() when This :: wxSizerItem().

Get the ratio item attribute.

getRect(This)

-spec getRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                 when This :: wxSizerItem().

Get the rectangle of the item on the parent window, excluding borders.

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxSizerItem().

Get the current size of the item, as set in the last Layout.

getSizer(This)

-spec getSizer(This) -> wxSizer:wxSizer() when This :: wxSizerItem().

If this item is tracking a sizer, return it.

NULL otherwise.

getSpacer(This)

-spec getSpacer(This) -> {W :: integer(), H :: integer()} when This :: wxSizerItem().

If this item is tracking a spacer, return its size.

getUserData(This)

-spec getUserData(This) -> wx:wx_object() when This :: wxSizerItem().

Get the userData item attribute.

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxSizerItem().

If this item is tracking a window then return it.

NULL otherwise.

isShown(This)

-spec isShown(This) -> boolean() when This :: wxSizerItem().

Returns true if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden.

In other words, for sizer items, all of the child elements must be hidden for the sizer itself to be considered hidden.

As an exception, if the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was used for this sizer item, then isShown/1 always returns true for it (see wxSizerFlags::ReserveSpaceEvenIfHidden() (not implemented in wx)).

isSizer(This)

-spec isSizer(This) -> boolean() when This :: wxSizerItem().

Is this item a sizer?

isSpacer(This)

-spec isSpacer(This) -> boolean() when This :: wxSizerItem().

Is this item a spacer?

isWindow(This)

-spec isWindow(This) -> boolean() when This :: wxSizerItem().

Is this item a window?

new(Window)

-spec new(Window) -> wxSizerItem() when Window :: wxWindow:wxWindow() | wxSizer:wxSizer().

Equivalent to new(Window, []).

new/2

-spec new(Width, Height) -> wxSizerItem() when Width :: integer(), Height :: integer();
         (Window, Flags) -> wxSizerItem()
             when
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(), Flags :: wxSizerFlags:wxSizerFlags();
         (Window, [Option]) -> wxSizerItem()
             when
                 Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
                 Option ::
                     {proportion, integer()} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()}.

new(Width, Height, Options)

-spec new(Width, Height, [Option]) -> wxSizerItem()
             when
                 Width :: integer(),
                 Height :: integer(),
                 Option ::
                     {proportion, integer()} |
                     {flag, integer()} |
                     {border, integer()} |
                     {userData, wx:wx_object()}.

Construct a sizer item for tracking a spacer.

setBorder(This, Border)

-spec setBorder(This, Border) -> ok when This :: wxSizerItem(), Border :: integer().

Set the border item attribute.

setDimension(This, Pos, Size)

-spec setDimension(This, Pos, Size) -> ok
                      when
                          This :: wxSizerItem(),
                          Pos :: {X :: integer(), Y :: integer()},
                          Size :: {W :: integer(), H :: integer()}.

Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account.

setFlag(This, Flag)

-spec setFlag(This, Flag) -> ok when This :: wxSizerItem(), Flag :: integer().

Set the flag item attribute.

setInitSize(This, X, Y)

-spec setInitSize(This, X, Y) -> ok when This :: wxSizerItem(), X :: integer(), Y :: integer().

Sets the minimum size to be allocated for this item.

This is identical to setMinSize/3, prefer to use the other function, as its name is more clear.

setMinSize(This, Size)

-spec setMinSize(This, Size) -> ok when This :: wxSizerItem(), Size :: {W :: integer(), H :: integer()}.

Sets the minimum size to be allocated for this item.

If this item is a window, the size is also passed to wxWindow:setMinSize/2.

setMinSize(This, X, Y)

-spec setMinSize(This, X, Y) -> ok when This :: wxSizerItem(), X :: integer(), Y :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setProportion(This, Proportion)

-spec setProportion(This, Proportion) -> ok when This :: wxSizerItem(), Proportion :: integer().

Set the proportion item attribute.

setRatio/2

-spec setRatio(This, Ratio) -> ok when This :: wxSizerItem(), Ratio :: number();
              (This, Size) -> ok when This :: wxSizerItem(), Size :: {W :: integer(), H :: integer()}.

setRatio(This, Width, Height)

-spec setRatio(This, Width, Height) -> ok
                  when This :: wxSizerItem(), Width :: integer(), Height :: integer().

Set the ratio item attribute.

show(This, Show)

-spec show(This, Show) -> ok when This :: wxSizerItem(), Show :: boolean().

Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.

If the item is tracking a window then it is shown or hidden as needed.

wxSlider

A slider is a control with a handle which can be pulled back and forth to change the value.

On Windows, the track bar control is used.

On GTK+, tick marks are only available for version 2.16 and later.

Slider generates the same events as wxScrollBar but in practice the most convenient way to process wxSlider updates is by handling the slider-specific wxEVT_SLIDER event which carries wxCommandEvent containing just the latest slider position.

Styles

This class supports the following styles:

wxSL_HORIZONTAL: Displays the slider horizontally (this is the default).

wxSL_VERTICAL: Displays the slider vertically.

wxSL_AUTOTICKS: Displays tick marks (Windows, GTK+ 2.16 and later).

wxSL_MIN_MAX_LABELS: Displays minimum, maximum labels (new since wxWidgets 2.9.1).

wxSL_VALUE_LABEL: Displays value label (new since wxWidgets 2.9.1).

wxSL_LABELS: Displays minimum, maximum and value labels (same as wxSL_VALUE_LABEL and wxSL_MIN_MAX_LABELS together).

wxSL_LEFT: Displays ticks on the left and forces the slider to be vertical (Windows and GTK+ 3 only).

wxSL_RIGHT: Displays ticks on the right and forces the slider to be vertical.

wxSL_TOP: Displays ticks on the top (Windows and GTK+ 3 only).

wxSL_BOTTOM: Displays ticks on the bottom (this is the default).

wxSL_BOTH: Displays ticks on both sides of the slider. Windows only.

wxSL_SELRANGE: Displays a highlighted selection range. Windows only.

wxSL_INVERSE: Inverses the minimum and maximum endpoints on the slider. Not compatible with wxSL_SELRANGE. Notice that wxSL_LEFT, wxSL_TOP, wxSL_RIGHT and wxSL_BOTTOM specify the position of the slider ticks and that the slider labels, if any, are positioned on the opposite side. So, to have a label on the left side of a vertical slider, wxSL_RIGHT must be used (or none of these styles at all should be specified as left and top are default positions for the vertical and horizontal sliders respectively).

The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED

The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event).

The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen). In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/ moving has finished independently of the way it had started. Please see the page_samples_widgets ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action.

See:

Overview events

wxScrollBar

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxSlider

Events

Event types emitted from this class:

scroll_top

scroll_bottom

scroll_lineup

scroll_linedown

scroll_pageup

scroll_pagedown

scroll_thumbtrack

scroll_thumbrelease

scroll_changed

scroll_top

scroll_bottom

scroll_lineup

scroll_linedown

scroll_pageup

scroll_pagedown

scroll_thumbtrack

scroll_thumbrelease

scroll_changed

command_slider_updated

Summary

Types

wxSlider()

Functions

create(This, Parent, Id, Value, MinValue, MaxValue)

Equivalent to create(This, Parent, Id, Value, MinValue, MaxValue, []).

create/7

Used for two-step slider construction.

destroy(This)

Destroys the object

getLineSize(This)

Returns the line size.

getMax(This)

Gets the maximum slider value.

getMin(This)

Gets the minimum slider value.

getPageSize(This)

Returns the page size.

getThumbLength(This)

Returns the thumb length.

getValue(This)

Gets the current slider value.

new()

Default constructor.

new(Parent, Id, Value, MinValue, MaxValue)

Equivalent to new(Parent, Id, Value, MinValue, MaxValue, []).

new/6

Constructor, creating and showing a slider.

setLineSize(This, LineSize)

Sets the line size for the slider.

setPageSize(This, PageSize)

Sets the page size for the slider.

setRange(This, MinValue, MaxValue)

Sets the minimum and maximum slider values.

setThumbLength(This, Len)

Sets the slider thumb length.

setValue(This, Value)

Sets the slider position.

Types

wxSlider()

-type wxSlider() :: wx:wx_object().

Functions

create(This, Parent, Id, Value, MinValue, MaxValue)

-spec create(This, Parent, Id, Value, MinValue, MaxValue) -> boolean()
                when
                    This :: wxSlider(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Value :: integer(),
                    MinValue :: integer(),
                    MaxValue :: integer().

Equivalent to create(This, Parent, Id, Value, MinValue, MaxValue, []).

create/7

-spec create(This, Parent, Id, Value, MinValue, MaxValue, [Option]) -> boolean()
                when
                    This :: wxSlider(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Value :: integer(),
                    MinValue :: integer(),
                    MaxValue :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Used for two-step slider construction.

See new/6 for further details.

destroy(This)

-spec destroy(This :: wxSlider()) -> ok.

Destroys the object

getLineSize(This)

-spec getLineSize(This) -> integer() when This :: wxSlider().

Returns the line size.

See: setLineSize/2

getMax(This)

-spec getMax(This) -> integer() when This :: wxSlider().

Gets the maximum slider value.

See:

getMin/1

setRange/3

getMin(This)

-spec getMin(This) -> integer() when This :: wxSlider().

Gets the minimum slider value.

See:

getMin/1

setRange/3

getPageSize(This)

-spec getPageSize(This) -> integer() when This :: wxSlider().

Returns the page size.

See: setPageSize/2

getThumbLength(This)

-spec getThumbLength(This) -> integer() when This :: wxSlider().

Returns the thumb length.

Only for:wxmsw

See: setThumbLength/2

getValue(This)

-spec getValue(This) -> integer() when This :: wxSlider().

Gets the current slider value.

See:

getMin/1

getMax/1

setValue/2

new()

-spec new() -> wxSlider().

Default constructor.

new(Parent, Id, Value, MinValue, MaxValue)

-spec new(Parent, Id, Value, MinValue, MaxValue) -> wxSlider()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Value :: integer(),
                 MinValue :: integer(),
                 MaxValue :: integer().

Equivalent to new(Parent, Id, Value, MinValue, MaxValue, []).

new/6

-spec new(Parent, Id, Value, MinValue, MaxValue, [Option]) -> wxSlider()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Value :: integer(),
                 MinValue :: integer(),
                 MaxValue :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a slider.

See: create/7

setLineSize(This, LineSize)

-spec setLineSize(This, LineSize) -> ok when This :: wxSlider(), LineSize :: integer().

Sets the line size for the slider.

See: getLineSize/1

setPageSize(This, PageSize)

-spec setPageSize(This, PageSize) -> ok when This :: wxSlider(), PageSize :: integer().

Sets the page size for the slider.

See: getPageSize/1

setRange(This, MinValue, MaxValue)

-spec setRange(This, MinValue, MaxValue) -> ok
                  when This :: wxSlider(), MinValue :: integer(), MaxValue :: integer().

Sets the minimum and maximum slider values.

See:

getMin/1

getMax/1

setThumbLength(This, Len)

-spec setThumbLength(This, Len) -> ok when This :: wxSlider(), Len :: integer().

Sets the slider thumb length.

Only for:wxmsw

See: getThumbLength/1

setValue(This, Value)

-spec setValue(This, Value) -> ok when This :: wxSlider(), Value :: integer().

Sets the slider position.

wxSpinButton

A wxSpinButton has two small up and down (or left and right) arrow buttons.

It is often used next to a text control for increment and decrementing a value. Portable programs should try to use wxSpinCtrl instead as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it degenerates to a simple wxTextCtrl on such platforms.

Note: the range supported by this control (and wxSpinCtrl) depends on the platform but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit range is supported.

Styles

This class supports the following styles:

wxSP_HORIZONTAL: Specifies a horizontal spin button (note that this style is not supported in wxGTK).

wxSP_VERTICAL: Specifies a vertical spin button.

wxSP_ARROW_KEYS: The user can use arrow keys to change the value.

wxSP_WRAP: The value wraps at the minimum and maximum.

See: wxSpinCtrl

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxSpinButton

Events

Event types emitted from this class:

spin

spin_up

spin_down

Summary

Types

wxSpinButton()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Scrollbar creation function called by the spin button constructor.

destroy(This)

Destroys the object

getMax(This)

Returns the maximum permissible value.

getMin(This)

Returns the minimum permissible value.

getValue(This)

Returns the current spin button value.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor, creating and showing a spin button.

setRange(This, Min, Max)

Sets the range of the spin button.

setValue(This, Value)

Sets the value of the spin button.

Types

wxSpinButton()

-type wxSpinButton() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxSpinButton(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxSpinButton(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Scrollbar creation function called by the spin button constructor.

See new/2 for details.

destroy(This)

-spec destroy(This :: wxSpinButton()) -> ok.

Destroys the object

getMax(This)

-spec getMax(This) -> integer() when This :: wxSpinButton().

Returns the maximum permissible value.

See: setRange/3

getMin(This)

-spec getMin(This) -> integer() when This :: wxSpinButton().

Returns the minimum permissible value.

See: setRange/3

getValue(This)

-spec getValue(This) -> integer() when This :: wxSpinButton().

Returns the current spin button value.

See: setValue/2

new()

-spec new() -> wxSpinButton().

Default constructor.

new(Parent)

-spec new(Parent) -> wxSpinButton() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxSpinButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating and showing a spin button.

See: create/3

setRange(This, Min, Max)

-spec setRange(This, Min, Max) -> ok when This :: wxSpinButton(), Min :: integer(), Max :: integer().

Sets the range of the spin button.

In portable code, min should be less than or equal to max. In wxMSW it is possible to specify minimum greater than maximum and the native control supports the same range as if they were reversed, but swaps the meaning of up and down arrows, however this dubious feature is not supported on other platforms.

See:

getMin/1

getMax/1

setValue(This, Value)

-spec setValue(This, Value) -> ok when This :: wxSpinButton(), Value :: integer().

Sets the value of the spin button.

wxSpinCtrl

wxSpinCtrl combines wxTextCtrl and wxSpinButton in one control.

Styles

This class supports the following styles:

wxSP_ARROW_KEYS: The user can use arrow keys to change the value.

wxSP_WRAP: The value wraps at the minimum and maximum.

wxTE_PROCESS_ENTER: Indicates that the control should generate wxEVT_TEXT_ENTER events. Using this style will prevent the user from using the Enter key for dialog navigation (e.g. activating the default button in the dialog) under MSW.

wxALIGN_LEFT: Same as wxTE_LEFT for wxTextCtrl: the text is left aligned (this is the default).

wxALIGN_CENTRE_HORIZONTAL: Same as wxTE_CENTRE for wxTextCtrl: the text is centered.

wxALIGN_RIGHT: Same as wxTE_RIGHT for wxTextCtrl: the text is right aligned.

See:

wxSpinButton

wxControl

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxSpinCtrl

Events

Event types emitted from this class:

command_spinctrl_updated

Summary

Types

wxSpinCtrl()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creation function called by the spin control constructor.

destroy(This)

Destroys the object

getMax(This)

Gets maximal allowable value.

getMin(This)

Gets minimal allowable value.

getValue(This)

Gets the value of the spin control.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor, creating and showing a spin control.

setRange(This, MinVal, MaxVal)

Sets range of allowable values.

setSelection(This, From, To)

Select the text in the text part of the control between positions from (inclusive) and to (exclusive).

setValue/2

Sets the value of the spin control.

Types

wxSpinCtrl()

-type wxSpinCtrl() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxSpinCtrl(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxSpinCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {value, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {min, integer()} |
                        {max, integer()} |
                        {initial, integer()}.

Creation function called by the spin control constructor.

See new/2 for details.

destroy(This)

-spec destroy(This :: wxSpinCtrl()) -> ok.

Destroys the object

getMax(This)

-spec getMax(This) -> integer() when This :: wxSpinCtrl().

Gets maximal allowable value.

getMin(This)

-spec getMin(This) -> integer() when This :: wxSpinCtrl().

Gets minimal allowable value.

getValue(This)

-spec getValue(This) -> integer() when This :: wxSpinCtrl().

Gets the value of the spin control.

new()

-spec new() -> wxSpinCtrl().

Default constructor.

new(Parent)

-spec new(Parent) -> wxSpinCtrl() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxSpinCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {value, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {min, integer()} |
                     {max, integer()} |
                     {initial, integer()}.

Constructor, creating and showing a spin control.

If value is non-empty, it will be shown in the text entry part of the control and if it has numeric value, the initial numeric value of the control, as returned by getValue/1 will also be determined by it instead of by initial. Hence, it only makes sense to specify initial if value is an empty string or is not convertible to a number, otherwise initial is simply ignored and the number specified by value is used.

See: create/3

setRange(This, MinVal, MaxVal)

-spec setRange(This, MinVal, MaxVal) -> ok
                  when This :: wxSpinCtrl(), MinVal :: integer(), MaxVal :: integer().

Sets range of allowable values.

Notice that calling this method may change the value of the control if it's not inside the new valid range, e.g. it will become minVal if it is less than it now. However no wxEVT_SPINCTRL event is generated, even if it the value does change.

Note: Setting a range including negative values is silently ignored if current base is set to 16.

setSelection(This, From, To)

-spec setSelection(This, From, To) -> ok when This :: wxSpinCtrl(), From :: integer(), To :: integer().

Select the text in the text part of the control between positions from (inclusive) and to (exclusive).

This is similar to wxTextCtrl:setSelection/3.

Note: this is currently only implemented for Windows and generic versions of the control.

setValue/2

-spec setValue(This, Value) -> ok when This :: wxSpinCtrl(), Value :: integer();
              (This, Text) -> ok when This :: wxSpinCtrl(), Text :: unicode:chardata().

Sets the value of the spin control.

It is recommended to use the overload taking an integer value instead.

Notice that, unlike wxTextCtrl:setValue/2, but like most of the other setter methods in wxWidgets, calling this method does not generate any events as events are only generated for the user actions.

wxSpinEvent

This event class is used for the events generated by wxSpinButton and wxSpinCtrl.

See:

wxSpinButton

wxSpinCtrl

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxSpinEvent

Events

Use wxEvtHandler:connect/3 with wxSpinEventType to subscribe to events of this type.

Summary

Types

wxSpin()

wxSpinEvent()

wxSpinEventType()

Functions

getPosition(This)

Retrieve the current spin button or control value.

setPosition(This, Pos)

Set the value associated with the event.

Types

wxSpin()

-type wxSpin() :: #wxSpin{type :: wxSpinEvent:wxSpinEventType(), commandInt :: integer()}.

wxSpinEvent()

-type wxSpinEvent() :: wx:wx_object().

wxSpinEventType()

-type wxSpinEventType() :: command_spinctrl_updated | spin_up | spin_down | spin.

Functions

getPosition(This)

-spec getPosition(This) -> integer() when This :: wxSpinEvent().

Retrieve the current spin button or control value.

setPosition(This, Pos)

-spec setPosition(This, Pos) -> ok when This :: wxSpinEvent(), Pos :: integer().

Set the value associated with the event.

wxSplashScreen

wxSplashScreen shows a window with a thin border, displaying a bitmap describing your application.

Show it in application initialisation, and then either explicitly destroy it or let it time-out.

Example usage:

This class is derived, and can use functions, from:

wxFrame

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxSplashScreen

Summary

Types

wxSplashScreen()

Functions

destroy(This)

Destroys the object

getSplashStyle(This)

Returns the splash style (see new/6 for details).

getTimeout(This)

Returns the timeout in milliseconds.

new(Bitmap, SplashStyle, Milliseconds, Parent, Id)

Equivalent to new(Bitmap, SplashStyle, Milliseconds, Parent, Id, []).

new/6

Construct the splash screen passing a bitmap, a style, a timeout, a window id, optional position and size, and a window style.

Types

wxSplashScreen()

-type wxSplashScreen() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxSplashScreen()) -> ok.

Destroys the object

getSplashStyle(This)

-spec getSplashStyle(This) -> integer() when This :: wxSplashScreen().

Returns the splash style (see new/6 for details).

getTimeout(This)

-spec getTimeout(This) -> integer() when This :: wxSplashScreen().

Returns the timeout in milliseconds.

new(Bitmap, SplashStyle, Milliseconds, Parent, Id)

-spec new(Bitmap, SplashStyle, Milliseconds, Parent, Id) -> wxSplashScreen()
             when
                 Bitmap :: wxBitmap:wxBitmap(),
                 SplashStyle :: integer(),
                 Milliseconds :: integer(),
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer().

Equivalent to new(Bitmap, SplashStyle, Milliseconds, Parent, Id, []).

new/6

-spec new(Bitmap, SplashStyle, Milliseconds, Parent, Id, [Option]) -> wxSplashScreen()
             when
                 Bitmap :: wxBitmap:wxBitmap(),
                 SplashStyle :: integer(),
                 Milliseconds :: integer(),
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Construct the splash screen passing a bitmap, a style, a timeout, a window id, optional position and size, and a window style.

splashStyle is a bitlist of some of the following:

wxSPLASH_CENTRE_ON_PARENT

wxSPLASH_CENTRE_ON_SCREEN

wxSPLASH_NO_CENTRE

wxSPLASH_TIMEOUT

wxSPLASH_NO_TIMEOUT

milliseconds is the timeout in milliseconds.

wxSplitterEvent

This class represents the events generated by a splitter control.

Also there is only one event class, the data associated to the different events is not the same and so not all accessor functions may be called for each event. The documentation mentions the kind of event(s) for which the given accessor function makes sense: calling it for other types of events will result in assert failure (in debug mode) and will return meaningless results.

See:

wxSplitterWindow

Overview events

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxSplitterEvent

Events

Use wxEvtHandler:connect/3 with wxSplitterEventType to subscribe to events of this type.

Summary

Types

wxSplitter()

wxSplitterEvent()

wxSplitterEventType()

Functions

getSashPosition(This)

Returns the new sash position.

getWindowBeingRemoved(This)

Returns a pointer to the window being removed when a splitter window is unsplit.

getX(This)

Returns the x coordinate of the double-click point.

getY(This)

Returns the y coordinate of the double-click point.

setSashPosition(This, Pos)

In the case of wxEVT\_SPLITTER\_SASH\_POS\_CHANGED events, sets the new sash position.

Types

wxSplitter()

-type wxSplitter() :: #wxSplitter{type :: wxSplitterEvent:wxSplitterEventType()}.

wxSplitterEvent()

-type wxSplitterEvent() :: wx:wx_object().

wxSplitterEventType()

-type wxSplitterEventType() ::
          command_splitter_sash_pos_changed | command_splitter_sash_pos_changing |
          command_splitter_doubleclicked | command_splitter_unsplit.

Functions

getSashPosition(This)

-spec getSashPosition(This) -> integer() when This :: wxSplitterEvent().

Returns the new sash position.

May only be called while processing wxEVT_SPLITTER_SASH_POS_CHANGING and wxEVT_SPLITTER_SASH_POS_CHANGED events.

getWindowBeingRemoved(This)

-spec getWindowBeingRemoved(This) -> wxWindow:wxWindow() when This :: wxSplitterEvent().

Returns a pointer to the window being removed when a splitter window is unsplit.

May only be called while processing wxEVT_SPLITTER_UNSPLIT events.

getX(This)

-spec getX(This) -> integer() when This :: wxSplitterEvent().

Returns the x coordinate of the double-click point.

May only be called while processing wxEVT_SPLITTER_DOUBLECLICKED events.

getY(This)

-spec getY(This) -> integer() when This :: wxSplitterEvent().

Returns the y coordinate of the double-click point.

May only be called while processing wxEVT_SPLITTER_DOUBLECLICKED events.

setSashPosition(This, Pos)

-spec setSashPosition(This, Pos) -> ok when This :: wxSplitterEvent(), Pos :: integer().

In the case of wxEVT\_SPLITTER\_SASH\_POS\_CHANGED events, sets the new sash position.

In the case of wxEVT_SPLITTER_SASH_POS_CHANGING events, sets the new tracking bar position so visual feedback during dragging will represent that change that will actually take place. Set to -1 from the event handler code to prevent repositioning.

May only be called while processing wxEVT_SPLITTER_SASH_POS_CHANGING and wxEVT_SPLITTER_SASH_POS_CHANGED events.

wxSplitterWindow

This class manages up to two subwindows.

The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the wxSplitterWindow user interface.

Styles

This class supports the following styles:

wxSP_3D: Draws a 3D effect border and sash.

wxSP_THIN_SASH: Draws a thin sash.

wxSP_3DSASH: Draws a 3D effect sash (part of default style).

wxSP_3DBORDER: Synonym for wxSP_BORDER.

wxSP_BORDER: Draws a standard border.

wxSP_NOBORDER: No border (default).

wxSP_NO_XP_THEME: Under Windows, switches off the attempt to draw the splitter using Windows theming, so the borders and sash will take on the pre-XP look.

wxSP_PERMIT_UNSPLIT: Always allow to unsplit, even with the minimum pane size other than zero.

wxSP_LIVE_UPDATE: Don't draw XOR line but resize the child windows immediately.

See:

wxSplitterEvent

Overview splitterwindow

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxSplitterWindow

Events

Event types emitted from this class:

command_splitter_sash_pos_changing

command_splitter_sash_pos_changed

command_splitter_unsplit

Summary

Types

wxSplitterWindow()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creation function, for two-step construction.

destroy(This)

Destroys the object

getMinimumPaneSize(This)

Returns the current minimum pane size (defaults to zero).

getSashGravity(This)

Returns the current sash gravity.

getSashPosition(This)

Returns the current sash position.

getSplitMode(This)

Gets the split mode.

getWindow1(This)

Returns the left/top or only pane.

getWindow2(This)

Returns the right/bottom pane.

initialize(This, Window)

Initializes the splitter window to have one pane.

isSplit(This)

Returns true if the window is split, false otherwise.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor for creating the window.

replaceWindow(This, WinOld, WinNew)

This function replaces one of the windows managed by the wxSplitterWindow with another one.

setMinimumPaneSize(This, PaneSize)

Sets the minimum pane size.

setSashGravity(This, Gravity)

Sets the sash gravity.

setSashPosition(This, Position)

Equivalent to setSashPosition(This, Position, []).

setSashPosition/3

Sets the sash position.

setSplitMode(This, Mode)

Sets the split mode.

splitHorizontally(This, Window1, Window2)

Equivalent to splitHorizontally(This, Window1, Window2, []).

splitHorizontally/4

Initializes the top and bottom panes of the splitter window.

splitVertically(This, Window1, Window2)

Equivalent to splitVertically(This, Window1, Window2, []).

splitVertically/4

Initializes the left and right panes of the splitter window.

unsplit(This)

Equivalent to unsplit(This, []).

unsplit/2

Unsplits the window.

updateSize(This)

Causes any pending sizing of the sash and child panes to take place immediately.

Types

wxSplitterWindow()

-type wxSplitterWindow() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxSplitterWindow(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxSplitterWindow(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creation function, for two-step construction.

See new/2 for details.

destroy(This)

-spec destroy(This :: wxSplitterWindow()) -> ok.

Destroys the object

getMinimumPaneSize(This)

-spec getMinimumPaneSize(This) -> integer() when This :: wxSplitterWindow().

Returns the current minimum pane size (defaults to zero).

See: setMinimumPaneSize/2

getSashGravity(This)

-spec getSashGravity(This) -> number() when This :: wxSplitterWindow().

Returns the current sash gravity.

See: setSashGravity/2

getSashPosition(This)

-spec getSashPosition(This) -> integer() when This :: wxSplitterWindow().

Returns the current sash position.

See: setSashPosition/3

getSplitMode(This)

-spec getSplitMode(This) -> wx:wx_enum() when This :: wxSplitterWindow().

Gets the split mode.

See:

setSplitMode/2

splitVertically/4

splitHorizontally/4

getWindow1(This)

-spec getWindow1(This) -> wxWindow:wxWindow() when This :: wxSplitterWindow().

Returns the left/top or only pane.

getWindow2(This)

-spec getWindow2(This) -> wxWindow:wxWindow() when This :: wxSplitterWindow().

Returns the right/bottom pane.

initialize(This, Window)

-spec initialize(This, Window) -> ok when This :: wxSplitterWindow(), Window :: wxWindow:wxWindow().

Initializes the splitter window to have one pane.

The child window is shown if it is currently hidden.

Remark: This should be called if you wish to initially view only a single pane in the splitter window.

See:

splitVertically/4

splitHorizontally/4

isSplit(This)

-spec isSplit(This) -> boolean() when This :: wxSplitterWindow().

Returns true if the window is split, false otherwise.

new()

-spec new() -> wxSplitterWindow().

Default constructor.

new(Parent)

-spec new(Parent) -> wxSplitterWindow() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxSplitterWindow()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor for creating the window.

Remark: After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one of initialize/2, splitVertically/4 and splitHorizontally/4 in order to set the pane(s). You can create two windows, with one hidden when not being shown; or you can create and delete the second pane on demand.

See:

initialize/2

splitVertically/4

splitHorizontally/4

create/3

replaceWindow(This, WinOld, WinNew)

-spec replaceWindow(This, WinOld, WinNew) -> boolean()
                       when
                           This :: wxSplitterWindow(),
                           WinOld :: wxWindow:wxWindow(),
                           WinNew :: wxWindow:wxWindow().

This function replaces one of the windows managed by the wxSplitterWindow with another one.

It is in general better to use it instead of calling unsplit/2 and then resplitting the window back because it will provoke much less flicker (if any). It is valid to call this function whether the splitter has two windows or only one.

Both parameters should be non-NULL and winOld must specify one of the windows managed by the splitter. If the parameters are incorrect or the window couldn't be replaced, false is returned. Otherwise the function will return true, but please notice that it will not delete the replaced window and you may wish to do it yourself.

See: getMinimumPaneSize/1

setMinimumPaneSize(This, PaneSize)

-spec setMinimumPaneSize(This, PaneSize) -> ok when This :: wxSplitterWindow(), PaneSize :: integer().

Sets the minimum pane size.

Remark: The default minimum pane size is zero, which means that either pane can be reduced to zero by dragging the sash, thus removing one of the panes. To prevent this behaviour (and veto out-of-range sash dragging), set a minimum size, for example 20 pixels. If the wxSP_PERMIT_UNSPLIT style is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero.

See: getMinimumPaneSize/1

setSashGravity(This, Gravity)

-spec setSashGravity(This, Gravity) -> ok when This :: wxSplitterWindow(), Gravity :: number().

Sets the sash gravity.

Remark: Gravity is real factor which controls position of sash while resizing wxSplitterWindow. Gravity tells wxSplitterWindow how much will left/top window grow while resizing. Example values:

0.0: only the bottom/right window is automatically resized

0.5: both windows grow by equal size

1.0: only left/top window grows Gravity should be a real value between 0.0 and 1.0. Default value of sash gravity is 0.0. That value is compatible with previous (before gravity was introduced) behaviour of wxSplitterWindow.

Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using wxWindow:setSize/6 to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating wxSplitterWindow in the splitter sample for more details.

See: getSashGravity/1

setSashPosition(This, Position)

-spec setSashPosition(This, Position) -> ok when This :: wxSplitterWindow(), Position :: integer().

Equivalent to setSashPosition(This, Position, []).

setSashPosition/3

-spec setSashPosition(This, Position, [Option]) -> ok
                         when
                             This :: wxSplitterWindow(),
                             Position :: integer(),
                             Option :: {redraw, boolean()}.

Sets the sash position.

Remark: Does not currently check for an out-of-range value.

See: getSashPosition/1

setSplitMode(This, Mode)

-spec setSplitMode(This, Mode) -> ok when This :: wxSplitterWindow(), Mode :: integer().

Sets the split mode.

Remark: Only sets the internal variable; does not update the display.

See:

getSplitMode/1

splitVertically/4

splitHorizontally/4

splitHorizontally(This, Window1, Window2)

-spec splitHorizontally(This, Window1, Window2) -> boolean()
                           when
                               This :: wxSplitterWindow(),
                               Window1 :: wxWindow:wxWindow(),
                               Window2 :: wxWindow:wxWindow().

Equivalent to splitHorizontally(This, Window1, Window2, []).

splitHorizontally/4

-spec splitHorizontally(This, Window1, Window2, [Option]) -> boolean()
                           when
                               This :: wxSplitterWindow(),
                               Window1 :: wxWindow:wxWindow(),
                               Window2 :: wxWindow:wxWindow(),
                               Option :: {sashPosition, integer()}.

Initializes the top and bottom panes of the splitter window.

The child windows are shown if they are currently hidden.

Return: true if successful, false otherwise (the window was already split).

Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.

See:

splitVertically/4

isSplit/1

unsplit/2

splitVertically(This, Window1, Window2)

-spec splitVertically(This, Window1, Window2) -> boolean()
                         when
                             This :: wxSplitterWindow(),
                             Window1 :: wxWindow:wxWindow(),
                             Window2 :: wxWindow:wxWindow().

Equivalent to splitVertically(This, Window1, Window2, []).

splitVertically/4

-spec splitVertically(This, Window1, Window2, [Option]) -> boolean()
                         when
                             This :: wxSplitterWindow(),
                             Window1 :: wxWindow:wxWindow(),
                             Window2 :: wxWindow:wxWindow(),
                             Option :: {sashPosition, integer()}.

Initializes the left and right panes of the splitter window.

The child windows are shown if they are currently hidden.

Return: true if successful, false otherwise (the window was already split).

Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.

See:

splitHorizontally/4

isSplit/1

unsplit/2

unsplit(This)

-spec unsplit(This) -> boolean() when This :: wxSplitterWindow().

Equivalent to unsplit(This, []).

unsplit/2

-spec unsplit(This, [Option]) -> boolean()
                 when This :: wxSplitterWindow(), Option :: {toRemove, wxWindow:wxWindow()}.

Unsplits the window.

Return: true if successful, false otherwise (the window was not split).

Remark: This call will not actually delete the pane being removed; it calls OnUnsplit() (not implemented in wx) which can be overridden for the desired behaviour. By default, the pane being removed is hidden.

See:

splitHorizontally/4

splitVertically/4

isSplit/1

updateSize(This)

-spec updateSize(This) -> ok when This :: wxSplitterWindow().

Causes any pending sizing of the sash and child panes to take place immediately.

Such resizing normally takes place in idle time, in order to wait for layout to be completed. However, this can cause unacceptable flicker as the panes are resized after the window has been shown. To work around this, you can perform window layout (for example by sending a size event to the parent window), and then call this function, before showing the top-level window.

wxStaticBitmap

A static bitmap control displays a bitmap.

Native implementations on some platforms are only meant for display of the small icons in the dialog boxes.

If you want to display larger images portably, you may use generic implementation wxGenericStaticBitmap declared in <wx/generic/statbmpg.h>.

Notice that for the best results, the size of the control should be the same as the size of the image displayed in it, as happens by default if it's not resized explicitly. Otherwise, behaviour depends on the platform: under MSW, the bitmap is drawn centred inside the control, while elsewhere it is drawn at the origin of the control. You can use SetScaleMode() (not implemented in wx) to control how the image is scaled inside the control.

See: wxBitmap

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxStaticBitmap

Summary

Types

wxStaticBitmap()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creation function, for two-step construction.

destroy(This)

Destroys the object

getBitmap(This)

Returns the bitmap currently used in the control.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a static bitmap control.

setBitmap(This, Label)

Sets the bitmap label.

Types

wxStaticBitmap()

-type wxStaticBitmap() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxStaticBitmap(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: wxBitmap:wxBitmap().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxStaticBitmap(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: wxBitmap:wxBitmap(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creation function, for two-step construction.

For details see new/4.

destroy(This)

-spec destroy(This :: wxStaticBitmap()) -> ok.

Destroys the object

getBitmap(This)

-spec getBitmap(This) -> wxBitmap:wxBitmap() when This :: wxStaticBitmap().

Returns the bitmap currently used in the control.

Notice that this method can be called even if SetIcon() (not implemented in wx) had been used.

See: setBitmap/2

new()

-spec new() -> wxStaticBitmap().

Default constructor.

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxStaticBitmap()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxStaticBitmap()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: wxBitmap:wxBitmap(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating and showing a static bitmap control.

See: create/5

setBitmap(This, Label)

-spec setBitmap(This, Label) -> ok when This :: wxStaticBitmap(), Label :: wxBitmap:wxBitmap().

Sets the bitmap label.

See: getBitmap/1

wxStaticBox

A static box is a rectangle drawn around other windows to denote a logical grouping of items.

Note that while the previous versions required that windows appearing inside a static box be created as its siblings (i.e. use the same parent as the static box itself), since wxWidgets 2.9.1 it is also possible to create them as children of wxStaticBox itself and you are actually encouraged to do it like this if compatibility with the previous versions is not important.

So the new recommended way to create static box is:

While the compatible - and now deprecated - way is

Also note that there is a specialized wxSizer class (wxStaticBoxSizer) which can be used as an easier way to pack items into a static box.

See:

wxStaticText

wxStaticBoxSizer

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxStaticBox

Summary

Types

wxStaticBox()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creates the static box for two-step construction.

destroy(This)

Destroys the object

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a static box.

Types

wxStaticBox()

-type wxStaticBox() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxStaticBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxStaticBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates the static box for two-step construction.

See new/4 for further details.

destroy(This)

-spec destroy(This :: wxStaticBox()) -> ok.

Destroys the object

new()

-spec new() -> wxStaticBox().

Default constructor.

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxStaticBox()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxStaticBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating and showing a static box.

See: create/5

wxStaticBoxSizer

wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static box around the sizer.

The static box may be either created independently or the sizer may create it itself as a convenience. In any case, the sizer owns the wxStaticBox control and will delete it in the wxStaticBoxSizer destructor.

Note that since wxWidgets 2.9.1 you are encouraged to create the windows which are added to wxStaticBoxSizer as children of wxStaticBox itself, see this class documentation for more details.

Example of use of this class:

See:

wxSizer

wxStaticBox

wxBoxSizer

Overview sizer

This class is derived, and can use functions, from:

wxBoxSizer

wxSizer

wxWidgets docs: wxStaticBoxSizer

Summary

Types

wxStaticBoxSizer()

Functions

destroy(This)

Destroys the object

getStaticBox(This)

Returns the static box associated with the sizer.

new/2

This constructor uses an already existing static box.

new/3

This constructor creates a new static box with the given label and parent window.

Types

wxStaticBoxSizer()

-type wxStaticBoxSizer() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxStaticBoxSizer()) -> ok.

Destroys the object

getStaticBox(This)

-spec getStaticBox(This) -> wxStaticBox:wxStaticBox() when This :: wxStaticBoxSizer().

Returns the static box associated with the sizer.

new/2

-spec new(Orient, Parent) -> wxStaticBoxSizer() when Orient :: integer(), Parent :: wxWindow:wxWindow();
         (Box, Orient) -> wxStaticBoxSizer() when Box :: wxStaticBox:wxStaticBox(), Orient :: integer().

This constructor uses an already existing static box.

new/3

-spec new(Orient, Parent, [Option]) -> wxStaticBoxSizer()
             when
                 Orient :: integer(),
                 Parent :: wxWindow:wxWindow(),
                 Option :: {label, unicode:chardata()}.

This constructor creates a new static box with the given label and parent window.

wxStaticLine

A static line is just a line which may be used in a dialog to separate the groups of controls.

The line may be only vertical or horizontal. Moreover, not all ports (notably not wxGTK) support specifying the transversal direction of the line (e.g. height for a horizontal line) so for maximal portability you should specify it as wxDefaultCoord.

Styles

This class supports the following styles:

wxLI_HORIZONTAL: Creates a horizontal line.

wxLI_VERTICAL: Creates a vertical line.

See: wxStaticBox

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxStaticLine

Summary

Types

wxStaticLine()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creates the static line for two-step construction.

destroy(This)

Destroys the object

getDefaultSize()

This static function returns the size which will be given to the smaller dimension of the static line, i.e.

isVertical(This)

Returns true if the line is vertical, false if horizontal.

new()

Default constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor, creating and showing a static line.

Types

wxStaticLine()

-type wxStaticLine() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxStaticLine(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxStaticLine(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates the static line for two-step construction.

See new/2 for further details.

destroy(This)

-spec destroy(This :: wxStaticLine()) -> ok.

Destroys the object

getDefaultSize()

-spec getDefaultSize() -> integer().

This static function returns the size which will be given to the smaller dimension of the static line, i.e.

its height for a horizontal line or its width for a vertical one.

isVertical(This)

-spec isVertical(This) -> boolean() when This :: wxStaticLine().

Returns true if the line is vertical, false if horizontal.

new()

-spec new() -> wxStaticLine().

Default constructor.

new(Parent)

-spec new(Parent) -> wxStaticLine() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxStaticLine()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating and showing a static line.

See: create/3

wxStaticText

A static text control displays one or more lines of read-only text.

wxStaticText supports the three classic text alignments, label ellipsization i.e. replacing parts of the text with the ellipsis ("...") if the label doesn't fit into the provided space and also formatting markup with wxControl::SetLabelMarkup() (not implemented in wx).

Styles

This class supports the following styles:

wxALIGN_LEFT: Align the text to the left.

wxALIGN_RIGHT: Align the text to the right.

wxALIGN_CENTRE_HORIZONTAL: Center the text (horizontally).

wxST_NO_AUTORESIZE: By default, the control will adjust its size to exactly fit to the size of the text when setLabel/2 is called. If this style flag is given, the control will not change its size (this style is especially useful with controls which also have the wxALIGN_RIGHT or the wxALIGN_CENTRE_HORIZONTAL style because otherwise they won't make sense any longer after a call to setLabel/2).

wxST_ELLIPSIZE_START: If the labeltext width exceeds the control width, replace the beginning of the label with an ellipsis; uses wxControl::Ellipsize (not implemented in wx).

wxST_ELLIPSIZE_MIDDLE: If the label text width exceeds the control width, replace the middle of the label with an ellipsis; uses wxControl::Ellipsize (not implemented in wx).

wxST_ELLIPSIZE_END: If the label text width exceeds the control width, replace the end of the label with an ellipsis; uses wxControl::Ellipsize (not implemented in wx).

See:

wxStaticBitmap

wxStaticBox

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxStaticText

Summary

Types

wxStaticText()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creation function, for two-step construction.

destroy(This)

Destroys the object

getLabel(This)

Returns the control's label, as it was passed to wxControl:setLabel/2.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a text control.

setLabel(This, Label)

Change the label shown in the control.

wrap(This, Width)

This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long).

Types

wxStaticText()

-type wxStaticText() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxStaticText(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxStaticText(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creation function, for two-step construction.

For details see new/4.

destroy(This)

-spec destroy(This :: wxStaticText()) -> ok.

Destroys the object

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxStaticText().

Returns the control's label, as it was passed to wxControl:setLabel/2.

Note that the returned string may contains mnemonics ("&" characters) if they were passed to the wxControl:setLabel/2 function; use GetLabelText() (not implemented in wx) if they are undesired.

Also note that the returned string is always the string which was passed to wxControl:setLabel/2 but may be different from the string passed to SetLabelText() (not implemented in wx) (since this last one escapes mnemonic characters).

new()

-spec new() -> wxStaticText().

Default constructor.

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxStaticText()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxStaticText()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructor, creating and showing a text control.

See: create/5

setLabel(This, Label)

-spec setLabel(This, Label) -> ok when This :: wxStaticText(), Label :: unicode:chardata().

Change the label shown in the control.

Notice that since wxWidgets 3.1.1 this function is guaranteed not to do anything if the label didn't really change, so there is no benefit to checking if the new label is different from the current one in the application code.

See: wxControl:setLabel/2

wrap(This, Width)

-spec wrap(This, Width) -> ok when This :: wxStaticText(), Width :: integer().

This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long).

If width is negative, no wrapping is done. Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the controls border style) may be added.

Since: 2.6.2

wxStatusBar

A status bar is a narrow window that can be placed along the bottom of a frame to give small amounts of status information.

It can contain one or more fields, one or more of which can be variable length according to the size of the window.

wxStatusBar also maintains an independent stack of status texts for each field (see pushStatusText/3 and popStatusText/2).

Note that in wxStatusBar context, the terms pane and field are synonyms.

Styles

This class supports the following styles:

wxSTB_SIZEGRIP: Displays a gripper at the right-hand side of the status bar which can be used to resize the parent window.

wxSTB_SHOW_TIPS: Displays tooltips for those panes whose status text has been ellipsized/truncated because the status text doesn't fit the pane width. Note that this style has effect only on wxGTK (with GTK+ >= 2.12) currently.

wxSTB_ELLIPSIZE_START: Replace the beginning of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (uses wxControl::Ellipsize (not implemented in wx)).

wxSTB_ELLIPSIZE_MIDDLE: Replace the middle of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (uses wxControl::Ellipsize (not implemented in wx)).

wxSTB_ELLIPSIZE_END: Replace the end of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (uses wxControl::Ellipsize (not implemented in wx)).

wxSTB_DEFAULT_STYLE: The default style: includes wxSTB_SIZEGRIP|wxSTB_SHOW_TIPS|wxSTB_ELLIPSIZE_END|wxFULL_REPAINT_ON_RESIZE.

Remark: It is possible to create controls and other windows on the status bar. Position these windows from an OnSize() event handler.

Remark: Notice that only the first 127 characters of a string will be shown in status bar fields under Windows if a proper manifest indicating that the program uses version 6 of common controls library is not used. This is a limitation of the native control on these platforms.

See:

wxFrame

Examples

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxStatusBar

Summary

Types

wxStatusBar()

Functions

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creates the window, for two-step construction.

destroy(This)

Destroys the object

getFieldRect(This, I)

Returns the size and position of a field's internal bounding rectangle.

getFieldsCount(This)

Returns the number of fields in the status bar.

getStatusText(This)

Equivalent to getStatusText(This, []).

getStatusText/2

Returns the string associated with a status bar field.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor, creating the window.

popStatusText(This)

Equivalent to popStatusText(This, []).

popStatusText/2

Restores the text to the value it had before the last call to pushStatusText/3.

pushStatusText(This, String)

Equivalent to pushStatusText(This, String, []).

pushStatusText/3

Saves the current field text in a per-field stack, and sets the field text to the string passed as argument.

setFieldsCount(This, Number)

Equivalent to setFieldsCount(This, Number, []).

setFieldsCount/3

Sets the number of fields, and optionally the field widths.

setMinHeight(This, Height)

Sets the minimal possible height for the status bar.

setStatusStyles(This, Styles)

Sets the styles of the fields in the status line which can make fields appear flat or raised instead of the standard sunken 3D border.

setStatusText(This, Text)

Equivalent to setStatusText(This, Text, []).

setStatusText/3

Sets the status text for the i-th field.

setStatusWidths(This, Widths_field)

Sets the widths of the fields in the status line.

Types

wxStatusBar()

-type wxStatusBar() :: wx:wx_object().

Functions

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxStatusBar(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxStatusBar(),
                    Parent :: wxWindow:wxWindow(),
                    Option :: {winid, integer()} | {style, integer()}.

Creates the window, for two-step construction.

See new/2 for details.

destroy(This)

-spec destroy(This :: wxStatusBar()) -> ok.

Destroys the object

getFieldRect(This, I)

-spec getFieldRect(This, I) -> Result
                      when
                          Result ::
                              {Res :: boolean(),
                               Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}},
                          This :: wxStatusBar(),
                          I :: integer().

Returns the size and position of a field's internal bounding rectangle.

Return: true if the field index is valid, false otherwise.

See: {X,Y,W,H}

getFieldsCount(This)

-spec getFieldsCount(This) -> integer() when This :: wxStatusBar().

Returns the number of fields in the status bar.

getStatusText(This)

-spec getStatusText(This) -> unicode:charlist() when This :: wxStatusBar().

Equivalent to getStatusText(This, []).

getStatusText/2

-spec getStatusText(This, [Option]) -> unicode:charlist()
                       when This :: wxStatusBar(), Option :: {number, integer()}.

Returns the string associated with a status bar field.

Return: The status field string if the field is valid, otherwise the empty string.

See: setStatusText/3

new()

-spec new() -> wxStatusBar().

Default ctor.

new(Parent)

-spec new(Parent) -> wxStatusBar() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxStatusBar()
             when Parent :: wxWindow:wxWindow(), Option :: {winid, integer()} | {style, integer()}.

Constructor, creating the window.

See: create/3

popStatusText(This)

-spec popStatusText(This) -> ok when This :: wxStatusBar().

Equivalent to popStatusText(This, []).

popStatusText/2

-spec popStatusText(This, [Option]) -> ok when This :: wxStatusBar(), Option :: {number, integer()}.

Restores the text to the value it had before the last call to pushStatusText/3.

Notice that if setStatusText/3 had been called in the meanwhile, popStatusText/2 will not change the text, i.e. it does not override explicit changes to status text but only restores the saved text if it hadn't been changed since.

See: pushStatusText/3

pushStatusText(This, String)

-spec pushStatusText(This, String) -> ok when This :: wxStatusBar(), String :: unicode:chardata().

Equivalent to pushStatusText(This, String, []).

pushStatusText/3

-spec pushStatusText(This, String, [Option]) -> ok
                        when
                            This :: wxStatusBar(),
                            String :: unicode:chardata(),
                            Option :: {number, integer()}.

Saves the current field text in a per-field stack, and sets the field text to the string passed as argument.

See: popStatusText/2

setFieldsCount(This, Number)

-spec setFieldsCount(This, Number) -> ok when This :: wxStatusBar(), Number :: integer().

Equivalent to setFieldsCount(This, Number, []).

setFieldsCount/3

-spec setFieldsCount(This, Number, [Option]) -> ok
                        when This :: wxStatusBar(), Number :: integer(), Option :: {widths, [integer()]}.

Sets the number of fields, and optionally the field widths.

setMinHeight(This, Height)

-spec setMinHeight(This, Height) -> ok when This :: wxStatusBar(), Height :: integer().

Sets the minimal possible height for the status bar.

The real height may be bigger than the height specified here depending on the size of the font used by the status bar.

setStatusStyles(This, Styles)

-spec setStatusStyles(This, Styles) -> ok when This :: wxStatusBar(), Styles :: [integer()].

Sets the styles of the fields in the status line which can make fields appear flat or raised instead of the standard sunken 3D border.

setStatusText(This, Text)

-spec setStatusText(This, Text) -> ok when This :: wxStatusBar(), Text :: unicode:chardata().

Equivalent to setStatusText(This, Text, []).

setStatusText/3

-spec setStatusText(This, Text, [Option]) -> ok
                       when
                           This :: wxStatusBar(),
                           Text :: unicode:chardata(),
                           Option :: {number, integer()}.

Sets the status text for the i-th field.

The given text will replace the current text. The display of the status bar is updated immediately, so there is no need to call wxWindow:update/1 after calling this function.

Note that if pushStatusText/3 had been called before the new text will also replace the last saved value to make sure that the next call to popStatusText/2 doesn't restore the old value, which was overwritten by the call to this function.

See:

getStatusText/2

wxFrame:setStatusText/3

setStatusWidths(This, Widths_field)

-spec setStatusWidths(This, Widths_field) -> ok when This :: wxStatusBar(), Widths_field :: [integer()].

Sets the widths of the fields in the status line.

There are two types of fields: fixed widths and variable width fields. For the fixed width fields you should specify their (constant) width in pixels. For the variable width fields, specify a negative number which indicates how the field should expand: the space left for all variable width fields is divided between them according to the absolute value of this number. A variable width field with width of -2 gets twice as much of it as a field with width -1 and so on.

For example, to create one fixed width field of width 100 in the right part of the status bar and two more fields which get 66% and 33% of the remaining space correspondingly, you should use an array containing -2, -1 and 100.

Remark: The widths of the variable fields are calculated from the total width of all fields, minus the sum of widths of the non-variable fields, divided by the number of variable fields.

See:

setFieldsCount/3

wxFrame:setStatusWidths/2

wxStdDialogButtonSizer

This class creates button layouts which conform to the standard button spacing and ordering defined by the platform or toolkit's user interface guidelines (if such things exist).

By using this class, you can ensure that all your standard dialogs look correct on all major platforms. Currently it conforms to the Windows, GTK+ and macOS human interface guidelines.

When there aren't interface guidelines defined for a particular platform or toolkit, wxStdDialogButtonSizer reverts to the Windows implementation.

To use this class, first add buttons to the sizer by calling addButton/2 (or setAffirmativeButton/2, setNegativeButton/2 or setCancelButton/2) and then call Realize in order to create the actual button layout used. Other than these special operations, this sizer works like any other sizer.

If you add a button with wxID_SAVE, on macOS the button will be renamed to "Save" and the wxID_NO button will be renamed to "Don't Save" in accordance with the macOS Human Interface Guidelines.

See:

wxSizer

Overview sizer

wxDialog:createButtonSizer/2

This class is derived, and can use functions, from:

wxBoxSizer

wxSizer

wxWidgets docs: wxStdDialogButtonSizer

Summary

Types

wxStdDialogButtonSizer()

Functions

addButton(This, Button)

Adds a button to the wxStdDialogButtonSizer.

destroy(This)

Destroys the object

new()

Constructor for a wxStdDialogButtonSizer.

realize(This)

Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit's interface guidelines.

setAffirmativeButton(This, Button)

Sets the affirmative button for the sizer.

setCancelButton(This, Button)

Sets the cancel button for the sizer.

setNegativeButton(This, Button)

Sets the negative button for the sizer.

Types

wxStdDialogButtonSizer()

-type wxStdDialogButtonSizer() :: wx:wx_object().

Functions

addButton(This, Button)

-spec addButton(This, Button) -> ok when This :: wxStdDialogButtonSizer(), Button :: wxButton:wxButton().

Adds a button to the wxStdDialogButtonSizer.

The button must have one of the following identifiers:

wxID_OK

wxID_YES

wxID_SAVE

wxID_APPLY

wxID_CLOSE

wxID_NO

wxID_CANCEL

wxID_HELP

wxID_CONTEXT_HELP

destroy(This)

-spec destroy(This :: wxStdDialogButtonSizer()) -> ok.

Destroys the object

new()

-spec new() -> wxStdDialogButtonSizer().

Constructor for a wxStdDialogButtonSizer.

realize(This)

-spec realize(This) -> ok when This :: wxStdDialogButtonSizer().

Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit's interface guidelines.

setAffirmativeButton(This, Button)

-spec setAffirmativeButton(This, Button) -> ok
                              when This :: wxStdDialogButtonSizer(), Button :: wxButton:wxButton().

Sets the affirmative button for the sizer.

This allows you to use identifiers other than the standard identifiers outlined above.

setCancelButton(This, Button)

-spec setCancelButton(This, Button) -> ok
                         when This :: wxStdDialogButtonSizer(), Button :: wxButton:wxButton().

Sets the cancel button for the sizer.

This allows you to use identifiers other than the standard identifiers outlined above.

setNegativeButton(This, Button)

-spec setNegativeButton(This, Button) -> ok
                           when This :: wxStdDialogButtonSizer(), Button :: wxButton:wxButton().

Sets the negative button for the sizer.

This allows you to use identifiers other than the standard identifiers outlined above.

wxStyledTextCtrl

A wxWidgets implementation of the Scintilla source code editing component.

As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips.

The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts.

wxStyledTextCtrl is a 1 to 1 mapping of "raw" scintilla interface, whose documentation can be found in the Scintilla website (http://www.scintilla.org/).

Please see wxStyledTextEvent for the documentation of all event types you can use with wxStyledTextCtrl.

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxStyledTextCtrl

Summary

Types

wxStyledTextCtrl()

Functions

addText(This, Text)

Add text to the document at current position.

addTextRaw(This, Text)

Equivalent to addTextRaw(This, Text, []).

addTextRaw/3

Add text to the document at current position.

allocate(This, Bytes)

Enlarge the document to a particular size of text bytes.

appendText(This, Text)

Append a string to the end of the document without changing the selection.

appendTextRaw(This, Text)

Equivalent to appendTextRaw(This, Text, []).

appendTextRaw/3

Append a string to the end of the document without changing the selection.

autoCompActive(This)

Is there an auto-completion list visible?

autoCompCancel(This)

Remove the auto-completion list from the screen.

autoCompComplete(This)

User has selected an item so remove the list and insert the selection.

autoCompGetAutoHide(This)

Retrieve whether or not autocompletion is hidden automatically when nothing matches.

autoCompGetCancelAtStart(This)

Retrieve whether auto-completion cancelled by backspacing before start.

autoCompGetChooseSingle(This)

Retrieve whether a single item auto-completion list automatically choose the item.

autoCompGetCurrent(This)

Get currently selected item position in the auto-completion list.

autoCompGetDropRestOfWord(This)

Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.

autoCompGetIgnoreCase(This)

Retrieve state of ignore case flag.

autoCompGetMaxHeight(This)

Set the maximum height, in rows, of auto-completion and user lists.

autoCompGetMaxWidth(This)

Get the maximum width, in characters, of auto-completion and user lists.

autoCompGetSeparator(This)

Retrieve the auto-completion list separator character.

autoCompGetTypeSeparator(This)

Retrieve the auto-completion list type-separator character.

autoCompPosStart(This)

Retrieve the position of the caret when the auto-completion list was displayed.

autoCompSelect(This, Select)

Select the item in the auto-completion list that starts with a string.

autoCompSetAutoHide(This, AutoHide)

Set whether or not autocompletion is hidden automatically when nothing matches.

autoCompSetCancelAtStart(This, Cancel)

Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.

autoCompSetChooseSingle(This, ChooseSingle)

Should a single item auto-completion list automatically choose the item.

autoCompSetDropRestOfWord(This, DropRestOfWord)

Set whether or not autocompletion deletes any word characters after the inserted text upon completion.

autoCompSetFillUps(This, CharacterSet)

Define a set of characters that when typed will cause the autocompletion to choose the selected item.

autoCompSetIgnoreCase(This, IgnoreCase)

Set whether case is significant when performing auto-completion searches.

autoCompSetMaxHeight(This, RowCount)

Set the maximum height, in rows, of auto-completion and user lists.

autoCompSetMaxWidth(This, CharacterCount)

Set the maximum width, in characters, of auto-completion and user lists.

autoCompSetSeparator(This, SeparatorCharacter)

Change the separator character in the string setting up an auto-completion list.

autoCompSetTypeSeparator(This, SeparatorCharacter)

Change the type-separator character in the string setting up an auto-completion list.

autoCompShow(This, LengthEntered, ItemList)

Display a auto-completion list.

autoCompStops(This, CharacterSet)

Define a set of character that when typed cancel the auto-completion list.

backTab(This)

Dedent the selected lines.

beginUndoAction(This)

Start a sequence of actions that is undone and redone as a unit.

braceBadLight(This, Pos)

Highlight the character at a position indicating there is no matching brace.

braceHighlight(This, PosA, PosB)

Highlight the characters at two positions.

braceMatch(This, Pos)

Find the position of a matching brace or wxSTC_INVALID_POSITION if no match.

callTipActive(This)

Is there an active call tip?

callTipCancel(This)

Remove the call tip from the screen.

callTipPosAtStart(This)

Retrieve the position where the caret was before displaying the call tip.

callTipSetBackground(This, Back)

Set the background colour for the call tip.

callTipSetForeground(This, Fore)

Set the foreground colour for the call tip.

callTipSetForegroundHighlight(This, Fore)

Set the foreground colour for the highlighted part of the call tip.

callTipSetHighlight(This, HighlightStart, HighlightEnd)

Highlight a segment of the definition.

callTipShow(This, Pos, Definition)

Show a call tip containing a definition near position pos.

callTipUseStyle(This, TabSize)

Enable use of wxSTC_STYLE_CALLTIP and set call tip tab size in pixels.

cancel(This)

Cancel any modes such as call tip or auto-completion list display.

canPaste(This)

Will a paste succeed?

canRedo(This)

Are there any redoable actions in the undo history?

canUndo(This)

Are there any undoable actions in the undo history?

charLeft(This)

Move caret left one character.

charLeftExtend(This)

Move caret left one character extending selection to new caret position.

charLeftRectExtend(This)

Move caret left one character, extending rectangular selection to new caret position.

charRight(This)

Move caret right one character.

charRightExtend(This)

Move caret right one character extending selection to new caret position.

charRightRectExtend(This)

Move caret right one character, extending rectangular selection to new caret position.

chooseCaretX(This)

Set the last x chosen value to be the caret x position.

clear(This)

Clear the selection.

clearAll(This)

Delete all text in the document.

clearDocumentStyle(This)

Set all style bytes to 0, remove all folding information.

clearRegisteredImages(This)

Clear all the registered images.

cmdKeyAssign(This, Key, Modifiers, Cmd)

When key+modifier combination keyDefinition is pressed perform sciCommand.

cmdKeyClear(This, Key, Modifiers)

When key+modifier combination keyDefinition is pressed do nothing.

cmdKeyClearAll(This)

Drop all key mappings.

cmdKeyExecute(This, Cmd)

Perform one of the operations defined by the wxSTCCMD* constants.

colourise(This, Start, End)

Colourise a segment of the document using the current lexing language.

convertEOLs(This, EolMode)

Convert all line endings in the document to one mode.

copy(This)

Copy the selection to the clipboard.

copyRange(This, Start, End)

Copy a range of text to the clipboard.

copyText(This, Length, Text)

Copy argument text to the clipboard.

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Create the UI elements for a STC that was created with the default ctor.

cut(This)

Cut the selection to the clipboard.

deleteBack(This)

Delete the selection or if no selection, the character before the caret.

deleteBackNotLine(This)

Delete the selection or if no selection, the character before the caret.

delLineLeft(This)

Delete back from the current position to the start of the line.

delLineRight(This)

Delete forwards from the current position to the end of the line.

delWordLeft(This)

Delete the word to the left of the caret.

delWordRight(This)

Delete the word to the right of the caret.

destroy(This)

Destroys the object

docLineFromVisible(This, DisplayLine)

Find the document line of a display line taking hidden lines into account.

documentEnd(This)

Move caret to last position in document.

documentEndExtend(This)

Move caret to last position in document extending selection to new caret position.

documentStart(This)

Move caret to first position in document.

documentStartExtend(This)

Move caret to first position in document extending selection to new caret position.

doDragOver(This, X, Y, DefaultRes)

Allow for simulating a DnD DragOver.

doDropText(This, X, Y, Data)

Allow for simulating a DnD DropText.

editToggleOvertype(This)

Switch from insert to overtype mode or the reverse.

emptyUndoBuffer(This)

Delete the undo history.

endUndoAction(This)

End a sequence of actions that is undone and redone as a unit.

ensureCaretVisible(This)

Ensure the caret is visible.

ensureVisible(This, Line)

Ensure a particular line is visible by expanding any header line hiding it.

ensureVisibleEnforcePolicy(This, Line)

Ensure a particular line is visible by expanding any header line hiding it.

findColumn(This, Line, Column)

Find the position of a column on a line taking into account tabs and multi-byte characters.

findText(This, MinPos, MaxPos, Text)

Equivalent to findText(This, MinPos, MaxPos, Text, []).

findText/5

Find some text in the document. @param minPos The position (starting from zero) in the document at which to begin the search @param maxPos The last position (starting from zero) in the document to which the search will be restricted. @param text The text to search for. @param flags (Optional) The search flags. This should be a bit list containing one or more of the @link wxStyledTextCtrl::wxSTC_FIND_WHOLEWORD wxSTC_FIND_* @endlink constants.

formatRange(This, DoDraw, StartPos, EndPos, Draw, Target, RenderRect, PageRect)

On Windows, will draw the document into a display context such as a printer.

formFeed(This)

Insert a Form Feed character.

getAnchor(This)

Returns the position of the opposite end of the selection to the caret.

getBackSpaceUnIndents(This)

Does a backspace pressed when caret is within indentation unindent?

getBufferedDraw(This)

Is drawing done first into a buffer or direct to the screen?

getCaretForeground(This)

Get the foreground colour of the caret.

getCaretLineBackAlpha(This)

Get the background alpha of the caret line.

getCaretLineBackground(This)

Get the colour of the background of the line containing the caret.

getCaretLineVisible(This)

Is the background of the line containing the caret in a different colour?

getCaretPeriod(This)

Get the time in milliseconds that the caret is on and off.

getCaretSticky(This)

Can the caret preferred x position only be changed by explicit movement commands?

getCaretWidth(This)

Returns the width of the insert mode caret.

getCharAt(This, Pos)

Returns the character byte at the position.

getCodePage(This)

Get the code page used to interpret the bytes of the document as characters.

getColumn(This, Pos)

Retrieve the column number of a position, taking tab width into account.

getControlCharSymbol(This)

Get the way control characters are displayed.

getCurLine(This)

Retrieve the text of the line containing the caret.

getCurLineRaw(This)

Retrieve the text of the line containing the caret.

getCurrentLine(This)

Returns the line number of the line with the caret.

getCurrentPos(This)

Returns the position of the caret.

getEdgeColour(This)

Retrieve the colour used in edge indication.

getEdgeColumn(This)

Retrieve the column number which text should be kept within.

getEdgeMode(This)

Retrieve the edge highlight mode.

getEndAtLastLine(This)

Retrieve whether the maximum scroll position has the last line at the bottom of the view.

getEndStyled(This)

Retrieve the position of the last correctly styled character.

getEOLMode(This)

Retrieve the current end of line mode - one of wxSTC_EOL_CRLF, wxSTC_EOL_CR, or wxSTC_EOL_LF.

getFirstVisibleLine(This)

Retrieve the display line at the top of the display.

getFoldExpanded(This, Line)

Is a header line expanded?

getFoldLevel(This, Line)

Retrieve the fold level of a line.

getFoldParent(This, Line)

Find the parent line of a child line.

getHighlightGuide(This)

Get the highlighted indentation guide column.

getIndent(This)

Retrieve indentation size.

getIndentationGuides(This)

Are the indentation guides visible?

getLastChild(This, Line, Level)

Find the last child line of a header line.

getLastKeydownProcessed(This)

Can be used to prevent the EVT_CHAR handler from adding the char.

getLayoutCache(This)

Retrieve the degree of caching of layout information.

getLength(This)

Returns the number of bytes in the document.

getLexer(This)

Retrieve the lexing language of the document.

getLine(This, Line)

Retrieve the contents of a line.

getLineCount(This)

Returns the number of lines in the document.

getLineEndPosition(This, Line)

Get the position after the last visible characters on a line.

getLineIndentation(This, Line)

Retrieve the number of columns that a line is indented.

getLineIndentPosition(This, Line)

Retrieve the position before the first non indentation character on a line.

getLineRaw(This, Line)

Retrieve the contents of a line.

getLineState(This, Line)

Retrieve the extra styling information for a line.

getLineVisible(This, Line)

Is a line visible?

getMarginLeft(This)

Returns the size in pixels of the left margin.

getMarginMask(This, Margin)

Retrieve the marker mask of a margin.

getMarginRight(This)

Returns the size in pixels of the right margin.

getMarginSensitive(This, Margin)

Retrieve the mouse click sensitivity of a margin.

getMarginType(This, Margin)

Retrieve the type of a margin.

getMarginWidth(This, Margin)

Retrieve the width of a margin in pixels.

getMaxLineState(This)

Retrieve the last line number that has line state.

getModEventMask(This)

Get which document modification events are sent to the container.

getModify(This)

Is the document different from when it was last saved?

getMouseDownCaptures(This)

Get whether mouse gets captured.

getMouseDwellTime(This)

Retrieve the time the mouse must sit still to generate a mouse dwell event.

getOvertype(This)

Returns true if overtype mode is active otherwise false is returned.

getPasteConvertEndings(This)

Get convert-on-paste setting.

getPrintColourMode(This)

Returns the print colour mode.

getPrintMagnification(This)

Returns the print magnification.

getPrintWrapMode(This)

Is printing line wrapped?

getProperty(This, Key)

Retrieve a "property" value previously set with SetProperty.

getReadOnly(This)

In read-only mode?

getScrollWidth(This)

Retrieve the document width assumed for scrolling.

getSearchFlags(This)

Get the search flags used by SearchInTarget.

getSelAlpha(This)

Get the alpha of the selection.

getSelectedText(This)

Retrieve the selected text.

getSelectedTextRaw(This)

Retrieve the selected text.

getSelection(This)

Gets the current selection span.

getSelectionEnd(This)

Returns the position at the end of the selection.

getSelectionMode(This)

Get the mode of the current selection.

getSelectionStart(This)

Returns the position at the start of the selection.

getSTCCursor(This)

Get cursor type.

getSTCFocus(This)

Get internal focus flag.

getStatus(This)

Get error status.

getStyleAt(This, Pos)

Returns the style byte at the position.

getStyleBits(This)

Retrieve number of bits in style bytes used to hold the lexical state.

getStyleBitsNeeded(This)

Retrieve the number of bits the current lexer needs for styling.

getTabIndents(This)

Does a tab pressed when caret is within indentation indent?

getTabWidth(This)

Retrieve the visible size of a tab.

getTargetEnd(This)

Get the position that ends the target.

getTargetStart(This)

Get the position that starts the target.

getText(This)

Retrieve all the text in the document.

getTextLength(This)

Retrieve the number of characters in the document.

getTextRange(This, StartPos, EndPos)

Retrieve a range of text.

getTextRangeRaw(This, StartPos, EndPos)

Retrieve a range of text.

getTextRaw(This)

Retrieve all the text in the document.

getTwoPhaseDraw(This)

Is drawing done in two phases with backgrounds drawn before foregrounds?

getUndoCollection(This)

Is undo history being collected?

getUseAntiAliasing(This)

Returns the current UseAntiAliasing setting.

getUseHorizontalScrollBar(This)

Is the horizontal scroll bar visible?

getUseTabs(This)

Retrieve whether tabs will be used in indentation.

getUseVerticalScrollBar(This)

Is the vertical scroll bar visible?

getViewEOL(This)

Are the end of line characters visible?

getViewWhiteSpace(This)

Are white space characters currently visible? Returns one of wxSTCWS* constants.

getWrapMode(This)

Retrieve whether text is word wrapped.

getWrapStartIndent(This)

Retrieve the start indent for wrapped lines.

getWrapVisualFlags(This)

Retrieve the display mode of visual flags for wrapped lines.

getWrapVisualFlagsLocation(This)

Retrieve the location of visual flags for wrapped lines.

getXOffset(This)

Get the xOffset (ie, horizontal scroll position).

getZoom(This)

Retrieve the zoom level.

gotoLine(This, Line)

Set caret to start of a line and ensure it is visible.

gotoPos(This, Caret)

Set caret to a position and ensure it is visible.

hideLines(This, LineStart, LineEnd)

Make a range of lines invisible.

hideSelection(This, Hide)

Draw the selection in normal style or with selection highlighted.

home(This)

Move caret to first position on line.

homeDisplay(This)

Move caret to first position on display line.

homeDisplayExtend(This)

Move caret to first position on display line extending selection to new caret position.

homeExtend(This)

Move caret to first position on line extending selection to new caret position.

homeRectExtend(This)

Move caret to first position on line, extending rectangular selection to new caret position.

homeWrapExtend(This)

Like HomeExtend but when word-wrap is enabled extends first to start of display line HomeDisplayExtend, then to start of document line HomeExtend.

indicatorGetForeground(This, Indicator)

Retrieve the foreground colour of an indicator.

indicatorGetStyle(This, Indicator)

Retrieve the style of an indicator.

indicatorSetForeground(This, Indicator, Fore)

Set the foreground colour of an indicator.

indicatorSetStyle(This, Indicator, IndicatorStyle)

Set an indicator to plain, squiggle or TT.

insertText(This, Pos, Text)

Insert string at a position.

insertTextRaw(This, Pos, Text)

Insert string at a position.

lineCopy(This)

Copy the line containing the caret.

lineCut(This)

Cut the line containing the caret.

lineDelete(This)

Delete the line containing the caret.

lineDown(This)

Move caret down one line.

lineDownExtend(This)

Move caret down one line extending selection to new caret position.

lineDownRectExtend(This)

Move caret down one line, extending rectangular selection to new caret position.

lineDuplicate(This)

Duplicate the current line.

lineEnd(This)

Move caret to last position on line.

lineEndDisplay(This)

Move caret to last position on display line.

lineEndDisplayExtend(This)

Move caret to last position on display line extending selection to new caret position.

lineEndExtend(This)

Move caret to last position on line extending selection to new caret position.

lineEndRectExtend(This)

Move caret to last position on line, extending rectangular selection to new caret position.

lineEndWrap(This)

Like LineEnd but when word-wrap is enabled goes first to end of display line LineEndDisplay, then to start of document line LineEnd.

lineEndWrapExtend(This)

Like LineEndExtend but when word-wrap is enabled extends first to end of display line LineEndDisplayExtend, then to start of document line LineEndExtend.

lineFromPosition(This, Pos)

Retrieve the line containing a position.

lineLength(This, Line)

How many characters are on a line, including end of line characters?

lineScroll(This, Columns, Lines)

Scroll horizontally and vertically.

lineScrollDown(This)

Scroll the document down, keeping the caret visible.

lineScrollUp(This)

Scroll the document up, keeping the caret visible.

linesJoin(This)

Join the lines in the target.

linesOnScreen(This)

Retrieves the number of lines completely visible.

linesSplit(This, PixelWidth)

Split the lines in the target into lines that are less wide than pixelWidth where possible.

lineTranspose(This)

Switch the current line with the previous.

lineUp(This)

Move caret up one line.

lineUpExtend(This)

Move caret up one line extending selection to new caret position.

lineUpRectExtend(This)

Move caret up one line, extending rectangular selection to new caret position.

loadFile(This, Filename)

Load the contents of filename into the editor.

lowerCase(This)

Transform the selection to lower case.

markerAdd(This, Line, MarkerNumber)

Add a marker to a line, returning an ID which can be used to find or delete the marker.

markerAddSet(This, Line, MarkerSet)

Add a set of markers to a line.

markerDefine(This, MarkerNumber, MarkerSymbol)

Equivalent to markerDefine(This, MarkerNumber, MarkerSymbol, []).

markerDefine/4

Set the symbol used for a particular marker number, and optionally the fore and background colours.

markerDefineBitmap(This, MarkerNumber, Bmp)

Define a marker with a wxBitmap.

markerDelete(This, Line, MarkerNumber)

Delete a marker from a line.

markerDeleteAll(This, MarkerNumber)

Delete all markers with a particular number from all lines.

markerDeleteHandle(This, MarkerHandle)

Delete a marker.

markerGet(This, Line)

Get a bit mask of all the markers set on a line.

markerLineFromHandle(This, MarkerHandle)

Retrieve the line number at which a particular marker is located.

markerNext(This, LineStart, MarkerMask)

Find the next line at or after lineStart that includes a marker in mask.

markerPrevious(This, LineStart, MarkerMask)

Find the previous line before lineStart that includes a marker in mask.

markerSetAlpha(This, MarkerNumber, Alpha)

Set the alpha used for a marker that is drawn in the text area, not the margin.

markerSetBackground(This, MarkerNumber, Back)

Set the background colour used for a particular marker number.

markerSetForeground(This, MarkerNumber, Fore)

Set the foreground colour used for a particular marker number.

moveCaretInsideView(This)

Move the caret inside current view if it's not there already.

new()

Default ctor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Ctor.

newLine(This)

Insert a new line, may use a CRLF, CR or LF depending on EOL mode.

pageDown(This)

Move caret one page down.

pageDownExtend(This)

Move caret one page down extending selection to new caret position.

pageDownRectExtend(This)

Move caret one page down, extending rectangular selection to new caret position.

pageUp(This)

Move caret one page up.

pageUpExtend(This)

Move caret one page up extending selection to new caret position.

pageUpRectExtend(This)

Move caret one page up, extending rectangular selection to new caret position.

paraDownExtend(This)

Extend selection down one paragraph (delimited by empty lines).

paraUp(This)

Move caret up one paragraph (delimited by empty lines).

paraUpExtend(This)

Extend selection up one paragraph (delimited by empty lines).

paste(This)

Paste the contents of the clipboard into the document replacing the selection.

pointFromPosition(This, Pos)

Retrieve the point in the window where a position is displayed.

positionAfter(This, Pos)

Given a valid document position, return the next position taking code page into account.

positionBefore(This, Pos)

Given a valid document position, return the previous position taking code page into account.

positionFromLine(This, Line)

Retrieve the position at the start of a line.

positionFromPoint(This, Pt)

Find the position from a point within the window.

positionFromPointClose(This, X, Y)

Find the position from a point within the window but return wxSTC_INVALID_POSITION if not close to text.

redo(This)

Redoes the next action on the undo history.

registerImage(This, Type, Bmp)

Register an image for use in autocompletion lists.

replaceSelection(This, Text)

Replace the selected text with the argument text.

replaceTarget(This, Text)

Replace the target text with the argument text.

saveFile(This, Filename)

Write the contents of the editor to filename.

scrollToColumn(This, Column)

Scroll enough to make the given column visible.

scrollToLine(This, Line)

Scroll enough to make the given line visible.

searchAnchor(This)

Sets the current caret position to be the search anchor.

searchInTarget(This, Text)

Search for a counted string in the target and set the target to the found range.

searchNext(This, SearchFlags, Text)

Find some text starting at the search anchor.

searchPrev(This, SearchFlags, Text)

Find some text starting at the search anchor and moving backwards.

selectAll(This)

Select all the text in the document.

selectionDuplicate(This)

Duplicate the selection.

selectionIsRectangle(This)

Is the selection rectangular? The alternative is the more common stream selection.

setAnchor(This, Anchor)

Set the selection anchor to a position.

setBackSpaceUnIndents(This, BsUnIndents)

Sets whether a backspace pressed when caret is within indentation unindents.

setBufferedDraw(This, Buffered)

If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.

setCaretForeground(This, Fore)

Set the foreground colour of the caret.

setCaretLineBackAlpha(This, Alpha)

Set background alpha of the caret line.

setCaretLineBackground(This, Back)

Set the colour of the background of the line containing the caret.

setCaretLineVisible(This, Show)

Display the background of the line containing the caret in a different colour.

setCaretPeriod(This, PeriodMilliseconds)

Get the time in milliseconds that the caret is on and off.

setCaretSticky(This, UseCaretStickyBehaviour)

Stop the caret preferred x position changing when the user types.

setCaretWidth(This, PixelWidth)

Set the width of the insert mode caret.

setCharsDefault(This)

Reset the set of characters for whitespace and word characters to the defaults.

setCodePage(This, CodePage)

Set the code page used to interpret the bytes of the document as characters.

setControlCharSymbol(This, Symbol)

Change the way control characters are displayed: If symbol is *< 32, keep the drawn way, else, use the given character.

setCurrentPos(This, Caret)

Sets the position of the caret.

setEdgeColour(This, EdgeColour)

Change the colour used in edge indication.

setEdgeColumn(This, Column)

Set the column number of the edge.

setEdgeMode(This, EdgeMode)

The edge may be displayed by a line (wxSTC_EDGE_LINE/wxSTC_EDGE_MULTILINE) or by highlighting text that goes beyond it (wxSTC_EDGE_BACKGROUND) or not displayed at all (wxSTC_EDGE_NONE).

setEOLMode(This, EolMode)

Set the current end of line mode.

setFoldExpanded(This, Line, Expanded)

Show the children of a header line.

setFoldFlags(This, Flags)

Set some style options for folding.

setFoldLevel(This, Line, Level)

Set the fold level of a line.

setFoldMarginColour(This, UseSetting, Back)

Set one of the colours used as a chequerboard pattern in the fold margin.

setFoldMarginHiColour(This, UseSetting, Fore)

Set the other colour used as a chequerboard pattern in the fold margin.

setHighlightGuide(This, Column)

Set the highlighted indentation guide column.

setHotspotActiveBackground(This, UseSetting, Back)

Set a back colour for active hotspots.

setHotspotActiveForeground(This, UseSetting, Fore)

Set a fore colour for active hotspots.

setHotspotActiveUnderline(This, Underline)

Enable / Disable underlining active hotspots.

setHotspotSingleLine(This, SingleLine)

Limit hotspots to single line so hotspots on two lines don't merge.

setHScrollBar(This, Bar)

Set the horizontal scrollbar to use instead of the one that's built-in.

setIndent(This, IndentSize)

Set the number of spaces used for one level of indentation.

setIndentationGuides(This, IndentView)

Show or hide indentation guides.

setKeyWords(This, KeyWordSet, KeyWords)

Set up the key words used by the lexer.

setLastKeydownProcessed(This, Val)

Returns the line number of the line with the caret.

setLayoutCache(This, CacheMode)

Sets the degree of caching of layout information.

setLexer(This, Lexer)

Set the lexing language of the document.

setLexerLanguage(This, Language)

Set the lexing language of the document based on string name.

setLineIndentation(This, Line, Indentation)

Change the indentation of a line to a number of columns.

setLineState(This, Line, State)

Used to hold extra styling information for each line.

setMarginLeft(This, PixelWidth)

Sets the size in pixels of the left margin.

setMarginMask(This, Margin, Mask)

Set a mask that determines which markers are displayed in a margin.

setMarginRight(This, PixelWidth)

Sets the size in pixels of the right margin.

setMarginSensitive(This, Margin, Sensitive)

Make a margin sensitive or insensitive to mouse clicks.

setMargins(This, Left, Right)

Set the left and right margin in the edit area, measured in pixels.

setMarginType(This, Margin, MarginType)

Set a margin to be either numeric or symbolic.

setMarginWidth(This, Margin, PixelWidth)

Set the width of a margin to a width expressed in pixels.

setModEventMask(This, EventMask)

Set which document modification events are sent to the container.

setMouseDownCaptures(This, Captures)

Set whether the mouse is captured when its button is pressed.

setMouseDwellTime(This, PeriodMilliseconds)

Sets the time the mouse must sit still to generate a mouse dwell event.

setPasteConvertEndings(This, Convert)

Enable/Disable convert-on-paste for line endings.

setPrintColourMode(This, Mode)

Modify colours when printing for clearer printed text.

setPrintMagnification(This, Magnification)

Sets the print magnification added to the point size of each style for printing.

setProperty(This, Key, Value)

Set up a value that may be used by a lexer for some optional feature.

setReadOnly(This, ReadOnly)

Set to read only or read write.

setSavePoint(This)

Remember the current position in the undo history as the position at which the document was saved.

setScrollWidth(This, PixelWidth)

Sets the document width assumed for scrolling.

setSearchFlags(This, SearchFlags)

Set the search flags used by SearchInTarget.

setSelAlpha(This, Alpha)

Set the alpha of the selection.

setSelBackground(This, UseSetting, Back)

Set the background colour of the main and additional selections and whether to use this setting.

setSelection(This, From, To)

Selects the text starting at the first position up to (but not including) the character at the last position.

setSelectionEnd(This, Caret)

Sets the position that ends the selection - this becomes the caret.

setSelectionMode(This, SelectionMode)

Set the selection mode to stream (wxSTC_SEL_STREAM) or rectangular (wxSTC_SEL_RECTANGLE/wxSTC_SEL_THIN) or by lines (wxSTC_SEL_LINES).

setSelectionStart(This, Anchor)

Sets the position that starts the selection - this becomes the anchor.

setSelForeground(This, UseSetting, Fore)

Set the foreground colour of the main and additional selections and whether to use this setting.

setSTCCursor(This, CursorType)

Sets the cursor to one of the wxSTC_CURSOR* values.

setSTCFocus(This, Focus)

Change internal focus flag.

setStatus(This, Status)

Change error status - 0 = OK.

setStyleBytes(This, Length)

Set the styles for a segment of the document.

setStyling(This, Length, Style)

Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.

setTabIndents(This, TabIndents)

Sets whether a tab pressed when caret is within indentation indents.

setTabWidth(This, TabWidth)

Change the visible size of a tab to be a multiple of the width of a space character.

setTargetEnd(This, End)

Sets the position that ends the target which is used for updating the document without affecting the scroll position.

setTargetStart(This, Start)

Sets the position that starts the target which is used for updating the document without affecting the scroll position.

setText(This, Text)

Replace the contents of the document with the argument text.

setTextRaw(This, Text)

Replace the contents of the document with the argument text.

setTwoPhaseDraw(This, TwoPhase)

In twoPhaseDraw mode, drawing is performed in two phases, first the background and then the foreground.

setUndoCollection(This, CollectUndo)

Choose between collecting actions into the undo history and discarding them.

setUseHorizontalScrollBar(This, Visible)

Show or hide the horizontal scroll bar.

setUseTabs(This, UseTabs)

Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.

setUseVerticalScrollBar(This, Visible)

Show or hide the vertical scroll bar.

setViewEOL(This, Visible)

Make the end of line characters visible or invisible.

setViewWhiteSpace(This, ViewWS)

Make white space characters invisible, always visible or visible outside indentation.

setVisiblePolicy(This, VisiblePolicy, VisibleSlop)

Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.

setVScrollBar(This, Bar)

Set the vertical scrollbar to use instead of the one that's built-in.

setWhitespaceBackground(This, UseSetting, Back)

Set the background colour of all whitespace and whether to use this setting.

setWhitespaceChars(This, Characters)

Set the set of characters making up whitespace for when moving or selecting by word.

setWhitespaceForeground(This, UseSetting, Fore)

Set the foreground colour of all whitespace and whether to use this setting.

setWordChars(This, Characters)

Set the set of characters making up words for when moving or selecting by word.

setWrapMode(This, WrapMode)

Sets whether text is word wrapped.

setWrapStartIndent(This, Indent)

Set the start indent for wrapped lines.

setWrapVisualFlags(This, WrapVisualFlags)

Set the display mode of visual flags for wrapped lines.

setWrapVisualFlagsLocation(This, WrapVisualFlagsLocation)

Set the location of visual flags for wrapped lines.

setXCaretPolicy(This, CaretPolicy, CaretSlop)

Set the way the caret is kept visible when going sideways.

setYCaretPolicy(This, CaretPolicy, CaretSlop)

Set the way the line the caret is on is kept visible.

setZoom(This, ZoomInPoints)

Set the zoom level.

showLines(This, LineStart, LineEnd)

Make a range of lines visible.

startRecord(This)

Start notifying the container of all key presses and commands.

startStyling(This, Start)

Set the current styling position to start.

stopRecord(This)

Stop notifying the container of all key presses and commands.

stutteredPageDown(This)

Move caret to bottom of page, or one page down if already at bottom of page.

stutteredPageDownExtend(This)

Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.

stutteredPageUp(This)

Move caret to top of page, or one page up if already at top of page.

stutteredPageUpExtend(This)

Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.

styleClearAll(This)

Clear all the styles and make equivalent to the global default style.

styleResetDefault(This)

Reset the default style to its state at startup.

styleSetBackground(This, Style, Back)

Set the background colour of a style.

styleSetBold(This, Style, Bold)

Set a style to be bold or not.

styleSetCase(This, Style, CaseVisible)

Set a style to be mixed case, or to force upper or lower case.

styleSetCharacterSet(This, Style, CharacterSet)

Set the character set of the font in a style.

styleSetEOLFilled(This, Style, EolFilled)

Set a style to have its end of line filled or not.

styleSetFaceName(This, Style, FontName)

Set the font of a style.

styleSetFont(This, StyleNum, Font)

Set style size, face, bold, italic, and underline attributes from a wxFont's attributes.

styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline)

Equivalent to styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline, []).

styleSetFontAttr/8

Set all font style attributes at once.

styleSetFontEncoding(This, Style, Encoding)

Set the font encoding to be used by a style.

styleSetForeground(This, Style, Fore)

Set the foreground colour of a style.

styleSetHotSpot(This, Style, Hotspot)

Set a style to be a hotspot or not.

styleSetItalic(This, Style, Italic)

Set a style to be italic or not.

styleSetSize(This, Style, SizePoints)

Set the size of characters of a style.

styleSetSpec(This, StyleNum, Spec)

Extract style settings from a spec-string which is composed of one or more of the following comma separated elements

styleSetUnderline(This, Style, Underline)

Set a style to be underlined or not.

styleSetVisible(This, Style, Visible)

Set a style to be visible or not.

tab(This)

If selection is empty or all on one line replace the selection with a tab character.

targetFromSelection(This)

Make the target range start and end be the same as the selection range start and end.

textHeight(This, Line)

Retrieve the height of a particular line of text in pixels.

textWidth(This, Style, Text)

Measure the pixel width of some text in a particular style.

toggleCaretSticky(This)

Switch between sticky and non-sticky: meant to be bound to a key.

toggleFold(This, Line)

Switch a header line between expanded and contracted.

undo(This)

Undo one action in the undo history.

upperCase(This)

Transform the selection to upper case.

usePopUp(This, PopUpMode)

Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button on certain areas.

userListShow(This, ListType, ItemList)

Display a list of strings and send notification when user chooses one.

vCHome(This)

Move caret to before first visible character on line.

vCHomeExtend(This)

Like VCHome but extending selection to new caret position.

vCHomeRectExtend(This)

Move caret to before first visible character on line.

vCHomeWrap(This)

Like VCHome but when word-wrap is enabled goes first to start of display line VCHomeDisplay, then behaves like VCHome.

vCHomeWrapExtend(This)

Like VCHomeExtend but when word-wrap is enabled extends first to start of display line VCHomeDisplayExtend, then behaves like VCHomeExtend.

visibleFromDocLine(This, DocLine)

Find the display line of a document line taking hidden lines into account.

wordEndPosition(This, Pos, OnlyWordCharacters)

Get position of end of word.

wordLeft(This)

Move caret left one word.

wordLeftEnd(This)

Move caret left one word, position cursor at end of word.

wordLeftEndExtend(This)

Move caret left one word, position cursor at end of word, extending selection to new caret position.

wordLeftExtend(This)

Move caret left one word extending selection to new caret position.

wordPartLeft(This)

Move to the previous change in capitalisation.

wordPartLeftExtend(This)

Move to the previous change in capitalisation extending selection to new caret position.

wordPartRight(This)

Move to the change next in capitalisation.

wordPartRightExtend(This)

Move to the next change in capitalisation extending selection to new caret position.

wordRight(This)

Move caret right one word.

wordRightEnd(This)

Move caret right one word, position cursor at end of word.

wordRightEndExtend(This)

Move caret right one word, position cursor at end of word, extending selection to new caret position.

wordRightExtend(This)

Move caret right one word extending selection to new caret position.

wordStartPosition(This, Pos, OnlyWordCharacters)

Get position of start of word.

wrapCount(This, DocLine)

The number of display lines needed to wrap a document line.

zoomIn(This)

Magnify the displayed text by increasing the sizes by 1 point.

zoomOut(This)

Make the displayed text smaller by decreasing the sizes by 1 point.

Types

wxStyledTextCtrl()

-type wxStyledTextCtrl() :: wx:wx_object().

Functions

addText(This, Text)

-spec addText(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Add text to the document at current position.

addTextRaw(This, Text)

-spec addTextRaw(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: binary().

Equivalent to addTextRaw(This, Text, []).

addTextRaw/3

-spec addTextRaw(This, Text, [Option]) -> ok
                    when This :: wxStyledTextCtrl(), Text :: binary(), Option :: {length, integer()}.

Add text to the document at current position.

allocate(This, Bytes)

-spec allocate(This, Bytes) -> ok when This :: wxStyledTextCtrl(), Bytes :: integer().

Enlarge the document to a particular size of text bytes.

appendText(This, Text)

-spec appendText(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Append a string to the end of the document without changing the selection.

appendTextRaw(This, Text)

-spec appendTextRaw(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: binary().

Equivalent to appendTextRaw(This, Text, []).

appendTextRaw/3

-spec appendTextRaw(This, Text, [Option]) -> ok
                       when This :: wxStyledTextCtrl(), Text :: binary(), Option :: {length, integer()}.

Append a string to the end of the document without changing the selection.

autoCompActive(This)

-spec autoCompActive(This) -> boolean() when This :: wxStyledTextCtrl().

Is there an auto-completion list visible?

autoCompCancel(This)

-spec autoCompCancel(This) -> ok when This :: wxStyledTextCtrl().

Remove the auto-completion list from the screen.

autoCompComplete(This)

-spec autoCompComplete(This) -> ok when This :: wxStyledTextCtrl().

User has selected an item so remove the list and insert the selection.

autoCompGetAutoHide(This)

-spec autoCompGetAutoHide(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether or not autocompletion is hidden automatically when nothing matches.

autoCompGetCancelAtStart(This)

-spec autoCompGetCancelAtStart(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether auto-completion cancelled by backspacing before start.

autoCompGetChooseSingle(This)

-spec autoCompGetChooseSingle(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether a single item auto-completion list automatically choose the item.

autoCompGetCurrent(This)

-spec autoCompGetCurrent(This) -> integer() when This :: wxStyledTextCtrl().

Get currently selected item position in the auto-completion list.

autoCompGetDropRestOfWord(This)

-spec autoCompGetDropRestOfWord(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.

autoCompGetIgnoreCase(This)

-spec autoCompGetIgnoreCase(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve state of ignore case flag.

autoCompGetMaxHeight(This)

-spec autoCompGetMaxHeight(This) -> integer() when This :: wxStyledTextCtrl().

Set the maximum height, in rows, of auto-completion and user lists.

autoCompGetMaxWidth(This)

-spec autoCompGetMaxWidth(This) -> integer() when This :: wxStyledTextCtrl().

Get the maximum width, in characters, of auto-completion and user lists.

autoCompGetSeparator(This)

-spec autoCompGetSeparator(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the auto-completion list separator character.

autoCompGetTypeSeparator(This)

-spec autoCompGetTypeSeparator(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the auto-completion list type-separator character.

autoCompPosStart(This)

-spec autoCompPosStart(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the position of the caret when the auto-completion list was displayed.

autoCompSelect(This, Select)

-spec autoCompSelect(This, Select) -> ok when This :: wxStyledTextCtrl(), Select :: unicode:chardata().

Select the item in the auto-completion list that starts with a string.

autoCompSetAutoHide(This, AutoHide)

-spec autoCompSetAutoHide(This, AutoHide) -> ok when This :: wxStyledTextCtrl(), AutoHide :: boolean().

Set whether or not autocompletion is hidden automatically when nothing matches.

autoCompSetCancelAtStart(This, Cancel)

-spec autoCompSetCancelAtStart(This, Cancel) -> ok when This :: wxStyledTextCtrl(), Cancel :: boolean().

Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.

autoCompSetChooseSingle(This, ChooseSingle)

-spec autoCompSetChooseSingle(This, ChooseSingle) -> ok
                                 when This :: wxStyledTextCtrl(), ChooseSingle :: boolean().

Should a single item auto-completion list automatically choose the item.

autoCompSetDropRestOfWord(This, DropRestOfWord)

-spec autoCompSetDropRestOfWord(This, DropRestOfWord) -> ok
                                   when This :: wxStyledTextCtrl(), DropRestOfWord :: boolean().

Set whether or not autocompletion deletes any word characters after the inserted text upon completion.

autoCompSetFillUps(This, CharacterSet)

-spec autoCompSetFillUps(This, CharacterSet) -> ok
                            when This :: wxStyledTextCtrl(), CharacterSet :: unicode:chardata().

Define a set of characters that when typed will cause the autocompletion to choose the selected item.

autoCompSetIgnoreCase(This, IgnoreCase)

-spec autoCompSetIgnoreCase(This, IgnoreCase) -> ok
                               when This :: wxStyledTextCtrl(), IgnoreCase :: boolean().

Set whether case is significant when performing auto-completion searches.

autoCompSetMaxHeight(This, RowCount)

-spec autoCompSetMaxHeight(This, RowCount) -> ok when This :: wxStyledTextCtrl(), RowCount :: integer().

Set the maximum height, in rows, of auto-completion and user lists.

The default is 5 rows.

autoCompSetMaxWidth(This, CharacterCount)

-spec autoCompSetMaxWidth(This, CharacterCount) -> ok
                             when This :: wxStyledTextCtrl(), CharacterCount :: integer().

Set the maximum width, in characters, of auto-completion and user lists.

Set to 0 to autosize to fit longest item, which is the default.

autoCompSetSeparator(This, SeparatorCharacter)

-spec autoCompSetSeparator(This, SeparatorCharacter) -> ok
                              when This :: wxStyledTextCtrl(), SeparatorCharacter :: integer().

Change the separator character in the string setting up an auto-completion list.

Default is space but can be changed if items contain space.

autoCompSetTypeSeparator(This, SeparatorCharacter)

-spec autoCompSetTypeSeparator(This, SeparatorCharacter) -> ok
                                  when This :: wxStyledTextCtrl(), SeparatorCharacter :: integer().

Change the type-separator character in the string setting up an auto-completion list.

Default is '?' but can be changed if items contain '?'.

autoCompShow(This, LengthEntered, ItemList)

-spec autoCompShow(This, LengthEntered, ItemList) -> ok
                      when
                          This :: wxStyledTextCtrl(),
                          LengthEntered :: integer(),
                          ItemList :: unicode:chardata().

Display a auto-completion list.

The lengthEntered parameter indicates how many characters before the caret should be used to provide context.

autoCompStops(This, CharacterSet)

-spec autoCompStops(This, CharacterSet) -> ok
                       when This :: wxStyledTextCtrl(), CharacterSet :: unicode:chardata().

Define a set of character that when typed cancel the auto-completion list.

backTab(This)

-spec backTab(This) -> ok when This :: wxStyledTextCtrl().

Dedent the selected lines.

beginUndoAction(This)

-spec beginUndoAction(This) -> ok when This :: wxStyledTextCtrl().

Start a sequence of actions that is undone and redone as a unit.

May be nested.

braceBadLight(This, Pos)

-spec braceBadLight(This, Pos) -> ok when This :: wxStyledTextCtrl(), Pos :: integer().

Highlight the character at a position indicating there is no matching brace.

braceHighlight(This, PosA, PosB)

-spec braceHighlight(This, PosA, PosB) -> ok
                        when This :: wxStyledTextCtrl(), PosA :: integer(), PosB :: integer().

Highlight the characters at two positions.

braceMatch(This, Pos)

-spec braceMatch(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Find the position of a matching brace or wxSTC_INVALID_POSITION if no match.

callTipActive(This)

-spec callTipActive(This) -> boolean() when This :: wxStyledTextCtrl().

Is there an active call tip?

callTipCancel(This)

-spec callTipCancel(This) -> ok when This :: wxStyledTextCtrl().

Remove the call tip from the screen.

callTipPosAtStart(This)

-spec callTipPosAtStart(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the position where the caret was before displaying the call tip.

Since: 3.1.0

callTipSetBackground(This, Back)

-spec callTipSetBackground(This, Back) -> ok when This :: wxStyledTextCtrl(), Back :: wx:wx_colour().

Set the background colour for the call tip.

callTipSetForeground(This, Fore)

-spec callTipSetForeground(This, Fore) -> ok when This :: wxStyledTextCtrl(), Fore :: wx:wx_colour().

Set the foreground colour for the call tip.

callTipSetForegroundHighlight(This, Fore)

-spec callTipSetForegroundHighlight(This, Fore) -> ok
                                       when This :: wxStyledTextCtrl(), Fore :: wx:wx_colour().

Set the foreground colour for the highlighted part of the call tip.

callTipSetHighlight(This, HighlightStart, HighlightEnd)

-spec callTipSetHighlight(This, HighlightStart, HighlightEnd) -> ok
                             when
                                 This :: wxStyledTextCtrl(),
                                 HighlightStart :: integer(),
                                 HighlightEnd :: integer().

Highlight a segment of the definition.

callTipShow(This, Pos, Definition)

-spec callTipShow(This, Pos, Definition) -> ok
                     when This :: wxStyledTextCtrl(), Pos :: integer(), Definition :: unicode:chardata().

Show a call tip containing a definition near position pos.

callTipUseStyle(This, TabSize)

-spec callTipUseStyle(This, TabSize) -> ok when This :: wxStyledTextCtrl(), TabSize :: integer().

Enable use of wxSTC_STYLE_CALLTIP and set call tip tab size in pixels.

cancel(This)

-spec cancel(This) -> ok when This :: wxStyledTextCtrl().

Cancel any modes such as call tip or auto-completion list display.

canPaste(This)

-spec canPaste(This) -> boolean() when This :: wxStyledTextCtrl().

Will a paste succeed?

canRedo(This)

-spec canRedo(This) -> boolean() when This :: wxStyledTextCtrl().

Are there any redoable actions in the undo history?

canUndo(This)

-spec canUndo(This) -> boolean() when This :: wxStyledTextCtrl().

Are there any undoable actions in the undo history?

charLeft(This)

-spec charLeft(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one character.

charLeftExtend(This)

-spec charLeftExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one character extending selection to new caret position.

charLeftRectExtend(This)

-spec charLeftRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one character, extending rectangular selection to new caret position.

charRight(This)

-spec charRight(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one character.

charRightExtend(This)

-spec charRightExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one character extending selection to new caret position.

charRightRectExtend(This)

-spec charRightRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one character, extending rectangular selection to new caret position.

chooseCaretX(This)

-spec chooseCaretX(This) -> ok when This :: wxStyledTextCtrl().

Set the last x chosen value to be the caret x position.

clear(This)

-spec clear(This) -> ok when This :: wxStyledTextCtrl().

Clear the selection.

clearAll(This)

-spec clearAll(This) -> ok when This :: wxStyledTextCtrl().

Delete all text in the document.

clearDocumentStyle(This)

-spec clearDocumentStyle(This) -> ok when This :: wxStyledTextCtrl().

Set all style bytes to 0, remove all folding information.

clearRegisteredImages(This)

-spec clearRegisteredImages(This) -> ok when This :: wxStyledTextCtrl().

Clear all the registered images.

cmdKeyAssign(This, Key, Modifiers, Cmd)

-spec cmdKeyAssign(This, Key, Modifiers, Cmd) -> ok
                      when
                          This :: wxStyledTextCtrl(),
                          Key :: integer(),
                          Modifiers :: integer(),
                          Cmd :: integer().

When key+modifier combination keyDefinition is pressed perform sciCommand.

The second argument should be a bit list containing one or more of the ?wxSTC_KEYMOD_* constants and the third argument should be one of the ?wxSTC_CMD_* constants.

cmdKeyClear(This, Key, Modifiers)

-spec cmdKeyClear(This, Key, Modifiers) -> ok
                     when This :: wxStyledTextCtrl(), Key :: integer(), Modifiers :: integer().

When key+modifier combination keyDefinition is pressed do nothing.

The second argument should be a bit list containing one or more of the ?wxSTC_KEYMOD_* constants.

cmdKeyClearAll(This)

-spec cmdKeyClearAll(This) -> ok when This :: wxStyledTextCtrl().

Drop all key mappings.

cmdKeyExecute(This, Cmd)

-spec cmdKeyExecute(This, Cmd) -> ok when This :: wxStyledTextCtrl(), Cmd :: integer().

Perform one of the operations defined by the wxSTCCMD* constants.

colourise(This, Start, End)

-spec colourise(This, Start, End) -> ok
                   when This :: wxStyledTextCtrl(), Start :: integer(), End :: integer().

Colourise a segment of the document using the current lexing language.

convertEOLs(This, EolMode)

-spec convertEOLs(This, EolMode) -> ok when This :: wxStyledTextCtrl(), EolMode :: integer().

Convert all line endings in the document to one mode.

copy(This)

-spec copy(This) -> ok when This :: wxStyledTextCtrl().

Copy the selection to the clipboard.

copyRange(This, Start, End)

-spec copyRange(This, Start, End) -> ok
                   when This :: wxStyledTextCtrl(), Start :: integer(), End :: integer().

Copy a range of text to the clipboard.

Positions are clipped into the document.

copyText(This, Length, Text)

-spec copyText(This, Length, Text) -> ok
                  when This :: wxStyledTextCtrl(), Length :: integer(), Text :: unicode:chardata().

Copy argument text to the clipboard.

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxStyledTextCtrl(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxStyledTextCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Create the UI elements for a STC that was created with the default ctor.

(For 2-phase create.)

cut(This)

-spec cut(This) -> ok when This :: wxStyledTextCtrl().

Cut the selection to the clipboard.

deleteBack(This)

-spec deleteBack(This) -> ok when This :: wxStyledTextCtrl().

Delete the selection or if no selection, the character before the caret.

deleteBackNotLine(This)

-spec deleteBackNotLine(This) -> ok when This :: wxStyledTextCtrl().

Delete the selection or if no selection, the character before the caret.

Will not delete the character before at the start of a line.

delLineLeft(This)

-spec delLineLeft(This) -> ok when This :: wxStyledTextCtrl().

Delete back from the current position to the start of the line.

delLineRight(This)

-spec delLineRight(This) -> ok when This :: wxStyledTextCtrl().

Delete forwards from the current position to the end of the line.

delWordLeft(This)

-spec delWordLeft(This) -> ok when This :: wxStyledTextCtrl().

Delete the word to the left of the caret.

delWordRight(This)

-spec delWordRight(This) -> ok when This :: wxStyledTextCtrl().

Delete the word to the right of the caret.

destroy(This)

-spec destroy(This :: wxStyledTextCtrl()) -> ok.

Destroys the object

docLineFromVisible(This, DisplayLine)

-spec docLineFromVisible(This, DisplayLine) -> integer()
                            when This :: wxStyledTextCtrl(), DisplayLine :: integer().

Find the document line of a display line taking hidden lines into account.

documentEnd(This)

-spec documentEnd(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position in document.

documentEndExtend(This)

-spec documentEndExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position in document extending selection to new caret position.

documentStart(This)

-spec documentStart(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position in document.

documentStartExtend(This)

-spec documentStartExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position in document extending selection to new caret position.

doDragOver(This, X, Y, DefaultRes)

-spec doDragOver(This, X, Y, DefaultRes) -> wx:wx_enum()
                    when
                        This :: wxStyledTextCtrl(),
                        X :: integer(),
                        Y :: integer(),
                        DefaultRes :: wx:wx_enum().

Allow for simulating a DnD DragOver.

doDropText(This, X, Y, Data)

-spec doDropText(This, X, Y, Data) -> boolean()
                    when
                        This :: wxStyledTextCtrl(),
                        X :: integer(),
                        Y :: integer(),
                        Data :: unicode:chardata().

Allow for simulating a DnD DropText.

editToggleOvertype(This)

-spec editToggleOvertype(This) -> ok when This :: wxStyledTextCtrl().

Switch from insert to overtype mode or the reverse.

emptyUndoBuffer(This)

-spec emptyUndoBuffer(This) -> ok when This :: wxStyledTextCtrl().

Delete the undo history.

endUndoAction(This)

-spec endUndoAction(This) -> ok when This :: wxStyledTextCtrl().

End a sequence of actions that is undone and redone as a unit.

ensureCaretVisible(This)

-spec ensureCaretVisible(This) -> ok when This :: wxStyledTextCtrl().

Ensure the caret is visible.

ensureVisible(This, Line)

-spec ensureVisible(This, Line) -> ok when This :: wxStyledTextCtrl(), Line :: integer().

Ensure a particular line is visible by expanding any header line hiding it.

ensureVisibleEnforcePolicy(This, Line)

-spec ensureVisibleEnforcePolicy(This, Line) -> ok when This :: wxStyledTextCtrl(), Line :: integer().

Ensure a particular line is visible by expanding any header line hiding it.

Use the currently set visibility policy to determine which range to display.

findColumn(This, Line, Column)

-spec findColumn(This, Line, Column) -> integer()
                    when This :: wxStyledTextCtrl(), Line :: integer(), Column :: integer().

Find the position of a column on a line taking into account tabs and multi-byte characters.

If beyond end of line, return line end position.

findText(This, MinPos, MaxPos, Text)

-spec findText(This, MinPos, MaxPos, Text) -> integer()
                  when
                      This :: wxStyledTextCtrl(),
                      MinPos :: integer(),
                      MaxPos :: integer(),
                      Text :: unicode:chardata().

Equivalent to findText(This, MinPos, MaxPos, Text, []).

findText/5

-spec findText(This, MinPos, MaxPos, Text, [Option]) -> integer()
                  when
                      This :: wxStyledTextCtrl(),
                      MinPos :: integer(),
                      MaxPos :: integer(),
                      Text :: unicode:chardata(),
                      Option :: {flags, integer()}.

Find some text in the document. @param minPos The position (starting from zero) in the document at which to begin the search @param maxPos The last position (starting from zero) in the document to which the search will be restricted. @param text The text to search for. @param flags (Optional) The search flags. This should be a bit list containing one or more of the @link wxStyledTextCtrl::wxSTC_FIND_WHOLEWORD wxSTC_FIND_* @endlink constants.

Return: The position (starting from zero) in the document at which the text was found or wxSTC_INVALID_POSITION if the search fails.

Remark: A backwards search can be performed by setting minPos to be greater than maxPos.

formatRange(This, DoDraw, StartPos, EndPos, Draw, Target, RenderRect, PageRect)

-spec formatRange(This, DoDraw, StartPos, EndPos, Draw, Target, RenderRect, PageRect) -> integer()
                     when
                         This :: wxStyledTextCtrl(),
                         DoDraw :: boolean(),
                         StartPos :: integer(),
                         EndPos :: integer(),
                         Draw :: wxDC:wxDC(),
                         Target :: wxDC:wxDC(),
                         RenderRect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                         PageRect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

On Windows, will draw the document into a display context such as a printer.

formFeed(This)

-spec formFeed(This) -> ok when This :: wxStyledTextCtrl().

Insert a Form Feed character.

getAnchor(This)

-spec getAnchor(This) -> integer() when This :: wxStyledTextCtrl().

Returns the position of the opposite end of the selection to the caret.

getBackSpaceUnIndents(This)

-spec getBackSpaceUnIndents(This) -> boolean() when This :: wxStyledTextCtrl().

Does a backspace pressed when caret is within indentation unindent?

getBufferedDraw(This)

-spec getBufferedDraw(This) -> boolean() when This :: wxStyledTextCtrl().

Is drawing done first into a buffer or direct to the screen?

getCaretForeground(This)

-spec getCaretForeground(This) -> wx:wx_colour4() when This :: wxStyledTextCtrl().

Get the foreground colour of the caret.

getCaretLineBackAlpha(This)

-spec getCaretLineBackAlpha(This) -> integer() when This :: wxStyledTextCtrl().

Get the background alpha of the caret line.

getCaretLineBackground(This)

-spec getCaretLineBackground(This) -> wx:wx_colour4() when This :: wxStyledTextCtrl().

Get the colour of the background of the line containing the caret.

getCaretLineVisible(This)

-spec getCaretLineVisible(This) -> boolean() when This :: wxStyledTextCtrl().

Is the background of the line containing the caret in a different colour?

getCaretPeriod(This)

-spec getCaretPeriod(This) -> integer() when This :: wxStyledTextCtrl().

Get the time in milliseconds that the caret is on and off.

getCaretSticky(This)

-spec getCaretSticky(This) -> integer() when This :: wxStyledTextCtrl().

Can the caret preferred x position only be changed by explicit movement commands?

The return value will be one of the ?wxSTC_CARETSTICKY_* constants.

getCaretWidth(This)

-spec getCaretWidth(This) -> integer() when This :: wxStyledTextCtrl().

Returns the width of the insert mode caret.

getCharAt(This, Pos)

-spec getCharAt(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Returns the character byte at the position.

getCodePage(This)

-spec getCodePage(This) -> integer() when This :: wxStyledTextCtrl().

Get the code page used to interpret the bytes of the document as characters.

getColumn(This, Pos)

-spec getColumn(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Retrieve the column number of a position, taking tab width into account.

getControlCharSymbol(This)

-spec getControlCharSymbol(This) -> integer() when This :: wxStyledTextCtrl().

Get the way control characters are displayed.

getCurLine(This)

-spec getCurLine(This) -> Result
                    when
                        Result :: {Res :: unicode:charlist(), LinePos :: integer()},
                        This :: wxStyledTextCtrl().

Retrieve the text of the line containing the caret.

linePos can optionally be passed in to receive the index of the caret on the line.

getCurLineRaw(This)

-spec getCurLineRaw(This) -> Result
                       when
                           Result :: {Res :: binary(), LinePos :: integer()}, This :: wxStyledTextCtrl().

Retrieve the text of the line containing the caret.

Returns the index of the caret on the line.

getCurrentLine(This)

-spec getCurrentLine(This) -> integer() when This :: wxStyledTextCtrl().

Returns the line number of the line with the caret.

getCurrentPos(This)

-spec getCurrentPos(This) -> integer() when This :: wxStyledTextCtrl().

Returns the position of the caret.

getEdgeColour(This)

-spec getEdgeColour(This) -> wx:wx_colour4() when This :: wxStyledTextCtrl().

Retrieve the colour used in edge indication.

getEdgeColumn(This)

-spec getEdgeColumn(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the column number which text should be kept within.

getEdgeMode(This)

-spec getEdgeMode(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the edge highlight mode.

The return value will be one of the ?wxSTC_EDGE_* constants.

getEndAtLastLine(This)

-spec getEndAtLastLine(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether the maximum scroll position has the last line at the bottom of the view.

getEndStyled(This)

-spec getEndStyled(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the position of the last correctly styled character.

getEOLMode(This)

-spec getEOLMode(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the current end of line mode - one of wxSTC_EOL_CRLF, wxSTC_EOL_CR, or wxSTC_EOL_LF.

getFirstVisibleLine(This)

-spec getFirstVisibleLine(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the display line at the top of the display.

getFoldExpanded(This, Line)

-spec getFoldExpanded(This, Line) -> boolean() when This :: wxStyledTextCtrl(), Line :: integer().

Is a header line expanded?

getFoldLevel(This, Line)

-spec getFoldLevel(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the fold level of a line.

getFoldParent(This, Line)

-spec getFoldParent(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Find the parent line of a child line.

getHighlightGuide(This)

-spec getHighlightGuide(This) -> integer() when This :: wxStyledTextCtrl().

Get the highlighted indentation guide column.

getIndent(This)

-spec getIndent(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve indentation size.

getIndentationGuides(This)

-spec getIndentationGuides(This) -> integer() when This :: wxStyledTextCtrl().

Are the indentation guides visible?

The return value will be one of the ?wxSTC_IV_* constants.

getLastChild(This, Line, Level)

-spec getLastChild(This, Line, Level) -> integer()
                      when This :: wxStyledTextCtrl(), Line :: integer(), Level :: integer().

Find the last child line of a header line.

getLastKeydownProcessed(This)

-spec getLastKeydownProcessed(This) -> boolean() when This :: wxStyledTextCtrl().

Can be used to prevent the EVT_CHAR handler from adding the char.

getLayoutCache(This)

-spec getLayoutCache(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the degree of caching of layout information.

The return value will be one of the ?wxSTC_CACHE_* constants.

getLength(This)

-spec getLength(This) -> integer() when This :: wxStyledTextCtrl().

Returns the number of bytes in the document.

getLexer(This)

-spec getLexer(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the lexing language of the document.

The return value will be one of the ?wxSTC_LEX_* constants.

getLine(This, Line)

-spec getLine(This, Line) -> unicode:charlist() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the contents of a line.

getLineCount(This)

-spec getLineCount(This) -> integer() when This :: wxStyledTextCtrl().

Returns the number of lines in the document.

There is always at least one.

getLineEndPosition(This, Line)

-spec getLineEndPosition(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Get the position after the last visible characters on a line.

getLineIndentation(This, Line)

-spec getLineIndentation(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the number of columns that a line is indented.

getLineIndentPosition(This, Line)

-spec getLineIndentPosition(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the position before the first non indentation character on a line.

getLineRaw(This, Line)

-spec getLineRaw(This, Line) -> binary() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the contents of a line.

getLineState(This, Line)

-spec getLineState(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the extra styling information for a line.

getLineVisible(This, Line)

-spec getLineVisible(This, Line) -> boolean() when This :: wxStyledTextCtrl(), Line :: integer().

Is a line visible?

getMarginLeft(This)

-spec getMarginLeft(This) -> integer() when This :: wxStyledTextCtrl().

Returns the size in pixels of the left margin.

getMarginMask(This, Margin)

-spec getMarginMask(This, Margin) -> integer() when This :: wxStyledTextCtrl(), Margin :: integer().

Retrieve the marker mask of a margin.

getMarginRight(This)

-spec getMarginRight(This) -> integer() when This :: wxStyledTextCtrl().

Returns the size in pixels of the right margin.

getMarginSensitive(This, Margin)

-spec getMarginSensitive(This, Margin) -> boolean() when This :: wxStyledTextCtrl(), Margin :: integer().

Retrieve the mouse click sensitivity of a margin.

getMarginType(This, Margin)

-spec getMarginType(This, Margin) -> integer() when This :: wxStyledTextCtrl(), Margin :: integer().

Retrieve the type of a margin.

The return value will be one of the ?wxSTC_MARGIN_* constants.

getMarginWidth(This, Margin)

-spec getMarginWidth(This, Margin) -> integer() when This :: wxStyledTextCtrl(), Margin :: integer().

Retrieve the width of a margin in pixels.

getMaxLineState(This)

-spec getMaxLineState(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the last line number that has line state.

getModEventMask(This)

-spec getModEventMask(This) -> integer() when This :: wxStyledTextCtrl().

Get which document modification events are sent to the container.

The return value will wxSTCMODEVENTMASKALL if all changes generate events. Otherwise it will be a bit list containing one or more of the ?wxSTC_MOD\* constants, the ?wxSTC_PERFORMED_* constants, wxSTC_STARTACTION, wxSTC_MULTILINEUNDOREDO, wxSTC_MULTISTEPUNDOREDO, and wxSTC_LASTSTEPINUNDOREDO.

getModify(This)

-spec getModify(This) -> boolean() when This :: wxStyledTextCtrl().

Is the document different from when it was last saved?

getMouseDownCaptures(This)

-spec getMouseDownCaptures(This) -> boolean() when This :: wxStyledTextCtrl().

Get whether mouse gets captured.

getMouseDwellTime(This)

-spec getMouseDwellTime(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the time the mouse must sit still to generate a mouse dwell event.

The return value will be a time in milliseconds or wxSTC_TIME_FOREVER.

getOvertype(This)

-spec getOvertype(This) -> boolean() when This :: wxStyledTextCtrl().

Returns true if overtype mode is active otherwise false is returned.

getPasteConvertEndings(This)

-spec getPasteConvertEndings(This) -> boolean() when This :: wxStyledTextCtrl().

Get convert-on-paste setting.

getPrintColourMode(This)

-spec getPrintColourMode(This) -> integer() when This :: wxStyledTextCtrl().

Returns the print colour mode.

The return value will be one of the ?wxSTC_PRINT_* constants.

getPrintMagnification(This)

-spec getPrintMagnification(This) -> integer() when This :: wxStyledTextCtrl().

Returns the print magnification.

getPrintWrapMode(This)

-spec getPrintWrapMode(This) -> integer() when This :: wxStyledTextCtrl().

Is printing line wrapped?

The return value will be one of the ?wxSTC_WRAP_* constants.

getProperty(This, Key)

-spec getProperty(This, Key) -> unicode:charlist()
                     when This :: wxStyledTextCtrl(), Key :: unicode:chardata().

Retrieve a "property" value previously set with SetProperty.

getReadOnly(This)

-spec getReadOnly(This) -> boolean() when This :: wxStyledTextCtrl().

In read-only mode?

getScrollWidth(This)

-spec getScrollWidth(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the document width assumed for scrolling.

getSearchFlags(This)

-spec getSearchFlags(This) -> integer() when This :: wxStyledTextCtrl().

Get the search flags used by SearchInTarget.

The return value will be a bit list containing one or more of the ?wxSTC_FIND_* constants.

getSelAlpha(This)

-spec getSelAlpha(This) -> integer() when This :: wxStyledTextCtrl().

Get the alpha of the selection.

getSelectedText(This)

-spec getSelectedText(This) -> unicode:charlist() when This :: wxStyledTextCtrl().

Retrieve the selected text.

getSelectedTextRaw(This)

-spec getSelectedTextRaw(This) -> binary() when This :: wxStyledTextCtrl().

Retrieve the selected text.

getSelection(This)

-spec getSelection(This) -> {From :: integer(), To :: integer()} when This :: wxStyledTextCtrl().

Gets the current selection span.

If the returned values are equal, there was no selection. Please note that the indices returned may be used with the other wxTextCtrl methods but don't necessarily represent the correct indices into the string returned by wxComboBox:getValue/1 for multiline controls under Windows (at least,) you should use wxTextCtrl:getStringSelection/1 to get the selected text.

getSelectionEnd(This)

-spec getSelectionEnd(This) -> integer() when This :: wxStyledTextCtrl().

Returns the position at the end of the selection.

getSelectionMode(This)

-spec getSelectionMode(This) -> integer() when This :: wxStyledTextCtrl().

Get the mode of the current selection.

The return value will be one of the ?wxSTC_SEL_* constants.

getSelectionStart(This)

-spec getSelectionStart(This) -> integer() when This :: wxStyledTextCtrl().

Returns the position at the start of the selection.

getSTCCursor(This)

-spec getSTCCursor(This) -> integer() when This :: wxStyledTextCtrl().

Get cursor type.

The return value will be one of the ?wxSTC_CURSOR* constants.

getSTCFocus(This)

-spec getSTCFocus(This) -> boolean() when This :: wxStyledTextCtrl().

Get internal focus flag.

getStatus(This)

-spec getStatus(This) -> integer() when This :: wxStyledTextCtrl().

Get error status.

The return value will be one of the ?wxSTC_STATUS_* constants.

getStyleAt(This, Pos)

-spec getStyleAt(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Returns the style byte at the position.

getStyleBits(This)

-spec getStyleBits(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve number of bits in style bytes used to hold the lexical state.

Deprecated:

getStyleBitsNeeded(This)

-spec getStyleBitsNeeded(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the number of bits the current lexer needs for styling.

Deprecated:

getTabIndents(This)

-spec getTabIndents(This) -> boolean() when This :: wxStyledTextCtrl().

Does a tab pressed when caret is within indentation indent?

getTabWidth(This)

-spec getTabWidth(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the visible size of a tab.

getTargetEnd(This)

-spec getTargetEnd(This) -> integer() when This :: wxStyledTextCtrl().

Get the position that ends the target.

getTargetStart(This)

-spec getTargetStart(This) -> integer() when This :: wxStyledTextCtrl().

Get the position that starts the target.

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxStyledTextCtrl().

Retrieve all the text in the document.

getTextLength(This)

-spec getTextLength(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the number of characters in the document.

getTextRange(This, StartPos, EndPos)

-spec getTextRange(This, StartPos, EndPos) -> unicode:charlist()
                      when This :: wxStyledTextCtrl(), StartPos :: integer(), EndPos :: integer().

Retrieve a range of text.

getTextRangeRaw(This, StartPos, EndPos)

-spec getTextRangeRaw(This, StartPos, EndPos) -> binary()
                         when This :: wxStyledTextCtrl(), StartPos :: integer(), EndPos :: integer().

Retrieve a range of text.

getTextRaw(This)

-spec getTextRaw(This) -> binary() when This :: wxStyledTextCtrl().

Retrieve all the text in the document.

getTwoPhaseDraw(This)

-spec getTwoPhaseDraw(This) -> boolean() when This :: wxStyledTextCtrl().

Is drawing done in two phases with backgrounds drawn before foregrounds?

getUndoCollection(This)

-spec getUndoCollection(This) -> boolean() when This :: wxStyledTextCtrl().

Is undo history being collected?

getUseAntiAliasing(This)

-spec getUseAntiAliasing(This) -> boolean() when This :: wxStyledTextCtrl().

Returns the current UseAntiAliasing setting.

getUseHorizontalScrollBar(This)

-spec getUseHorizontalScrollBar(This) -> boolean() when This :: wxStyledTextCtrl().

Is the horizontal scroll bar visible?

getUseTabs(This)

-spec getUseTabs(This) -> boolean() when This :: wxStyledTextCtrl().

Retrieve whether tabs will be used in indentation.

getUseVerticalScrollBar(This)

-spec getUseVerticalScrollBar(This) -> boolean() when This :: wxStyledTextCtrl().

Is the vertical scroll bar visible?

getViewEOL(This)

-spec getViewEOL(This) -> boolean() when This :: wxStyledTextCtrl().

Are the end of line characters visible?

getViewWhiteSpace(This)

-spec getViewWhiteSpace(This) -> integer() when This :: wxStyledTextCtrl().

Are white space characters currently visible? Returns one of wxSTCWS* constants.

getWrapMode(This)

-spec getWrapMode(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve whether text is word wrapped.

The return value will be one of the ?wxSTC_WRAP_* constants.

getWrapStartIndent(This)

-spec getWrapStartIndent(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the start indent for wrapped lines.

getWrapVisualFlags(This)

-spec getWrapVisualFlags(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the display mode of visual flags for wrapped lines.

The return value will be a bit list containing one or more of the ?wxSTC_WRAPVISUALFLAG_* constants.

getWrapVisualFlagsLocation(This)

-spec getWrapVisualFlagsLocation(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the location of visual flags for wrapped lines.

The return value will be a bit list containing one or more of the ?wxSTC_WRAPVISUALFLAGLOC_* constants.

getXOffset(This)

-spec getXOffset(This) -> integer() when This :: wxStyledTextCtrl().

Get the xOffset (ie, horizontal scroll position).

getZoom(This)

-spec getZoom(This) -> integer() when This :: wxStyledTextCtrl().

Retrieve the zoom level.

gotoLine(This, Line)

-spec gotoLine(This, Line) -> ok when This :: wxStyledTextCtrl(), Line :: integer().

Set caret to start of a line and ensure it is visible.

gotoPos(This, Caret)

-spec gotoPos(This, Caret) -> ok when This :: wxStyledTextCtrl(), Caret :: integer().

Set caret to a position and ensure it is visible.

hideLines(This, LineStart, LineEnd)

-spec hideLines(This, LineStart, LineEnd) -> ok
                   when This :: wxStyledTextCtrl(), LineStart :: integer(), LineEnd :: integer().

Make a range of lines invisible.

hideSelection(This, Hide)

-spec hideSelection(This, Hide) -> ok when This :: wxStyledTextCtrl(), Hide :: boolean().

Draw the selection in normal style or with selection highlighted.

home(This)

-spec home(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position on line.

homeDisplay(This)

-spec homeDisplay(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position on display line.

homeDisplayExtend(This)

-spec homeDisplayExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position on display line extending selection to new caret position.

homeExtend(This)

-spec homeExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position on line extending selection to new caret position.

homeRectExtend(This)

-spec homeRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to first position on line, extending rectangular selection to new caret position.

homeWrapExtend(This)

-spec homeWrapExtend(This) -> ok when This :: wxStyledTextCtrl().

Like HomeExtend but when word-wrap is enabled extends first to start of display line HomeDisplayExtend, then to start of document line HomeExtend.

indicatorGetForeground(This, Indicator)

-spec indicatorGetForeground(This, Indicator) -> wx:wx_colour4()
                                when This :: wxStyledTextCtrl(), Indicator :: integer().

Retrieve the foreground colour of an indicator.

indicatorGetStyle(This, Indicator)

-spec indicatorGetStyle(This, Indicator) -> integer()
                           when This :: wxStyledTextCtrl(), Indicator :: integer().

Retrieve the style of an indicator.

The return value will be one of the ?wxSTC_INDIC_* constants.

indicatorSetForeground(This, Indicator, Fore)

-spec indicatorSetForeground(This, Indicator, Fore) -> ok
                                when
                                    This :: wxStyledTextCtrl(),
                                    Indicator :: integer(),
                                    Fore :: wx:wx_colour().

Set the foreground colour of an indicator.

indicatorSetStyle(This, Indicator, IndicatorStyle)

-spec indicatorSetStyle(This, Indicator, IndicatorStyle) -> ok
                           when
                               This :: wxStyledTextCtrl(),
                               Indicator :: integer(),
                               IndicatorStyle :: integer().

Set an indicator to plain, squiggle or TT.

The second argument should be one of the ?wxSTC_INDIC_* constants.

insertText(This, Pos, Text)

-spec insertText(This, Pos, Text) -> ok
                    when This :: wxStyledTextCtrl(), Pos :: integer(), Text :: unicode:chardata().

Insert string at a position.

insertTextRaw(This, Pos, Text)

-spec insertTextRaw(This, Pos, Text) -> ok
                       when This :: wxStyledTextCtrl(), Pos :: integer(), Text :: binary().

Insert string at a position.

lineCopy(This)

-spec lineCopy(This) -> ok when This :: wxStyledTextCtrl().

Copy the line containing the caret.

lineCut(This)

-spec lineCut(This) -> ok when This :: wxStyledTextCtrl().

Cut the line containing the caret.

lineDelete(This)

-spec lineDelete(This) -> ok when This :: wxStyledTextCtrl().

Delete the line containing the caret.

lineDown(This)

-spec lineDown(This) -> ok when This :: wxStyledTextCtrl().

Move caret down one line.

lineDownExtend(This)

-spec lineDownExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret down one line extending selection to new caret position.

lineDownRectExtend(This)

-spec lineDownRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret down one line, extending rectangular selection to new caret position.

lineDuplicate(This)

-spec lineDuplicate(This) -> ok when This :: wxStyledTextCtrl().

Duplicate the current line.

lineEnd(This)

-spec lineEnd(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position on line.

lineEndDisplay(This)

-spec lineEndDisplay(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position on display line.

lineEndDisplayExtend(This)

-spec lineEndDisplayExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position on display line extending selection to new caret position.

lineEndExtend(This)

-spec lineEndExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position on line extending selection to new caret position.

lineEndRectExtend(This)

-spec lineEndRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to last position on line, extending rectangular selection to new caret position.

lineEndWrap(This)

-spec lineEndWrap(This) -> ok when This :: wxStyledTextCtrl().

Like LineEnd but when word-wrap is enabled goes first to end of display line LineEndDisplay, then to start of document line LineEnd.

lineEndWrapExtend(This)

-spec lineEndWrapExtend(This) -> ok when This :: wxStyledTextCtrl().

Like LineEndExtend but when word-wrap is enabled extends first to end of display line LineEndDisplayExtend, then to start of document line LineEndExtend.

lineFromPosition(This, Pos)

-spec lineFromPosition(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Retrieve the line containing a position.

lineLength(This, Line)

-spec lineLength(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

How many characters are on a line, including end of line characters?

lineScroll(This, Columns, Lines)

-spec lineScroll(This, Columns, Lines) -> ok
                    when This :: wxStyledTextCtrl(), Columns :: integer(), Lines :: integer().

Scroll horizontally and vertically.

lineScrollDown(This)

-spec lineScrollDown(This) -> ok when This :: wxStyledTextCtrl().

Scroll the document down, keeping the caret visible.

lineScrollUp(This)

-spec lineScrollUp(This) -> ok when This :: wxStyledTextCtrl().

Scroll the document up, keeping the caret visible.

linesJoin(This)

-spec linesJoin(This) -> ok when This :: wxStyledTextCtrl().

Join the lines in the target.

linesOnScreen(This)

-spec linesOnScreen(This) -> integer() when This :: wxStyledTextCtrl().

Retrieves the number of lines completely visible.

linesSplit(This, PixelWidth)

-spec linesSplit(This, PixelWidth) -> ok when This :: wxStyledTextCtrl(), PixelWidth :: integer().

Split the lines in the target into lines that are less wide than pixelWidth where possible.

lineTranspose(This)

-spec lineTranspose(This) -> ok when This :: wxStyledTextCtrl().

Switch the current line with the previous.

lineUp(This)

-spec lineUp(This) -> ok when This :: wxStyledTextCtrl().

Move caret up one line.

lineUpExtend(This)

-spec lineUpExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret up one line extending selection to new caret position.

lineUpRectExtend(This)

-spec lineUpRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret up one line, extending rectangular selection to new caret position.

loadFile(This, Filename)

-spec loadFile(This, Filename) -> boolean()
                  when This :: wxStyledTextCtrl(), Filename :: unicode:chardata().

Load the contents of filename into the editor.

lowerCase(This)

-spec lowerCase(This) -> ok when This :: wxStyledTextCtrl().

Transform the selection to lower case.

markerAdd(This, Line, MarkerNumber)

-spec markerAdd(This, Line, MarkerNumber) -> integer()
                   when This :: wxStyledTextCtrl(), Line :: integer(), MarkerNumber :: integer().

Add a marker to a line, returning an ID which can be used to find or delete the marker.

markerAddSet(This, Line, MarkerSet)

-spec markerAddSet(This, Line, MarkerSet) -> ok
                      when This :: wxStyledTextCtrl(), Line :: integer(), MarkerSet :: integer().

Add a set of markers to a line.

markerDefine(This, MarkerNumber, MarkerSymbol)

-spec markerDefine(This, MarkerNumber, MarkerSymbol) -> ok
                      when
                          This :: wxStyledTextCtrl(),
                          MarkerNumber :: integer(),
                          MarkerSymbol :: integer().

Equivalent to markerDefine(This, MarkerNumber, MarkerSymbol, []).

markerDefine/4

-spec markerDefine(This, MarkerNumber, MarkerSymbol, [Option]) -> ok
                      when
                          This :: wxStyledTextCtrl(),
                          MarkerNumber :: integer(),
                          MarkerSymbol :: integer(),
                          Option :: {foreground, wx:wx_colour()} | {background, wx:wx_colour()}.

Set the symbol used for a particular marker number, and optionally the fore and background colours.

The second argument should be one of the ?wxSTC_MARK_* constants.

markerDefineBitmap(This, MarkerNumber, Bmp)

-spec markerDefineBitmap(This, MarkerNumber, Bmp) -> ok
                            when
                                This :: wxStyledTextCtrl(),
                                MarkerNumber :: integer(),
                                Bmp :: wxBitmap:wxBitmap().

Define a marker with a wxBitmap.

markerDelete(This, Line, MarkerNumber)

-spec markerDelete(This, Line, MarkerNumber) -> ok
                      when This :: wxStyledTextCtrl(), Line :: integer(), MarkerNumber :: integer().

Delete a marker from a line.

markerDeleteAll(This, MarkerNumber)

-spec markerDeleteAll(This, MarkerNumber) -> ok
                         when This :: wxStyledTextCtrl(), MarkerNumber :: integer().

Delete all markers with a particular number from all lines.

markerDeleteHandle(This, MarkerHandle)

-spec markerDeleteHandle(This, MarkerHandle) -> ok
                            when This :: wxStyledTextCtrl(), MarkerHandle :: integer().

Delete a marker.

markerGet(This, Line)

-spec markerGet(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Get a bit mask of all the markers set on a line.

markerLineFromHandle(This, MarkerHandle)

-spec markerLineFromHandle(This, MarkerHandle) -> integer()
                              when This :: wxStyledTextCtrl(), MarkerHandle :: integer().

Retrieve the line number at which a particular marker is located.

markerNext(This, LineStart, MarkerMask)

-spec markerNext(This, LineStart, MarkerMask) -> integer()
                    when This :: wxStyledTextCtrl(), LineStart :: integer(), MarkerMask :: integer().

Find the next line at or after lineStart that includes a marker in mask.

Return -1 when no more lines.

markerPrevious(This, LineStart, MarkerMask)

-spec markerPrevious(This, LineStart, MarkerMask) -> integer()
                        when This :: wxStyledTextCtrl(), LineStart :: integer(), MarkerMask :: integer().

Find the previous line before lineStart that includes a marker in mask.

markerSetAlpha(This, MarkerNumber, Alpha)

-spec markerSetAlpha(This, MarkerNumber, Alpha) -> ok
                        when This :: wxStyledTextCtrl(), MarkerNumber :: integer(), Alpha :: integer().

Set the alpha used for a marker that is drawn in the text area, not the margin.

markerSetBackground(This, MarkerNumber, Back)

-spec markerSetBackground(This, MarkerNumber, Back) -> ok
                             when
                                 This :: wxStyledTextCtrl(),
                                 MarkerNumber :: integer(),
                                 Back :: wx:wx_colour().

Set the background colour used for a particular marker number.

markerSetForeground(This, MarkerNumber, Fore)

-spec markerSetForeground(This, MarkerNumber, Fore) -> ok
                             when
                                 This :: wxStyledTextCtrl(),
                                 MarkerNumber :: integer(),
                                 Fore :: wx:wx_colour().

Set the foreground colour used for a particular marker number.

moveCaretInsideView(This)

-spec moveCaretInsideView(This) -> ok when This :: wxStyledTextCtrl().

Move the caret inside current view if it's not there already.

new()

-spec new() -> wxStyledTextCtrl().

Default ctor.

new(Parent)

-spec new(Parent) -> wxStyledTextCtrl() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxStyledTextCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Ctor.

newLine(This)

-spec newLine(This) -> ok when This :: wxStyledTextCtrl().

Insert a new line, may use a CRLF, CR or LF depending on EOL mode.

pageDown(This)

-spec pageDown(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page down.

pageDownExtend(This)

-spec pageDownExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page down extending selection to new caret position.

pageDownRectExtend(This)

-spec pageDownRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page down, extending rectangular selection to new caret position.

pageUp(This)

-spec pageUp(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page up.

pageUpExtend(This)

-spec pageUpExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page up extending selection to new caret position.

pageUpRectExtend(This)

-spec pageUpRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret one page up, extending rectangular selection to new caret position.

paraDownExtend(This)

-spec paraDownExtend(This) -> ok when This :: wxStyledTextCtrl().

Extend selection down one paragraph (delimited by empty lines).

paraUp(This)

-spec paraUp(This) -> ok when This :: wxStyledTextCtrl().

Move caret up one paragraph (delimited by empty lines).

paraUpExtend(This)

-spec paraUpExtend(This) -> ok when This :: wxStyledTextCtrl().

Extend selection up one paragraph (delimited by empty lines).

paste(This)

-spec paste(This) -> ok when This :: wxStyledTextCtrl().

Paste the contents of the clipboard into the document replacing the selection.

pointFromPosition(This, Pos)

-spec pointFromPosition(This, Pos) -> {X :: integer(), Y :: integer()}
                           when This :: wxStyledTextCtrl(), Pos :: integer().

Retrieve the point in the window where a position is displayed.

positionAfter(This, Pos)

-spec positionAfter(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Given a valid document position, return the next position taking code page into account.

Maximum value returned is the last position in the document.

positionBefore(This, Pos)

-spec positionBefore(This, Pos) -> integer() when This :: wxStyledTextCtrl(), Pos :: integer().

Given a valid document position, return the previous position taking code page into account.

Returns 0 if passed 0.

positionFromLine(This, Line)

-spec positionFromLine(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the position at the start of a line.

positionFromPoint(This, Pt)

-spec positionFromPoint(This, Pt) -> integer()
                           when This :: wxStyledTextCtrl(), Pt :: {X :: integer(), Y :: integer()}.

Find the position from a point within the window.

positionFromPointClose(This, X, Y)

-spec positionFromPointClose(This, X, Y) -> integer()
                                when This :: wxStyledTextCtrl(), X :: integer(), Y :: integer().

Find the position from a point within the window but return wxSTC_INVALID_POSITION if not close to text.

redo(This)

-spec redo(This) -> ok when This :: wxStyledTextCtrl().

Redoes the next action on the undo history.

registerImage(This, Type, Bmp)

-spec registerImage(This, Type, Bmp) -> ok
                       when This :: wxStyledTextCtrl(), Type :: integer(), Bmp :: wxBitmap:wxBitmap().

Register an image for use in autocompletion lists.

replaceSelection(This, Text)

-spec replaceSelection(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Replace the selected text with the argument text.

replaceTarget(This, Text)

-spec replaceTarget(This, Text) -> integer() when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Replace the target text with the argument text.

Text is counted so it can contain NULs. Returns the length of the replacement text.

saveFile(This, Filename)

-spec saveFile(This, Filename) -> boolean()
                  when This :: wxStyledTextCtrl(), Filename :: unicode:chardata().

Write the contents of the editor to filename.

scrollToColumn(This, Column)

-spec scrollToColumn(This, Column) -> ok when This :: wxStyledTextCtrl(), Column :: integer().

Scroll enough to make the given column visible.

scrollToLine(This, Line)

-spec scrollToLine(This, Line) -> ok when This :: wxStyledTextCtrl(), Line :: integer().

Scroll enough to make the given line visible.

searchAnchor(This)

-spec searchAnchor(This) -> ok when This :: wxStyledTextCtrl().

Sets the current caret position to be the search anchor.

searchInTarget(This, Text)

-spec searchInTarget(This, Text) -> integer()
                        when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Search for a counted string in the target and set the target to the found range.

Text is counted so it can contain NULs. Returns length of range or -1 for failure in which case target is not moved.

searchNext(This, SearchFlags, Text)

-spec searchNext(This, SearchFlags, Text) -> integer()
                    when
                        This :: wxStyledTextCtrl(), SearchFlags :: integer(), Text :: unicode:chardata().

Find some text starting at the search anchor.

Does not ensure the selection is visible.

searchPrev(This, SearchFlags, Text)

-spec searchPrev(This, SearchFlags, Text) -> integer()
                    when
                        This :: wxStyledTextCtrl(), SearchFlags :: integer(), Text :: unicode:chardata().

Find some text starting at the search anchor and moving backwards.

Does not ensure the selection is visible.

selectAll(This)

-spec selectAll(This) -> ok when This :: wxStyledTextCtrl().

Select all the text in the document.

selectionDuplicate(This)

-spec selectionDuplicate(This) -> ok when This :: wxStyledTextCtrl().

Duplicate the selection.

If selection empty duplicate the line containing the caret.

selectionIsRectangle(This)

-spec selectionIsRectangle(This) -> boolean() when This :: wxStyledTextCtrl().

Is the selection rectangular? The alternative is the more common stream selection.

setAnchor(This, Anchor)

-spec setAnchor(This, Anchor) -> ok when This :: wxStyledTextCtrl(), Anchor :: integer().

Set the selection anchor to a position.

The anchor is the opposite end of the selection from the caret.

setBackSpaceUnIndents(This, BsUnIndents)

-spec setBackSpaceUnIndents(This, BsUnIndents) -> ok
                               when This :: wxStyledTextCtrl(), BsUnIndents :: boolean().

Sets whether a backspace pressed when caret is within indentation unindents.

setBufferedDraw(This, Buffered)

-spec setBufferedDraw(This, Buffered) -> ok when This :: wxStyledTextCtrl(), Buffered :: boolean().

If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.

setCaretForeground(This, Fore)

-spec setCaretForeground(This, Fore) -> ok when This :: wxStyledTextCtrl(), Fore :: wx:wx_colour().

Set the foreground colour of the caret.

setCaretLineBackAlpha(This, Alpha)

-spec setCaretLineBackAlpha(This, Alpha) -> ok when This :: wxStyledTextCtrl(), Alpha :: integer().

Set background alpha of the caret line.

setCaretLineBackground(This, Back)

-spec setCaretLineBackground(This, Back) -> ok when This :: wxStyledTextCtrl(), Back :: wx:wx_colour().

Set the colour of the background of the line containing the caret.

setCaretLineVisible(This, Show)

-spec setCaretLineVisible(This, Show) -> ok when This :: wxStyledTextCtrl(), Show :: boolean().

Display the background of the line containing the caret in a different colour.

setCaretPeriod(This, PeriodMilliseconds)

-spec setCaretPeriod(This, PeriodMilliseconds) -> ok
                        when This :: wxStyledTextCtrl(), PeriodMilliseconds :: integer().

Get the time in milliseconds that the caret is on and off.

0 = steady on.

setCaretSticky(This, UseCaretStickyBehaviour)

-spec setCaretSticky(This, UseCaretStickyBehaviour) -> ok
                        when This :: wxStyledTextCtrl(), UseCaretStickyBehaviour :: integer().

Stop the caret preferred x position changing when the user types.

The input should be one of the ?wxSTC_CARETSTICKY_* constants.

setCaretWidth(This, PixelWidth)

-spec setCaretWidth(This, PixelWidth) -> ok when This :: wxStyledTextCtrl(), PixelWidth :: integer().

Set the width of the insert mode caret.

setCharsDefault(This)

-spec setCharsDefault(This) -> ok when This :: wxStyledTextCtrl().

Reset the set of characters for whitespace and word characters to the defaults.

setCodePage(This, CodePage)

-spec setCodePage(This, CodePage) -> ok when This :: wxStyledTextCtrl(), CodePage :: integer().

Set the code page used to interpret the bytes of the document as characters.

setControlCharSymbol(This, Symbol)

-spec setControlCharSymbol(This, Symbol) -> ok when This :: wxStyledTextCtrl(), Symbol :: integer().

Change the way control characters are displayed: If symbol is *< 32, keep the drawn way, else, use the given character.

setCurrentPos(This, Caret)

-spec setCurrentPos(This, Caret) -> ok when This :: wxStyledTextCtrl(), Caret :: integer().

Sets the position of the caret.

setEdgeColour(This, EdgeColour)

-spec setEdgeColour(This, EdgeColour) -> ok
                       when This :: wxStyledTextCtrl(), EdgeColour :: wx:wx_colour().

Change the colour used in edge indication.

setEdgeColumn(This, Column)

-spec setEdgeColumn(This, Column) -> ok when This :: wxStyledTextCtrl(), Column :: integer().

Set the column number of the edge.

If text goes past the edge then it is highlighted.

setEdgeMode(This, EdgeMode)

-spec setEdgeMode(This, EdgeMode) -> ok when This :: wxStyledTextCtrl(), EdgeMode :: integer().

The edge may be displayed by a line (wxSTC_EDGE_LINE/wxSTC_EDGE_MULTILINE) or by highlighting text that goes beyond it (wxSTC_EDGE_BACKGROUND) or not displayed at all (wxSTC_EDGE_NONE).

The input should be one of the ?wxSTC_EDGE_* constants.

setEOLMode(This, EolMode)

-spec setEOLMode(This, EolMode) -> ok when This :: wxStyledTextCtrl(), EolMode :: integer().

Set the current end of line mode.

The input should be one of the ?wxSTC_EOL_* constants.

setFoldExpanded(This, Line, Expanded)

-spec setFoldExpanded(This, Line, Expanded) -> ok
                         when This :: wxStyledTextCtrl(), Line :: integer(), Expanded :: boolean().

Show the children of a header line.

setFoldFlags(This, Flags)

-spec setFoldFlags(This, Flags) -> ok when This :: wxStyledTextCtrl(), Flags :: integer().

Set some style options for folding.

The second argument should be a bit list containing one or more of the ?wxSTC_FOLDFLAG_* constants.

setFoldLevel(This, Line, Level)

-spec setFoldLevel(This, Line, Level) -> ok
                      when This :: wxStyledTextCtrl(), Line :: integer(), Level :: integer().

Set the fold level of a line.

This encodes an integer level along with flags indicating whether the line is a header and whether it is effectively white space.

setFoldMarginColour(This, UseSetting, Back)

-spec setFoldMarginColour(This, UseSetting, Back) -> ok
                             when
                                 This :: wxStyledTextCtrl(),
                                 UseSetting :: boolean(),
                                 Back :: wx:wx_colour().

Set one of the colours used as a chequerboard pattern in the fold margin.

setFoldMarginHiColour(This, UseSetting, Fore)

-spec setFoldMarginHiColour(This, UseSetting, Fore) -> ok
                               when
                                   This :: wxStyledTextCtrl(),
                                   UseSetting :: boolean(),
                                   Fore :: wx:wx_colour().

Set the other colour used as a chequerboard pattern in the fold margin.

setHighlightGuide(This, Column)

-spec setHighlightGuide(This, Column) -> ok when This :: wxStyledTextCtrl(), Column :: integer().

Set the highlighted indentation guide column.

0 = no highlighted guide.

setHotspotActiveBackground(This, UseSetting, Back)

-spec setHotspotActiveBackground(This, UseSetting, Back) -> ok
                                    when
                                        This :: wxStyledTextCtrl(),
                                        UseSetting :: boolean(),
                                        Back :: wx:wx_colour().

Set a back colour for active hotspots.

setHotspotActiveForeground(This, UseSetting, Fore)

-spec setHotspotActiveForeground(This, UseSetting, Fore) -> ok
                                    when
                                        This :: wxStyledTextCtrl(),
                                        UseSetting :: boolean(),
                                        Fore :: wx:wx_colour().

Set a fore colour for active hotspots.

setHotspotActiveUnderline(This, Underline)

-spec setHotspotActiveUnderline(This, Underline) -> ok
                                   when This :: wxStyledTextCtrl(), Underline :: boolean().

Enable / Disable underlining active hotspots.

setHotspotSingleLine(This, SingleLine)

-spec setHotspotSingleLine(This, SingleLine) -> ok
                              when This :: wxStyledTextCtrl(), SingleLine :: boolean().

Limit hotspots to single line so hotspots on two lines don't merge.

setHScrollBar(This, Bar)

-spec setHScrollBar(This, Bar) -> ok when This :: wxStyledTextCtrl(), Bar :: wxScrollBar:wxScrollBar().

Set the horizontal scrollbar to use instead of the one that's built-in.

setIndent(This, IndentSize)

-spec setIndent(This, IndentSize) -> ok when This :: wxStyledTextCtrl(), IndentSize :: integer().

Set the number of spaces used for one level of indentation.

setIndentationGuides(This, IndentView)

-spec setIndentationGuides(This, IndentView) -> ok
                              when This :: wxStyledTextCtrl(), IndentView :: integer().

Show or hide indentation guides.

The input should be one of the ?wxSTC_IV_* constants.

setKeyWords(This, KeyWordSet, KeyWords)

-spec setKeyWords(This, KeyWordSet, KeyWords) -> ok
                     when
                         This :: wxStyledTextCtrl(),
                         KeyWordSet :: integer(),
                         KeyWords :: unicode:chardata().

Set up the key words used by the lexer.

setLastKeydownProcessed(This, Val)

-spec setLastKeydownProcessed(This, Val) -> ok when This :: wxStyledTextCtrl(), Val :: boolean().

Returns the line number of the line with the caret.

setLayoutCache(This, CacheMode)

-spec setLayoutCache(This, CacheMode) -> ok when This :: wxStyledTextCtrl(), CacheMode :: integer().

Sets the degree of caching of layout information.

The input should be one of the ?wxSTC_CACHE_* constants.

setLexer(This, Lexer)

-spec setLexer(This, Lexer) -> ok when This :: wxStyledTextCtrl(), Lexer :: integer().

Set the lexing language of the document.

The input should be one of the ?wxSTC_LEX_* constants.

setLexerLanguage(This, Language)

-spec setLexerLanguage(This, Language) -> ok
                          when This :: wxStyledTextCtrl(), Language :: unicode:chardata().

Set the lexing language of the document based on string name.

setLineIndentation(This, Line, Indentation)

-spec setLineIndentation(This, Line, Indentation) -> ok
                            when This :: wxStyledTextCtrl(), Line :: integer(), Indentation :: integer().

Change the indentation of a line to a number of columns.

setLineState(This, Line, State)

-spec setLineState(This, Line, State) -> ok
                      when This :: wxStyledTextCtrl(), Line :: integer(), State :: integer().

Used to hold extra styling information for each line.

setMarginLeft(This, PixelWidth)

-spec setMarginLeft(This, PixelWidth) -> ok when This :: wxStyledTextCtrl(), PixelWidth :: integer().

Sets the size in pixels of the left margin.

setMarginMask(This, Margin, Mask)

-spec setMarginMask(This, Margin, Mask) -> ok
                       when This :: wxStyledTextCtrl(), Margin :: integer(), Mask :: integer().

Set a mask that determines which markers are displayed in a margin.

setMarginRight(This, PixelWidth)

-spec setMarginRight(This, PixelWidth) -> ok when This :: wxStyledTextCtrl(), PixelWidth :: integer().

Sets the size in pixels of the right margin.

setMarginSensitive(This, Margin, Sensitive)

-spec setMarginSensitive(This, Margin, Sensitive) -> ok
                            when This :: wxStyledTextCtrl(), Margin :: integer(), Sensitive :: boolean().

Make a margin sensitive or insensitive to mouse clicks.

setMargins(This, Left, Right)

-spec setMargins(This, Left, Right) -> ok
                    when This :: wxStyledTextCtrl(), Left :: integer(), Right :: integer().

Set the left and right margin in the edit area, measured in pixels.

setMarginType(This, Margin, MarginType)

-spec setMarginType(This, Margin, MarginType) -> ok
                       when This :: wxStyledTextCtrl(), Margin :: integer(), MarginType :: integer().

Set a margin to be either numeric or symbolic.

The second argument should be one of the ?wxSTC_MARGIN_* constants.

setMarginWidth(This, Margin, PixelWidth)

-spec setMarginWidth(This, Margin, PixelWidth) -> ok
                        when This :: wxStyledTextCtrl(), Margin :: integer(), PixelWidth :: integer().

Set the width of a margin to a width expressed in pixels.

setModEventMask(This, EventMask)

-spec setModEventMask(This, EventMask) -> ok when This :: wxStyledTextCtrl(), EventMask :: integer().

Set which document modification events are sent to the container.

The input should be a bit list containing one or more of the ?wxSTC_MOD_* constants, the ?wxSTC_PERFORMED_* constants, wxSTC_STARTACTION, wxSTC_MULTILINEUNDOREDO, wxSTC_MULTISTEPUNDOREDO, and wxSTC_LASTSTEPINUNDOREDO. The input can also be wxSTC_MODEVENTMASKALL to indicate that all changes should generate events.

setMouseDownCaptures(This, Captures)

-spec setMouseDownCaptures(This, Captures) -> ok when This :: wxStyledTextCtrl(), Captures :: boolean().

Set whether the mouse is captured when its button is pressed.

setMouseDwellTime(This, PeriodMilliseconds)

-spec setMouseDwellTime(This, PeriodMilliseconds) -> ok
                           when This :: wxStyledTextCtrl(), PeriodMilliseconds :: integer().

Sets the time the mouse must sit still to generate a mouse dwell event.

The input should be a time in milliseconds or wxSTC_TIME_FOREVER.

setPasteConvertEndings(This, Convert)

-spec setPasteConvertEndings(This, Convert) -> ok when This :: wxStyledTextCtrl(), Convert :: boolean().

Enable/Disable convert-on-paste for line endings.

setPrintColourMode(This, Mode)

-spec setPrintColourMode(This, Mode) -> ok when This :: wxStyledTextCtrl(), Mode :: integer().

Modify colours when printing for clearer printed text.

The input should be one of the ?wxSTC_PRINT_* constants.

setPrintMagnification(This, Magnification)

-spec setPrintMagnification(This, Magnification) -> ok
                               when This :: wxStyledTextCtrl(), Magnification :: integer().

Sets the print magnification added to the point size of each style for printing.

setProperty(This, Key, Value)

-spec setProperty(This, Key, Value) -> ok
                     when
                         This :: wxStyledTextCtrl(),
                         Key :: unicode:chardata(),
                         Value :: unicode:chardata().

Set up a value that may be used by a lexer for some optional feature.

setReadOnly(This, ReadOnly)

-spec setReadOnly(This, ReadOnly) -> ok when This :: wxStyledTextCtrl(), ReadOnly :: boolean().

Set to read only or read write.

setSavePoint(This)

-spec setSavePoint(This) -> ok when This :: wxStyledTextCtrl().

Remember the current position in the undo history as the position at which the document was saved.

setScrollWidth(This, PixelWidth)

-spec setScrollWidth(This, PixelWidth) -> ok when This :: wxStyledTextCtrl(), PixelWidth :: integer().

Sets the document width assumed for scrolling.

setSearchFlags(This, SearchFlags)

-spec setSearchFlags(This, SearchFlags) -> ok when This :: wxStyledTextCtrl(), SearchFlags :: integer().

Set the search flags used by SearchInTarget.

The input should be a bit list containing one or more of the ?wxSTC_FIND_* constants.

setSelAlpha(This, Alpha)

-spec setSelAlpha(This, Alpha) -> ok when This :: wxStyledTextCtrl(), Alpha :: integer().

Set the alpha of the selection.

setSelBackground(This, UseSetting, Back)

-spec setSelBackground(This, UseSetting, Back) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              UseSetting :: boolean(),
                              Back :: wx:wx_colour().

Set the background colour of the main and additional selections and whether to use this setting.

setSelection(This, From, To)

-spec setSelection(This, From, To) -> ok
                      when This :: wxStyledTextCtrl(), From :: integer(), To :: integer().

Selects the text starting at the first position up to (but not including) the character at the last position.

If both parameters are equal to -1 all text in the control is selected.

Notice that the insertion point will be moved to from by this function.

See: selectAll/1

setSelectionEnd(This, Caret)

-spec setSelectionEnd(This, Caret) -> ok when This :: wxStyledTextCtrl(), Caret :: integer().

Sets the position that ends the selection - this becomes the caret.

setSelectionMode(This, SelectionMode)

-spec setSelectionMode(This, SelectionMode) -> ok
                          when This :: wxStyledTextCtrl(), SelectionMode :: integer().

Set the selection mode to stream (wxSTC_SEL_STREAM) or rectangular (wxSTC_SEL_RECTANGLE/wxSTC_SEL_THIN) or by lines (wxSTC_SEL_LINES).

setSelectionStart(This, Anchor)

-spec setSelectionStart(This, Anchor) -> ok when This :: wxStyledTextCtrl(), Anchor :: integer().

Sets the position that starts the selection - this becomes the anchor.

setSelForeground(This, UseSetting, Fore)

-spec setSelForeground(This, UseSetting, Fore) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              UseSetting :: boolean(),
                              Fore :: wx:wx_colour().

Set the foreground colour of the main and additional selections and whether to use this setting.

setSTCCursor(This, CursorType)

-spec setSTCCursor(This, CursorType) -> ok when This :: wxStyledTextCtrl(), CursorType :: integer().

Sets the cursor to one of the wxSTC_CURSOR* values.

setSTCFocus(This, Focus)

-spec setSTCFocus(This, Focus) -> ok when This :: wxStyledTextCtrl(), Focus :: boolean().

Change internal focus flag.

setStatus(This, Status)

-spec setStatus(This, Status) -> ok when This :: wxStyledTextCtrl(), Status :: integer().

Change error status - 0 = OK.

The input should be one of the ?wxSTC_STATUS_* constants.

setStyleBytes(This, Length)

-spec setStyleBytes(This, Length) -> integer() when This :: wxStyledTextCtrl(), Length :: integer().

Set the styles for a segment of the document.

setStyling(This, Length, Style)

-spec setStyling(This, Length, Style) -> ok
                    when This :: wxStyledTextCtrl(), Length :: integer(), Style :: integer().

Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.

setTabIndents(This, TabIndents)

-spec setTabIndents(This, TabIndents) -> ok when This :: wxStyledTextCtrl(), TabIndents :: boolean().

Sets whether a tab pressed when caret is within indentation indents.

setTabWidth(This, TabWidth)

-spec setTabWidth(This, TabWidth) -> ok when This :: wxStyledTextCtrl(), TabWidth :: integer().

Change the visible size of a tab to be a multiple of the width of a space character.

setTargetEnd(This, End)

-spec setTargetEnd(This, End) -> ok when This :: wxStyledTextCtrl(), End :: integer().

Sets the position that ends the target which is used for updating the document without affecting the scroll position.

setTargetStart(This, Start)

-spec setTargetStart(This, Start) -> ok when This :: wxStyledTextCtrl(), Start :: integer().

Sets the position that starts the target which is used for updating the document without affecting the scroll position.

setText(This, Text)

-spec setText(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: unicode:chardata().

Replace the contents of the document with the argument text.

setTextRaw(This, Text)

-spec setTextRaw(This, Text) -> ok when This :: wxStyledTextCtrl(), Text :: binary().

Replace the contents of the document with the argument text.

setTwoPhaseDraw(This, TwoPhase)

-spec setTwoPhaseDraw(This, TwoPhase) -> ok when This :: wxStyledTextCtrl(), TwoPhase :: boolean().

In twoPhaseDraw mode, drawing is performed in two phases, first the background and then the foreground.

This avoids chopping off characters that overlap the next run.

setUndoCollection(This, CollectUndo)

-spec setUndoCollection(This, CollectUndo) -> ok
                           when This :: wxStyledTextCtrl(), CollectUndo :: boolean().

Choose between collecting actions into the undo history and discarding them.

setUseHorizontalScrollBar(This, Visible)

-spec setUseHorizontalScrollBar(This, Visible) -> ok
                                   when This :: wxStyledTextCtrl(), Visible :: boolean().

Show or hide the horizontal scroll bar.

setUseTabs(This, UseTabs)

-spec setUseTabs(This, UseTabs) -> ok when This :: wxStyledTextCtrl(), UseTabs :: boolean().

Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.

setUseVerticalScrollBar(This, Visible)

-spec setUseVerticalScrollBar(This, Visible) -> ok when This :: wxStyledTextCtrl(), Visible :: boolean().

Show or hide the vertical scroll bar.

setViewEOL(This, Visible)

-spec setViewEOL(This, Visible) -> ok when This :: wxStyledTextCtrl(), Visible :: boolean().

Make the end of line characters visible or invisible.

setViewWhiteSpace(This, ViewWS)

-spec setViewWhiteSpace(This, ViewWS) -> ok when This :: wxStyledTextCtrl(), ViewWS :: integer().

Make white space characters invisible, always visible or visible outside indentation.

The input should be one of the ?wxSTC_WS_* constants.

setVisiblePolicy(This, VisiblePolicy, VisibleSlop)

-spec setVisiblePolicy(This, VisiblePolicy, VisibleSlop) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              VisiblePolicy :: integer(),
                              VisibleSlop :: integer().

Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.

The first argument should be a bit list containing one or more of the ?wxSTC_VISIBLE_* constants.

setVScrollBar(This, Bar)

-spec setVScrollBar(This, Bar) -> ok when This :: wxStyledTextCtrl(), Bar :: wxScrollBar:wxScrollBar().

Set the vertical scrollbar to use instead of the one that's built-in.

setWhitespaceBackground(This, UseSetting, Back)

-spec setWhitespaceBackground(This, UseSetting, Back) -> ok
                                 when
                                     This :: wxStyledTextCtrl(),
                                     UseSetting :: boolean(),
                                     Back :: wx:wx_colour().

Set the background colour of all whitespace and whether to use this setting.

setWhitespaceChars(This, Characters)

-spec setWhitespaceChars(This, Characters) -> ok
                            when This :: wxStyledTextCtrl(), Characters :: unicode:chardata().

Set the set of characters making up whitespace for when moving or selecting by word.

Should be called after SetWordChars.

setWhitespaceForeground(This, UseSetting, Fore)

-spec setWhitespaceForeground(This, UseSetting, Fore) -> ok
                                 when
                                     This :: wxStyledTextCtrl(),
                                     UseSetting :: boolean(),
                                     Fore :: wx:wx_colour().

Set the foreground colour of all whitespace and whether to use this setting.

setWordChars(This, Characters)

-spec setWordChars(This, Characters) -> ok
                      when This :: wxStyledTextCtrl(), Characters :: unicode:chardata().

Set the set of characters making up words for when moving or selecting by word.

First sets defaults like SetCharsDefault.

setWrapMode(This, WrapMode)

-spec setWrapMode(This, WrapMode) -> ok when This :: wxStyledTextCtrl(), WrapMode :: integer().

Sets whether text is word wrapped.

The input should be one of the ?wxSTC_WRAP_* constants.

setWrapStartIndent(This, Indent)

-spec setWrapStartIndent(This, Indent) -> ok when This :: wxStyledTextCtrl(), Indent :: integer().

Set the start indent for wrapped lines.

setWrapVisualFlags(This, WrapVisualFlags)

-spec setWrapVisualFlags(This, WrapVisualFlags) -> ok
                            when This :: wxStyledTextCtrl(), WrapVisualFlags :: integer().

Set the display mode of visual flags for wrapped lines.

The input should be a bit list containing one or more of the ?wxSTC_WRAPVISUALFLAG_* constants.

setWrapVisualFlagsLocation(This, WrapVisualFlagsLocation)

-spec setWrapVisualFlagsLocation(This, WrapVisualFlagsLocation) -> ok
                                    when
                                        This :: wxStyledTextCtrl(), WrapVisualFlagsLocation :: integer().

Set the location of visual flags for wrapped lines.

The input should be a bit list containing one or more of the ?wxSTC_WRAPVISUALFLAGLOC_* constants.

setXCaretPolicy(This, CaretPolicy, CaretSlop)

-spec setXCaretPolicy(This, CaretPolicy, CaretSlop) -> ok
                         when
                             This :: wxStyledTextCtrl(),
                             CaretPolicy :: integer(),
                             CaretSlop :: integer().

Set the way the caret is kept visible when going sideways.

The exclusion zone is given in pixels.

The first argument should be a bit list containing one or more of the ?wxSTC_CARET_* constants.

setYCaretPolicy(This, CaretPolicy, CaretSlop)

-spec setYCaretPolicy(This, CaretPolicy, CaretSlop) -> ok
                         when
                             This :: wxStyledTextCtrl(),
                             CaretPolicy :: integer(),
                             CaretSlop :: integer().

Set the way the line the caret is on is kept visible.

The exclusion zone is given in lines.

The first argument should be a bit list containing one or more of the ?wxSTC_CARET_* constants.

setZoom(This, ZoomInPoints)

-spec setZoom(This, ZoomInPoints) -> ok when This :: wxStyledTextCtrl(), ZoomInPoints :: integer().

Set the zoom level.

This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce.

showLines(This, LineStart, LineEnd)

-spec showLines(This, LineStart, LineEnd) -> ok
                   when This :: wxStyledTextCtrl(), LineStart :: integer(), LineEnd :: integer().

Make a range of lines visible.

startRecord(This)

-spec startRecord(This) -> ok when This :: wxStyledTextCtrl().

Start notifying the container of all key presses and commands.

startStyling(This, Start)

-spec startStyling(This, Start) -> ok when This :: wxStyledTextCtrl(), Start :: integer().

Set the current styling position to start.

stopRecord(This)

-spec stopRecord(This) -> ok when This :: wxStyledTextCtrl().

Stop notifying the container of all key presses and commands.

stutteredPageDown(This)

-spec stutteredPageDown(This) -> ok when This :: wxStyledTextCtrl().

Move caret to bottom of page, or one page down if already at bottom of page.

stutteredPageDownExtend(This)

-spec stutteredPageDownExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.

stutteredPageUp(This)

-spec stutteredPageUp(This) -> ok when This :: wxStyledTextCtrl().

Move caret to top of page, or one page up if already at top of page.

stutteredPageUpExtend(This)

-spec stutteredPageUpExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.

styleClearAll(This)

-spec styleClearAll(This) -> ok when This :: wxStyledTextCtrl().

Clear all the styles and make equivalent to the global default style.

styleResetDefault(This)

-spec styleResetDefault(This) -> ok when This :: wxStyledTextCtrl().

Reset the default style to its state at startup.

styleSetBackground(This, Style, Back)

-spec styleSetBackground(This, Style, Back) -> ok
                            when This :: wxStyledTextCtrl(), Style :: integer(), Back :: wx:wx_colour().

Set the background colour of a style.

styleSetBold(This, Style, Bold)

-spec styleSetBold(This, Style, Bold) -> ok
                      when This :: wxStyledTextCtrl(), Style :: integer(), Bold :: boolean().

Set a style to be bold or not.

styleSetCase(This, Style, CaseVisible)

-spec styleSetCase(This, Style, CaseVisible) -> ok
                      when This :: wxStyledTextCtrl(), Style :: integer(), CaseVisible :: integer().

Set a style to be mixed case, or to force upper or lower case.

The second argument should be one of the ?wxSTC_CASE_* constants.

styleSetCharacterSet(This, Style, CharacterSet)

-spec styleSetCharacterSet(This, Style, CharacterSet) -> ok
                              when
                                  This :: wxStyledTextCtrl(),
                                  Style :: integer(),
                                  CharacterSet :: integer().

Set the character set of the font in a style.

Converts the Scintilla character set values to a wxFontEncoding.

styleSetEOLFilled(This, Style, EolFilled)

-spec styleSetEOLFilled(This, Style, EolFilled) -> ok
                           when This :: wxStyledTextCtrl(), Style :: integer(), EolFilled :: boolean().

Set a style to have its end of line filled or not.

styleSetFaceName(This, Style, FontName)

-spec styleSetFaceName(This, Style, FontName) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              Style :: integer(),
                              FontName :: unicode:chardata().

Set the font of a style.

styleSetFont(This, StyleNum, Font)

-spec styleSetFont(This, StyleNum, Font) -> ok
                      when This :: wxStyledTextCtrl(), StyleNum :: integer(), Font :: wxFont:wxFont().

Set style size, face, bold, italic, and underline attributes from a wxFont's attributes.

styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline)

-spec styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              StyleNum :: integer(),
                              Size :: integer(),
                              FaceName :: unicode:chardata(),
                              Bold :: boolean(),
                              Italic :: boolean(),
                              Underline :: boolean().

Equivalent to styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline, []).

styleSetFontAttr/8

-spec styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline, [Option]) -> ok
                          when
                              This :: wxStyledTextCtrl(),
                              StyleNum :: integer(),
                              Size :: integer(),
                              FaceName :: unicode:chardata(),
                              Bold :: boolean(),
                              Italic :: boolean(),
                              Underline :: boolean(),
                              Option :: {encoding, wx:wx_enum()}.

Set all font style attributes at once.

styleSetFontEncoding(This, Style, Encoding)

-spec styleSetFontEncoding(This, Style, Encoding) -> ok
                              when
                                  This :: wxStyledTextCtrl(),
                                  Style :: integer(),
                                  Encoding :: wx:wx_enum().

Set the font encoding to be used by a style.

styleSetForeground(This, Style, Fore)

-spec styleSetForeground(This, Style, Fore) -> ok
                            when This :: wxStyledTextCtrl(), Style :: integer(), Fore :: wx:wx_colour().

Set the foreground colour of a style.

styleSetHotSpot(This, Style, Hotspot)

-spec styleSetHotSpot(This, Style, Hotspot) -> ok
                         when This :: wxStyledTextCtrl(), Style :: integer(), Hotspot :: boolean().

Set a style to be a hotspot or not.

styleSetItalic(This, Style, Italic)

-spec styleSetItalic(This, Style, Italic) -> ok
                        when This :: wxStyledTextCtrl(), Style :: integer(), Italic :: boolean().

Set a style to be italic or not.

styleSetSize(This, Style, SizePoints)

-spec styleSetSize(This, Style, SizePoints) -> ok
                      when This :: wxStyledTextCtrl(), Style :: integer(), SizePoints :: integer().

Set the size of characters of a style.

styleSetSpec(This, StyleNum, Spec)

-spec styleSetSpec(This, StyleNum, Spec) -> ok
                      when This :: wxStyledTextCtrl(), StyleNum :: integer(), Spec :: unicode:chardata().

Extract style settings from a spec-string which is composed of one or more of the following comma separated elements:

bold turns on bold italic turns on italics fore:[name or #RRGGBB] sets the foreground colour back:[name or #RRGGBB] sets the background colour face:[facename] sets the font face name to use size:[num] sets the font size in points eol turns on eol filling underline turns on underlining

styleSetUnderline(This, Style, Underline)

-spec styleSetUnderline(This, Style, Underline) -> ok
                           when This :: wxStyledTextCtrl(), Style :: integer(), Underline :: boolean().

Set a style to be underlined or not.

styleSetVisible(This, Style, Visible)

-spec styleSetVisible(This, Style, Visible) -> ok
                         when This :: wxStyledTextCtrl(), Style :: integer(), Visible :: boolean().

Set a style to be visible or not.

tab(This)

-spec tab(This) -> ok when This :: wxStyledTextCtrl().

If selection is empty or all on one line replace the selection with a tab character.

If more than one line selected, indent the lines.

targetFromSelection(This)

-spec targetFromSelection(This) -> ok when This :: wxStyledTextCtrl().

Make the target range start and end be the same as the selection range start and end.

textHeight(This, Line)

-spec textHeight(This, Line) -> integer() when This :: wxStyledTextCtrl(), Line :: integer().

Retrieve the height of a particular line of text in pixels.

textWidth(This, Style, Text)

-spec textWidth(This, Style, Text) -> integer()
                   when This :: wxStyledTextCtrl(), Style :: integer(), Text :: unicode:chardata().

Measure the pixel width of some text in a particular style.

Does not handle tab or control characters.

toggleCaretSticky(This)

-spec toggleCaretSticky(This) -> ok when This :: wxStyledTextCtrl().

Switch between sticky and non-sticky: meant to be bound to a key.

toggleFold(This, Line)

-spec toggleFold(This, Line) -> ok when This :: wxStyledTextCtrl(), Line :: integer().

Switch a header line between expanded and contracted.

undo(This)

-spec undo(This) -> ok when This :: wxStyledTextCtrl().

Undo one action in the undo history.

upperCase(This)

-spec upperCase(This) -> ok when This :: wxStyledTextCtrl().

Transform the selection to upper case.

usePopUp(This, PopUpMode)

-spec usePopUp(This, PopUpMode) -> ok when This :: wxStyledTextCtrl(), PopUpMode :: integer().

Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button on certain areas.

The input should be one of the ?wxSTC_POPUP_* constants.

Remark: When wxContextMenuEvent is used to create a custom popup menu, this function should be called with wxSTC_POPUP_NEVER. Otherwise the default menu will be shown instead of the custom one.

userListShow(This, ListType, ItemList)

-spec userListShow(This, ListType, ItemList) -> ok
                      when
                          This :: wxStyledTextCtrl(),
                          ListType :: integer(),
                          ItemList :: unicode:chardata().

Display a list of strings and send notification when user chooses one.

vCHome(This)

-spec vCHome(This) -> ok when This :: wxStyledTextCtrl().

Move caret to before first visible character on line.

If already there move to first character on line.

vCHomeExtend(This)

-spec vCHomeExtend(This) -> ok when This :: wxStyledTextCtrl().

Like VCHome but extending selection to new caret position.

vCHomeRectExtend(This)

-spec vCHomeRectExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret to before first visible character on line.

If already there move to first character on line. In either case, extend rectangular selection to new caret position.

vCHomeWrap(This)

-spec vCHomeWrap(This) -> ok when This :: wxStyledTextCtrl().

Like VCHome but when word-wrap is enabled goes first to start of display line VCHomeDisplay, then behaves like VCHome.

vCHomeWrapExtend(This)

-spec vCHomeWrapExtend(This) -> ok when This :: wxStyledTextCtrl().

Like VCHomeExtend but when word-wrap is enabled extends first to start of display line VCHomeDisplayExtend, then behaves like VCHomeExtend.

visibleFromDocLine(This, DocLine)

-spec visibleFromDocLine(This, DocLine) -> integer()
                            when This :: wxStyledTextCtrl(), DocLine :: integer().

Find the display line of a document line taking hidden lines into account.

wordEndPosition(This, Pos, OnlyWordCharacters)

-spec wordEndPosition(This, Pos, OnlyWordCharacters) -> integer()
                         when
                             This :: wxStyledTextCtrl(),
                             Pos :: integer(),
                             OnlyWordCharacters :: boolean().

Get position of end of word.

wordLeft(This)

-spec wordLeft(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one word.

wordLeftEnd(This)

-spec wordLeftEnd(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one word, position cursor at end of word.

wordLeftEndExtend(This)

-spec wordLeftEndExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one word, position cursor at end of word, extending selection to new caret position.

wordLeftExtend(This)

-spec wordLeftExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret left one word extending selection to new caret position.

wordPartLeft(This)

-spec wordPartLeft(This) -> ok when This :: wxStyledTextCtrl().

Move to the previous change in capitalisation.

wordPartLeftExtend(This)

-spec wordPartLeftExtend(This) -> ok when This :: wxStyledTextCtrl().

Move to the previous change in capitalisation extending selection to new caret position.

wordPartRight(This)

-spec wordPartRight(This) -> ok when This :: wxStyledTextCtrl().

Move to the change next in capitalisation.

wordPartRightExtend(This)

-spec wordPartRightExtend(This) -> ok when This :: wxStyledTextCtrl().

Move to the next change in capitalisation extending selection to new caret position.

wordRight(This)

-spec wordRight(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one word.

wordRightEnd(This)

-spec wordRightEnd(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one word, position cursor at end of word.

wordRightEndExtend(This)

-spec wordRightEndExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one word, position cursor at end of word, extending selection to new caret position.

wordRightExtend(This)

-spec wordRightExtend(This) -> ok when This :: wxStyledTextCtrl().

Move caret right one word extending selection to new caret position.

wordStartPosition(This, Pos, OnlyWordCharacters)

-spec wordStartPosition(This, Pos, OnlyWordCharacters) -> integer()
                           when
                               This :: wxStyledTextCtrl(),
                               Pos :: integer(),
                               OnlyWordCharacters :: boolean().

Get position of start of word.

wrapCount(This, DocLine)

-spec wrapCount(This, DocLine) -> integer() when This :: wxStyledTextCtrl(), DocLine :: integer().

The number of display lines needed to wrap a document line.

zoomIn(This)

-spec zoomIn(This) -> ok when This :: wxStyledTextCtrl().

Magnify the displayed text by increasing the sizes by 1 point.

zoomOut(This)

-spec zoomOut(This) -> ok when This :: wxStyledTextCtrl().

Make the displayed text smaller by decreasing the sizes by 1 point.

wxStyledTextEvent

The type of events sent from wxStyledTextCtrl.

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxStyledTextEvent

Events

Use wxEvtHandler:connect/3 with wxStyledTextEventType to subscribe to events of this type.

Summary

Types

wxStyledText()

wxStyledTextEvent()

wxStyledTextEventType()

Functions

getAlt(This)

Returns true if the Alt key is pressed.

getControl(This)

Returns true if the Control key is pressed.

getDragAllowMove(This)

getDragResult(This)

Returns drag result for this event.

getDragText(This)

Deprecated

getFoldLevelNow(This)

Returns the current fold level for the line.

getFoldLevelPrev(This)

Returns previous fold level for the line.

getKey(This)

Returns the key code of the key that generated this event.

getLength(This)

Returns the length (number of characters) of this event.

getLine(This)

Returns zero-based line number for this event.

getLinesAdded(This)

Returns the number of lines added or deleted with this event.

getListType(This)

Returns the list type for this event.

getLParam(This)

Returns the value of the LParam field for this event.

getMargin(This)

Returns the zero-based index of the margin that generated this event.

getMessage(This)

Returns a message number while a macro is being recorded.

getModificationType(This)

Returns the modification type for this event.

getModifiers(This)

Returns the modifiers of the key press or mouse click for this event.

getPosition(This)

Returns the zero-based text position associated this event.

getShift(This)

Returns true if the Shift key is pressed.

getText(This)

Deprecated

getWParam(This)

Returns value of the WParam field for this event.

getX(This)

Returns the X coordinate of the mouse for this event.

getY(This)

Returns the Y coordinate of the mouse for this event.

Types

wxStyledText()

-type wxStyledText() ::
          #wxStyledText{type :: wxStyledTextEvent:wxStyledTextEventType(),
                        position :: integer(),
                        key :: integer(),
                        modifiers :: integer(),
                        modificationType :: integer(),
                        text :: unicode:chardata(),
                        length :: integer(),
                        linesAdded :: integer(),
                        line :: integer(),
                        foldLevelNow :: integer(),
                        foldLevelPrev :: integer(),
                        margin :: integer(),
                        message :: integer(),
                        wParam :: integer(),
                        lParam :: integer(),
                        listType :: integer(),
                        x :: integer(),
                        y :: integer(),
                        dragText :: unicode:chardata(),
                        dragAllowMove :: boolean(),
                        dragResult :: wx:wx_enum()}.

wxStyledTextEvent()

-type wxStyledTextEvent() :: wx:wx_object().

wxStyledTextEventType()

-type wxStyledTextEventType() ::
          stc_autocomp_cancelled | stc_autocomp_char_deleted | stc_autocomp_selection |
          stc_calltip_click | stc_change | stc_charadded | stc_do_drop | stc_doubleclick |
          stc_drag_over | stc_dwellend | stc_dwellstart | stc_hotspot_click | stc_hotspot_dclick |
          stc_hotspot_release_click | stc_indicator_click | stc_indicator_release | stc_macrorecord |
          stc_marginclick | stc_modified | stc_needshown | stc_painted | stc_romodifyattempt |
          stc_savepointleft | stc_savepointreached | stc_start_drag | stc_styleneeded | stc_updateui |
          stc_userlistselection | stc_zoom.

Functions

getAlt(This)

-spec getAlt(This) -> boolean() when This :: wxStyledTextEvent().

Returns true if the Alt key is pressed.

This method is valid for the following event types:

wxEVT_STC_DOUBLECLICK

wxEVT_STC_MARGINCLICK

wxEVT_STC_HOTSPOT_CLICK

wxEVT_STC_HOTSPOT_DCLICK

wxEVT_STC_HOTSPOT_RELEASE_CLICK

wxEVT_STC_INDICATOR_CLICK

wxEVT_STC_INDICATOR_RELEASE

wxEVT_STC_MARGIN_RIGHT_CLICK

getControl(This)

-spec getControl(This) -> boolean() when This :: wxStyledTextEvent().

Returns true if the Control key is pressed.

This method is valid for the following event types:

wxEVT_STC_DOUBLECLICK

wxEVT_STC_MARGINCLICK

wxEVT_STC_HOTSPOT_CLICK

wxEVT_STC_HOTSPOT_DCLICK

wxEVT_STC_HOTSPOT_RELEASE_CLICK

wxEVT_STC_INDICATOR_CLICK

wxEVT_STC_INDICATOR_RELEASE

wxEVT_STC_MARGIN_RIGHT_CLICK

getDragAllowMove(This)

-spec getDragAllowMove(This) -> boolean() when This :: wxStyledTextEvent().

getDragResult(This)

-spec getDragResult(This) -> wx:wx_enum() when This :: wxStyledTextEvent().

Returns drag result for this event.

This method is valid for wxEVT_STC_DRAG_OVER and wxEVT_STC_DO_DROP events.

getDragText(This)

-spec getDragText(This) -> unicode:charlist() when This :: wxStyledTextEvent().

Deprecated:

Use wxCommandEvent:getString/1 instead.

getFoldLevelNow(This)

-spec getFoldLevelNow(This) -> integer() when This :: wxStyledTextEvent().

Returns the current fold level for the line.

This method is valid for wxEVT_STC_MODIFIED events when the result of getModificationType/1 includes ?wxSTC_MOD_CHANGEFOLD.

getFoldLevelPrev(This)

-spec getFoldLevelPrev(This) -> integer() when This :: wxStyledTextEvent().

Returns previous fold level for the line.

This method is valid for wxEVT_STC_MODIFIED events when the result of getModificationType/1 includes ?wxSTC_MOD_CHANGEFOLD.

getKey(This)

-spec getKey(This) -> integer() when This :: wxStyledTextEvent().

Returns the key code of the key that generated this event.

This method is valid for the following event types:

wxEVT_STC_CHARADDED

wxEVT_STC_USERLISTSELECTION

wxEVT_STC_AUTOCOMP_SELECTION

wxEVT_STC_AUTOCOMP_COMPLETED

getLength(This)

-spec getLength(This) -> integer() when This :: wxStyledTextEvent().

Returns the length (number of characters) of this event.

This method is valid for wxEVT_STC_MODIFIED and wxEVT_STC_NEEDSHOWN events.

getLine(This)

-spec getLine(This) -> integer() when This :: wxStyledTextEvent().

Returns zero-based line number for this event.

This method is valid for wxEVT_STC_DOUBLECLICK and wxEVT_STC_MODIFIED events.

getLinesAdded(This)

-spec getLinesAdded(This) -> integer() when This :: wxStyledTextEvent().

Returns the number of lines added or deleted with this event.

This method is valid for wxEVT_STC_MODIFIED events when the result of getModificationType/1 includes ?wxSTC_MOD_INSERTTEXT or ?wxSTC_MOD_DELETETEXT.

getListType(This)

-spec getListType(This) -> integer() when This :: wxStyledTextEvent().

Returns the list type for this event.

The list type is an integer passed to a list when it is created with the wxStyledTextCtrl:userListShow/3 method and can be used to distinguish lists if more than one is used.

This method is valid for wxEVT_STC_AUTOCOMP_SELECTION_CHANGE and wxEVT_STC_USERLISTSELECTION events.

getLParam(This)

-spec getLParam(This) -> integer() when This :: wxStyledTextEvent().

Returns the value of the LParam field for this event.

This method is valid for wxEVT_STC_MACRORECORD events.

getMargin(This)

-spec getMargin(This) -> integer() when This :: wxStyledTextEvent().

Returns the zero-based index of the margin that generated this event.

This method is valid for wxEVT_STC_MARGINCLICK and wxEVT_STC_MARGIN_RIGHT_CLICK events.

getMessage(This)

-spec getMessage(This) -> integer() when This :: wxStyledTextEvent().

Returns a message number while a macro is being recorded.

Many of the wxStyledTextCtrl methods such as wxStyledTextCtrl:insertText/3 and wxStyledTextCtrl:paste/1 have an event number associated with them. This method returns that number while a macro is being recorded so that the macro can be played back later.

This method is valid for wxEVT_STC_MACRORECORD events.

getModificationType(This)

-spec getModificationType(This) -> integer() when This :: wxStyledTextEvent().

Returns the modification type for this event.

The modification type is a bit list that describes the change that generated this event. It may contain one or more of the following values:

?wxSTC_MOD_INSERTTEXT

?wxSTC_MOD_DELETETEXT

?wxSTC_MOD_CHANGESTYLE

?wxSTC_MOD_CHANGEFOLD

?wxSTC_PERFORMED_USER

?wxSTC_PERFORMED_UNDO

?wxSTC_PERFORMED_REDO

?wxSTC_MULTISTEPUNDOREDO

?wxSTC_LASTSTEPINUNDOREDO

?wxSTC_MOD_CHANGEMARKER

?wxSTC_MOD_BEFOREINSERT

?wxSTC_MOD_BEFOREDELETE

?wxSTC_MULTILINEUNDOREDO

?wxSTC_STARTACTION

?wxSTC_MOD_CHANGEINDICATOR

?wxSTC_MOD_CHANGELINESTATE

?wxSTC_MOD_CHANGEMARGIN

?wxSTC_MOD_CHANGEANNOTATION

?wxSTC_MOD_CONTAINER

?wxSTC_MOD_LEXERSTATE

?wxSTC_MOD_INSERTCHECK

?wxSTC_MOD_CHANGETABSTOPS

This method is valid for wxEVT_STC_MODIFIED events.

getModifiers(This)

-spec getModifiers(This) -> integer() when This :: wxStyledTextEvent().

Returns the modifiers of the key press or mouse click for this event.

The returned value is a bit list that may contain one or more of the following values:

?wxSTC_KEYMOD_SHIFT

?wxSTC_KEYMOD_CTRL

?wxSTC_KEYMOD_ALT

?wxSTC_KEYMOD_SUPER

?wxSTC_KEYMOD_META

In addition, the value can be checked for equality with ?wxSTC_KEYMOD_NORM to test if no modifiers are present.

This method is valid for the following event types:

wxEVT_STC_DOUBLECLICK

wxEVT_STC_MARGINCLICK

wxEVT_STC_HOTSPOT_CLICK

wxEVT_STC_HOTSPOT_DCLICK

wxEVT_STC_HOTSPOT_RELEASE_CLICK

wxEVT_STC_INDICATOR_CLICK

wxEVT_STC_INDICATOR_RELEASE

wxEVT_STC_MARGIN_RIGHT_CLICK

getPosition(This)

-spec getPosition(This) -> integer() when This :: wxStyledTextEvent().

Returns the zero-based text position associated this event.

This method is valid for the following event types:

wxEVT_STC_STYLENEEDED

wxEVT_STC_DOUBLECLICK

wxEVT_STC_MODIFIED

wxEVT_STC_MARGINCLICK

wxEVT_STC_NEEDSHOWN

wxEVT_STC_USERLISTSELECTION

wxEVT_STC_DWELLSTART

wxEVT_STC_DWELLEND

wxEVT_STC_HOTSPOT_CLICK

wxEVT_STC_HOTSPOT_DCLICK

wxEVT_STC_HOTSPOT_RELEASE_CLICK

wxEVT_STC_INDICATOR_CLICK

wxEVT_STC_INDICATOR_RELEASE

wxEVT_STC_CALLTIP_CLICK

wxEVT_STC_AUTOCOMP_SELECTION

wxEVT_STC_AUTOCOMP_SELECTION_CHANGE

wxEVT_STC_AUTOCOMP_COMPLETED

wxEVT_STC_MARGIN_RIGHT_CLICK

getShift(This)

-spec getShift(This) -> boolean() when This :: wxStyledTextEvent().

Returns true if the Shift key is pressed.

This method is valid for the following event types:

wxEVT_STC_DOUBLECLICK

wxEVT_STC_MARGINCLICK

wxEVT_STC_HOTSPOT_CLICK

wxEVT_STC_HOTSPOT_DCLICK

wxEVT_STC_HOTSPOT_RELEASE_CLICK

wxEVT_STC_INDICATOR_CLICK

wxEVT_STC_INDICATOR_RELEASE

wxEVT_STC_MARGIN_RIGHT_CLICK

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxStyledTextEvent().

Deprecated:

Use wxCommandEvent:getString/1 instead.

getWParam(This)

-spec getWParam(This) -> integer() when This :: wxStyledTextEvent().

Returns value of the WParam field for this event.

This method is valid for wxEVT_STC_MACRORECORD events.

getX(This)

-spec getX(This) -> integer() when This :: wxStyledTextEvent().

Returns the X coordinate of the mouse for this event.

This method is valid for the following event types:

wxEVT_STC_DWELLSTART

wxEVT_STC_DWELLEND

wxEVT_STC_START_DRAG

wxEVT_STC_DRAG_OVER

wxEVT_STC_DO_DROP

getY(This)

-spec getY(This) -> integer() when This :: wxStyledTextEvent().

Returns the Y coordinate of the mouse for this event.

This method is valid for the following event types:

wxEVT_STC_DWELLSTART

wxEVT_STC_DWELLEND

wxEVT_STC_START_DRAG

wxEVT_STC_DRAG_OVER

wxEVT_STC_DO_DROP

wxSysColourChangedEvent

This class is used for system colour change events, which are generated when the user changes the colour settings using the control panel.

This is only appropriate under Windows.

Remark: The default event handler for this event propagates the event to child windows, since Windows only sends the events to top-level windows. If intercepting this event for a top-level window, remember to call the base class handler, or to pass the event on to the window's children explicitly.

See: Overview events

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxSysColourChangedEvent

Events

Use wxEvtHandler:connect/3 with wxSysColourChangedEventType to subscribe to events of this type.

Summary

Types

wxSysColourChanged()

wxSysColourChangedEvent()

wxSysColourChangedEventType()

Types

wxSysColourChanged()

-type wxSysColourChanged() ::
          #wxSysColourChanged{type :: wxSysColourChangedEvent:wxSysColourChangedEventType()}.

wxSysColourChangedEvent()

-type wxSysColourChangedEvent() :: wx:wx_object().

wxSysColourChangedEventType()

-type wxSysColourChangedEventType() :: sys_colour_changed.

wxSystemOptions

wxSystemOptions stores option/value pairs that wxWidgets itself or applications can use to alter behaviour at run-time.

It can be used to optimize behaviour that doesn't deserve a distinct API, but is still important to be able to configure.

System options can be set by the program itself using setOption/2 method and they also can be set from the program environment by defining an environment variable wx_option to set the given option for all wxWidgets applications or wx_appname_option to set it just for the application with the given name (as returned by wxApp::GetAppName() (not implemented in wx)). Notice that any characters not allowed in the environment variables names, such as periods and dashes, should be replaced with underscores. E.g. to define a system option "foo-bar" you need to define the environment variable "wx_foo_bar".

The program may use system options for its own needs but they are mostly used to control the behaviour of wxWidgets library itself.

These options are currently recognised by wxWidgets:

All platforms

exit-on-assert: If set to non-zero value, abort the program if an assertion fails. The default behaviour in case of assertion failure depends on the build mode and can be changed by overriding wxApp::OnAssertFailure() (not implemented in wx) but setting this option allows changing it without modifying the program code and also applies to asserts which may happen before the wxApp (not implemented in wx) object creation or after its destruction.

Windows

no-maskblt: 1 to never use WIN32's MaskBlt function, 0 to allow it to be used where possible. Default: 0. In some circumstances the MaskBlt function can be slower than using the fallback code, especially if using DC caching. By default, MaskBlt will be used where it is implemented by the operating system and driver.

msw.remap: If 1 (the default), wxToolBar bitmap colours will be remapped to the current theme's values. Set this to 0 to disable this functionality, for example if you're using more than 16 colours in your tool bitmaps.

msw.window.no-clip-children: If 1, windows will not automatically get the WS_CLIPCHILDREN style. This restores the way windows are refreshed back to the method used in versions of wxWidgets earlier than 2.5.4, and for some complex window hierarchies it can reduce apparent refresh delays. You may still specify wxCLIP_CHILDREN for individual windows.

msw.notebook.themed-background: If set to 0, globally disables themed backgrounds on notebook pages. Note that this won't disable the theme on the actual notebook background (noticeable only if there are no pages).

msw.staticbox.optimized-paint: If set to 0, switches off optimized wxStaticBox painting. Setting this to 0 causes more flicker, but allows applications to paint graphics on the parent of a static box (the optimized refresh causes any such drawing to disappear).

msw.font.no-proof-quality: If set to 1, use default fonts quality instead of proof quality when creating fonts. With proof quality the fonts have slightly better appearance but not all fonts are available in this quality, e.g. the Terminal font in small sizes is not and this option may be used if wider fonts selection is more important than higher quality.

GTK+

gtk.tlw.can-set-transparent: wxTopLevelWindow::CanSetTransparent() (not implemented in wx) method normally tries to detect automatically whether transparency for top level windows is currently supported, however this may sometimes fail and this option allows overriding the automatic detection. Setting it to 1 makes the transparency be always available (setting it can still fail, of course) and setting it to 0 makes it always unavailable.

gtk.desktop: This option can be set to override the default desktop environment determination. Supported values are GNOME and KDE.

gtk.window.force-background-colour: If 1, the backgrounds of windows with the wxBG_STYLE_COLOUR background style are cleared forcibly instead of relying on the underlying GTK+ window colour. This works around a display problem when running applications under KDE with the gtk-qt theme installed (0.6 and below).

Mac

mac.window-plain-transition: If 1, uses a plainer transition when showing a window. You can also use the symbol wxMAC_WINDOW_PLAIN_TRANSITION.

window-default-variant: The default variant used by windows (cast to integer from the wxWindowVariant enum). Also known as wxWINDOW_DEFAULT_VARIANT.

mac.listctrl.always_use_generic: Tells wxListCtrl to use the generic control even when it is capable of using the native control instead. Also known as wxMAC_ALWAYS_USE_GENERIC_LISTCTRL.

mac.textcontrol-use-spell-checker: If 1 activates the spell checking in wxTextCtrl.

osx.openfiledialog.always-show-types: Per default a wxFileDialog with wxFD_OPEN does not show a types-popup on macOS but allows the selection of files from any of the supported types. Setting this to 1 shows a wxChoice for selection (if there is more than one supported filetype).

Motif

motif.largebuttons: If 1, uses a bigger default size for wxButtons.

The compile-time option to include or exclude this functionality is wxUSE_SYSTEM_OPTIONS.

See: wxSystemSettings

wxWidgets docs: wxSystemOptions

Summary

Types

wxSystemOptions()

Functions

getOption(Name)

Gets an option.

getOptionInt(Name)

Gets an option as an integer.

hasOption(Name)

Returns true if the given option is present.

isFalse(Name)

Returns true if the option with the given name had been set to 0 value.

setOption/2

Sets an option.

Types

wxSystemOptions()

-type wxSystemOptions() :: wx:wx_object().

Functions

getOption(Name)

-spec getOption(Name) -> unicode:charlist() when Name :: unicode:chardata().

Gets an option.

The function is case-insensitive to name. Returns empty string if the option hasn't been set.

See:

setOption/2

getOptionInt/1

hasOption/1

getOptionInt(Name)

-spec getOptionInt(Name) -> integer() when Name :: unicode:chardata().

Gets an option as an integer.

The function is case-insensitive to name. If the option hasn't been set, this function returns 0.

See:

setOption/2

getOption/1

hasOption/1

hasOption(Name)

-spec hasOption(Name) -> boolean() when Name :: unicode:chardata().

Returns true if the given option is present.

The function is case-insensitive to name.

See:

setOption/2

getOption/1

getOptionInt/1

isFalse(Name)

-spec isFalse(Name) -> boolean() when Name :: unicode:chardata().

Returns true if the option with the given name had been set to 0 value.

This is mostly useful for boolean options for which you can't use GetOptionInt(name) == 0 as this would also be true if the option hadn't been set at all.

setOption/2

-spec setOption(Name, Value) -> ok when Name :: unicode:chardata(), Value :: integer();
               (Name, Value) -> ok when Name :: unicode:chardata(), Value :: unicode:chardata().

Sets an option.

The function is case-insensitive to name.

wxSystemSettings

wxSystemSettings allows the application to ask for details about the system.

This can include settings such as standard colours, fonts, and user interface element sizes.

See:

wxFont

wx_color()

wxSystemOptions

wxWidgets docs: wxSystemSettings

Summary

Types

wxSystemSettings()

Functions

getColour(Index)

Returns a system colour.

getFont(Index)

Returns a system font.

getMetric(Index)

Equivalent to getMetric(Index, []).

getMetric(Index, Options)

Returns the value of a system metric, or -1 if the metric is not supported on the current system.

getScreenType()

Returns the screen type.

Types

wxSystemSettings()

-type wxSystemSettings() :: wx:wx_object().

Functions

getColour(Index)

-spec getColour(Index) -> wx:wx_colour4() when Index :: wx:wx_enum().

Returns a system colour.

Return: The returned colour is always valid.

getFont(Index)

-spec getFont(Index) -> wxFont:wxFont() when Index :: wx:wx_enum().

Returns a system font.

Return: The returned font is always valid.

getMetric(Index)

-spec getMetric(Index) -> integer() when Index :: wx:wx_enum().

Equivalent to getMetric(Index, []).

getMetric(Index, Options)

-spec getMetric(Index, [Option]) -> integer()
                   when Index :: wx:wx_enum(), Option :: {win, wxWindow:wxWindow()}.

Returns the value of a system metric, or -1 if the metric is not supported on the current system.

The value of win determines if the metric returned is a global value or a wxWindow based value, in which case it might determine the widget, the display the window is on, or something similar. The window given should be as close to the metric as possible (e.g. a wxTopLevelWindow in case of the wxSYS_CAPTION_Y metric).

index can be one of the ?wxSystemMetric enum values.

win is a pointer to the window for which the metric is requested. Specifying the win parameter is encouraged, because some metrics on some ports are not supported without one,or they might be capable of reporting better values if given one. If a window does not make sense for a metric, one should still be given, as for example it might determine which displays cursor width is requested with wxSYS_CURSOR_X.

getScreenType()

-spec getScreenType() -> wx:wx_enum().

Returns the screen type.

The return value is one of the ?wxSystemScreenType enum values.

wxTaskBarIcon

This class represents a taskbar icon.

A taskbar icon is an icon that appears in the 'system tray' and responds to mouse clicks, optionally with a tooltip above it to help provide information.

X Window System Note

Under X Window System, the window manager must support either the "System Tray Protocol" (see http://freedesktop.org/wiki/Specifications/systemtray-spec) by freedesktop.org (WMs used by modern desktop environments such as GNOME >= 2, KDE >= 3 and XFCE >= 4 all do) or the older methods used in GNOME 1.2 and KDE 1 and 2.

If it doesn't, the icon will appear as a toplevel window on user's desktop. Because not all window managers have system tray, there's no guarantee that wxTaskBarIcon will work correctly under X Window System and so the applications should use it only as an optional component of their user interface. The user should be required to explicitly enable the taskbar icon on Unix, it shouldn't be on by default.

This class is derived, and can use functions, from:

wxEvtHandler

wxWidgets docs: wxTaskBarIcon

Events

Event types emitted from this class:

taskbar_move

taskbar_left_down

taskbar_left_up

taskbar_right_down

taskbar_right_up

taskbar_left_dclick

taskbar_right_dclick

Summary

Types

wxTaskBarIcon()

Functions

destroy(This)

Destroys the object

new()

new(Options)

popupMenu(This, Menu)

Pops up a menu at the current mouse position.

removeIcon(This)

Removes the icon previously set with setIcon/3.

setIcon(This, Icon)

Equivalent to setIcon(This, Icon, []).

setIcon/3

Sets the icon, and optional tooltip text.

Types

wxTaskBarIcon()

-type wxTaskBarIcon() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxTaskBarIcon()) -> ok.

Destroys the object

new()

-spec new() -> wxTaskBarIcon().

new(Options)

-spec new([Option]) -> wxTaskBarIcon()
             when Option :: {iconType, wx:wx_enum()} | {createPopupMenu, fun(() -> wxMenu:wxMenu())}.

popupMenu(This, Menu)

-spec popupMenu(This, Menu) -> boolean() when This :: wxTaskBarIcon(), Menu :: wxMenu:wxMenu().

Pops up a menu at the current mouse position.

The events can be handled by a class derived from wxTaskBarIcon.

Note: It is recommended to override CreatePopupMenu() (not implemented in wx) callback instead of calling this method from event handler, because some ports (e.g. wxCocoa) may not implement popupMenu/2 and mouse click events at all.

removeIcon(This)

-spec removeIcon(This) -> boolean() when This :: wxTaskBarIcon().

Removes the icon previously set with setIcon/3.

setIcon(This, Icon)

-spec setIcon(This, Icon) -> boolean() when This :: wxTaskBarIcon(), Icon :: wxIcon:wxIcon().

Equivalent to setIcon(This, Icon, []).

setIcon/3

-spec setIcon(This, Icon, [Option]) -> boolean()
                 when
                     This :: wxTaskBarIcon(),
                     Icon :: wxIcon:wxIcon(),
                     Option :: {tooltip, unicode:chardata()}.

Sets the icon, and optional tooltip text.

wxTaskBarIconEvent

The event class used by wxTaskBarIcon.

For a list of the event macros meant to be used with wxTaskBarIconEvent, please look at wxTaskBarIcon description.

This class is derived, and can use functions, from:

wxEvent

wxWidgets docs: wxTaskBarIconEvent

Summary

Types

wxTaskBarIcon()

wxTaskBarIconEvent()

wxTaskBarIconEventType()

Types

wxTaskBarIcon()

-type wxTaskBarIcon() :: #wxTaskBarIcon{type :: wxTaskBarIconEvent:wxTaskBarIconEventType()}.

wxTaskBarIconEvent()

-type wxTaskBarIconEvent() :: wx:wx_object().

wxTaskBarIconEventType()

-type wxTaskBarIconEventType() ::
          taskbar_move | taskbar_left_down | taskbar_left_up | taskbar_right_down | taskbar_right_up |
          taskbar_left_dclick | taskbar_right_dclick.

wxTextAttr

wxTextAttr represents the character and paragraph attributes, or style, for a range of text in a wxTextCtrl or wxRichTextCtrl (not implemented in wx).

When setting up a wxTextAttr object, pass a bitlist mask to setFlags/2 to indicate which style elements should be changed. As a convenience, when you call a setter such as SetFont, the relevant bit will be set.

See: wxTextCtrl

wxWidgets docs: wxTextAttr

Summary

Types

wxTextAttr()

Functions

destroy(This)

Destroys the object

getAlignment(This)

Returns the alignment flags.

getBackgroundColour(This)

Returns the background colour.

getFlags(This)

Returns flags indicating which attributes are applicable.

getFont(This)

Creates and returns a font specified by the font attributes in the wxTextAttr object.

getFontEncoding(This)

Returns the font encoding.

getFontFaceName(This)

Returns the font face name.

getFontSize(This)

Returns the font size in points.

getFontStyle(This)

Returns the font style.

getFontUnderlined(This)

Returns true if the font is underlined.

getFontWeight(This)

Returns the font weight.

getLeftIndent(This)

Returns the left indent in tenths of a millimetre.

getLeftSubIndent(This)

Returns the left sub-indent in tenths of a millimetre.

getRightIndent(This)

Returns the right indent in tenths of a millimeter.

getTabs(This)

Returns an array of tab stops, each expressed in tenths of a millimeter.

getTextColour(This)

Returns the text foreground colour.

hasBackgroundColour(This)

Returns true if the attribute object specifies a background colour.

hasFont(This)

Returns true if the attribute object specifies any font attributes.

hasTextColour(This)

Returns true if the attribute object specifies a text foreground colour.

isDefault(This)

Returns false if we have any attributes set, true otherwise.

new()

Constructors.

new/1

new(ColText, Options)

setAlignment(This, Alignment)

Sets the paragraph alignment.

setBackgroundColour(This, ColBack)

Sets the background colour.

setFlags(This, Flags)

Sets the flags determining which styles are being specified.

setFont(This, Font)

Equivalent to setFont(This, Font, []).

setFont/3

Sets the attributes for the given font.

setFontEncoding(This, Encoding)

Sets the font encoding.

setFontFaceName(This, FaceName)

Sets the font face name.

setFontFamily(This, Family)

Sets the font family.

setFontPixelSize(This, PixelSize)

Sets the font size in pixels.

setFontPointSize(This, PointSize)

Sets the font size in points.

setFontSize(This, PointSize)

Sets the font size in points.

setFontStyle(This, FontStyle)

Sets the font style (normal, italic or slanted).

setFontUnderlined(This, Underlined)

Sets the font underlining (solid line, text colour).

setFontWeight(This, FontWeight)

Sets the font weight.

setLeftIndent(This, Indent)

Equivalent to setLeftIndent(This, Indent, []).

setLeftIndent/3

Sets the left indent and left subindent in tenths of a millimetre.

setRightIndent(This, Indent)

Sets the right indent in tenths of a millimetre.

setTabs(This, Tabs)

Sets the tab stops, expressed in tenths of a millimetre.

setTextColour(This, ColText)

Sets the text foreground colour.

Types

wxTextAttr()

-type wxTextAttr() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxTextAttr()) -> ok.

Destroys the object

getAlignment(This)

-spec getAlignment(This) -> wx:wx_enum() when This :: wxTextAttr().

Returns the alignment flags.

See ?wxTextAttrAlignment for a list of available styles.

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxTextAttr().

Returns the background colour.

getFlags(This)

-spec getFlags(This) -> integer() when This :: wxTextAttr().

Returns flags indicating which attributes are applicable.

See setFlags/2 for a list of available flags.

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxTextAttr().

Creates and returns a font specified by the font attributes in the wxTextAttr object.

Note that wxTextAttr does not store a wxFont object, so this is only a temporary font.

For greater efficiency, access the font attributes directly.

getFontEncoding(This)

-spec getFontEncoding(This) -> wx:wx_enum() when This :: wxTextAttr().

Returns the font encoding.

getFontFaceName(This)

-spec getFontFaceName(This) -> unicode:charlist() when This :: wxTextAttr().

Returns the font face name.

getFontSize(This)

-spec getFontSize(This) -> integer() when This :: wxTextAttr().

Returns the font size in points.

getFontStyle(This)

-spec getFontStyle(This) -> wx:wx_enum() when This :: wxTextAttr().

Returns the font style.

getFontUnderlined(This)

-spec getFontUnderlined(This) -> boolean() when This :: wxTextAttr().

Returns true if the font is underlined.

getFontWeight(This)

-spec getFontWeight(This) -> wx:wx_enum() when This :: wxTextAttr().

Returns the font weight.

getLeftIndent(This)

-spec getLeftIndent(This) -> integer() when This :: wxTextAttr().

Returns the left indent in tenths of a millimetre.

getLeftSubIndent(This)

-spec getLeftSubIndent(This) -> integer() when This :: wxTextAttr().

Returns the left sub-indent in tenths of a millimetre.

getRightIndent(This)

-spec getRightIndent(This) -> integer() when This :: wxTextAttr().

Returns the right indent in tenths of a millimeter.

getTabs(This)

-spec getTabs(This) -> [integer()] when This :: wxTextAttr().

Returns an array of tab stops, each expressed in tenths of a millimeter.

Each stop is measured from the left margin and therefore each value must be larger than the last.

getTextColour(This)

-spec getTextColour(This) -> wx:wx_colour4() when This :: wxTextAttr().

Returns the text foreground colour.

hasBackgroundColour(This)

-spec hasBackgroundColour(This) -> boolean() when This :: wxTextAttr().

Returns true if the attribute object specifies a background colour.

hasFont(This)

-spec hasFont(This) -> boolean() when This :: wxTextAttr().

Returns true if the attribute object specifies any font attributes.

hasTextColour(This)

-spec hasTextColour(This) -> boolean() when This :: wxTextAttr().

Returns true if the attribute object specifies a text foreground colour.

isDefault(This)

-spec isDefault(This) -> boolean() when This :: wxTextAttr().

Returns false if we have any attributes set, true otherwise.

new()

-spec new() -> wxTextAttr().

Constructors.

new/1

-spec new(ColText) -> wxTextAttr() when ColText :: wx:wx_colour();
         (Attr) -> wxTextAttr() when Attr :: wxTextAttr().

new(ColText, Options)

-spec new(ColText, [Option]) -> wxTextAttr()
             when
                 ColText :: wx:wx_colour(),
                 Option ::
                     {colBack, wx:wx_colour()} | {font, wxFont:wxFont()} | {alignment, wx:wx_enum()}.

setAlignment(This, Alignment)

-spec setAlignment(This, Alignment) -> ok when This :: wxTextAttr(), Alignment :: wx:wx_enum().

Sets the paragraph alignment.

See ?wxTextAttrAlignment enumeration values.

Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented. In future justification may be supported when printing or previewing, only.

setBackgroundColour(This, ColBack)

-spec setBackgroundColour(This, ColBack) -> ok when This :: wxTextAttr(), ColBack :: wx:wx_colour().

Sets the background colour.

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxTextAttr(), Flags :: integer().

Sets the flags determining which styles are being specified.

The ?wxTextAttrFlags values can be passed in a bitlist.

setFont(This, Font)

-spec setFont(This, Font) -> ok when This :: wxTextAttr(), Font :: wxFont:wxFont().

Equivalent to setFont(This, Font, []).

setFont/3

-spec setFont(This, Font, [Option]) -> ok
                 when This :: wxTextAttr(), Font :: wxFont:wxFont(), Option :: {flags, integer()}.

Sets the attributes for the given font.

Note that wxTextAttr does not store an actual wxFont object.

setFontEncoding(This, Encoding)

-spec setFontEncoding(This, Encoding) -> ok when This :: wxTextAttr(), Encoding :: wx:wx_enum().

Sets the font encoding.

setFontFaceName(This, FaceName)

-spec setFontFaceName(This, FaceName) -> ok when This :: wxTextAttr(), FaceName :: unicode:chardata().

Sets the font face name.

setFontFamily(This, Family)

-spec setFontFamily(This, Family) -> ok when This :: wxTextAttr(), Family :: wx:wx_enum().

Sets the font family.

setFontPixelSize(This, PixelSize)

-spec setFontPixelSize(This, PixelSize) -> ok when This :: wxTextAttr(), PixelSize :: integer().

Sets the font size in pixels.

setFontPointSize(This, PointSize)

-spec setFontPointSize(This, PointSize) -> ok when This :: wxTextAttr(), PointSize :: integer().

Sets the font size in points.

setFontSize(This, PointSize)

-spec setFontSize(This, PointSize) -> ok when This :: wxTextAttr(), PointSize :: integer().

Sets the font size in points.

setFontStyle(This, FontStyle)

-spec setFontStyle(This, FontStyle) -> ok when This :: wxTextAttr(), FontStyle :: wx:wx_enum().

Sets the font style (normal, italic or slanted).

setFontUnderlined(This, Underlined)

-spec setFontUnderlined(This, Underlined) -> ok when This :: wxTextAttr(), Underlined :: boolean().

Sets the font underlining (solid line, text colour).

setFontWeight(This, FontWeight)

-spec setFontWeight(This, FontWeight) -> ok when This :: wxTextAttr(), FontWeight :: wx:wx_enum().

Sets the font weight.

setLeftIndent(This, Indent)

-spec setLeftIndent(This, Indent) -> ok when This :: wxTextAttr(), Indent :: integer().

Equivalent to setLeftIndent(This, Indent, []).

setLeftIndent/3

-spec setLeftIndent(This, Indent, [Option]) -> ok
                       when This :: wxTextAttr(), Indent :: integer(), Option :: {subIndent, integer()}.

Sets the left indent and left subindent in tenths of a millimetre.

The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph.

A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.

wxRichTextBuffer (not implemented in wx) uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.

setRightIndent(This, Indent)

-spec setRightIndent(This, Indent) -> ok when This :: wxTextAttr(), Indent :: integer().

Sets the right indent in tenths of a millimetre.

setTabs(This, Tabs)

-spec setTabs(This, Tabs) -> ok when This :: wxTextAttr(), Tabs :: [integer()].

Sets the tab stops, expressed in tenths of a millimetre.

Each stop is measured from the left margin and therefore each value must be larger than the last.

setTextColour(This, ColText)

-spec setTextColour(This, ColText) -> ok when This :: wxTextAttr(), ColText :: wx:wx_colour().

Sets the text foreground colour.

wxTextCtrl

A text control allows text to be displayed and edited.

It may be single line or multi-line. Notice that a lot of methods of the text controls are found in the base wxTextEntry (not implemented in wx) class which is a common base class for wxTextCtrl and other controls using a single line text entry field (e.g. wxComboBox).

Styles

This class supports the following styles:

wxTE_PROCESS_ENTER: The control will generate the event wxEVT_TEXT_ENTER that can be handled by the program. Otherwise, i.e. either if this style not specified at all, or it is used, but there is no event handler for this event or the event handler called wxEvent:skip/2 to avoid overriding the default handling, pressing Enter key is either processed internally by the control or used to activate the default button of the dialog, if any.

wxTE_PROCESS_TAB: Normally, TAB key is used for keyboard navigation and pressing it in a control switches focus to the next one. With this style, this won't happen and if the TAB is not otherwise processed (e.g. by wxEVT_CHAR event handler), a literal TAB character is inserted into the control. Notice that this style has no effect for single-line text controls when using wxGTK.

wxTE_MULTILINE: The text control allows multiple lines. If this style is not specified, line break characters should not be used in the controls value.

wxTE_PASSWORD: The text will be echoed as asterisks.

wxTE_READONLY: The text will not be user-editable.

wxTE_RICH: Use rich text control under MSW, this allows having more than 64KB of text in the control. This style is ignored under other platforms.

wxTE_RICH2: Use rich text control version 2.0 or higher under MSW, this style is ignored under other platforms

wxTE_AUTO_URL: Highlight the URLs and generate the wxTextUrlEvents when mouse events occur over them.

wxTE_NOHIDESEL: By default, the Windows text control doesn't show the selection when it doesn't have focus - use this style to force it to always show it. It doesn't do anything under other platforms.

wxHSCROLL: A horizontal scrollbar will be created and used, so that text won't be wrapped. No effect under wxGTK1.

wxTE_NO_VSCROLL: For multiline controls only: vertical scrollbar will never be created. This limits the amount of text which can be entered into the control to what can be displayed in it under wxMSW but not under wxGTK or wxOSX. Currently not implemented for the other platforms.

wxTE_LEFT: The text in the control will be left-justified (default).

wxTE_CENTRE: The text in the control will be centered (wxMSW, wxGTK, wxOSX).

wxTE_RIGHT: The text in the control will be right-justified (wxMSW, wxGTK, wxOSX).

wxTE_DONTWRAP: Same as wxHSCROLL style: don't wrap at all, show horizontal scrollbar instead.

wxTE_CHARWRAP: For multiline controls only: wrap the lines too long to be shown entirely at any position (wxUniv, wxGTK, wxOSX).

wxTE_WORDWRAP: For multiline controls only: wrap the lines too long to be shown entirely at word boundaries (wxUniv, wxMSW, wxGTK, wxOSX).

wxTE_BESTWRAP: For multiline controls only: wrap the lines at word boundaries or at any other character if there are words longer than the window width (this is the default).

wxTE_CAPITALIZE: On PocketPC and Smartphone, causes the first letter to be capitalized. Note that alignment styles (wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT) can be changed dynamically after control creation on wxMSW, wxGTK and wxOSX. wxTE_READONLY, wxTE_PASSWORD and wrapping styles can be dynamically changed under wxGTK but not wxMSW. The other styles can be only set during control creation.

wxTextCtrl Text Format

The multiline text controls always store the text as a sequence of lines separated by '\n' characters, i.e. in the Unix text format even on non-Unix platforms. This allows the user code to ignore the differences between the platforms but at a price: the indices in the control such as those returned by getInsertionPoint/1 or getSelection/1 can not be used as indices into the string returned by getValue/1 as they're going to be slightly off for platforms using "\\r\\n" as separator (as Windows does).

Instead, if you need to obtain a substring between the 2 indices obtained from the control with the help of the functions mentioned above, you should use getRange/3. And the indices themselves can only be passed to other methods, for example setInsertionPoint/2 or setSelection/3.

To summarize: never use the indices returned by (multiline) wxTextCtrl as indices into the string it contains, but only as arguments to be passed back to the other wxTextCtrl methods. This problem doesn't arise for single-line platforms however where the indices in the control do correspond to the positions in the value string.

wxTextCtrl Positions and Coordinates

It is possible to use either linear positions, i.e. roughly (but not always exactly, as explained in the previous section) the index of the character in the text contained in the control or X-Y coordinates, i.e. column and line of the character when working with this class and it provides the functions positionToXY/2 and xYToPosition/3 to convert between the two.

Additionally, a position in the control can be converted to its coordinates in pixels using PositionToCoords() (not implemented in wx) which can be useful to e.g. show a popup menu near the given character. And, in the other direction, HitTest() (not implemented in wx) can be used to find the character under, or near, the given pixel coordinates.

To be more precise, positions actually refer to the gaps between characters and not the characters themselves. Thus, position 0 is the one before the very first character in the control and so is a valid position even when the control is empty. And if the control contains a single character, it has two valid positions: 0 before this character and 1 - after it. This, when the documentation of various functions mentions "invalid position", it doesn't consider the position just after the last character of the line to be invalid, only the positions beyond that one (e.g. 2 and greater in the single character example) are actually invalid.

wxTextCtrl Styles.

Multi-line text controls support styling, i.e. provide a possibility to set colours and font for individual characters in it (note that under Windows wxTE_RICH style is required for style support). To use the styles you can either call setDefaultStyle/2 before inserting the text or call setStyle/4 later to change the style of the text already in the control (the first solution is much more efficient).

In either case, if the style doesn't specify some of the attributes (for example you only want to set the text colour but without changing the font nor the text background), the values of the default style will be used for them. If there is no default style, the attributes of the text control itself are used.

So the following code correctly describes what it does: the second call to setDefaultStyle/2 doesn't change the text foreground colour (which stays red) while the last one doesn't change the background colour (which stays grey):

wxTextCtrl and C++ Streams

This class multiply-inherits from std::streambuf (except for some really old compilers using non-standard iostream library), allowing code such as the following:

Note that even if your build of wxWidgets doesn't support this (the symbol wxHAS_TEXT_WINDOW_STREAM has value of 0 then) you can still use wxTextCtrl itself in a stream-like manner:

However the possibility to create a std::ostream associated with wxTextCtrl may be useful if you need to redirect the output of a function taking a std::ostream as parameter to a text control.

Another commonly requested need is to redirect std::cout to the text control. This may be done in the following way:

But wxWidgets provides a convenient class to make it even simpler so instead you may just do

See wxStreamToTextRedirector (not implemented in wx) for more details.

Event Handling.

The following commands are processed by default event handlers in wxTextCtrl: wxID_CUT, wxID_COPY, wxID_PASTE, wxID_UNDO, wxID_REDO. The associated UI update events are also processed automatically, when the control has the focus.

See: create/4

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxTextCtrl

Events

Event types emitted from this class:

command_text_updated

command_text_enter

text_maxlen

Summary

Types

wxTextCtrl()

Functions

appendText(This, Text)

Appends the text to the end of the text control.

canCopy(This)

Returns true if the selection can be copied to the clipboard.

canCut(This)

Returns true if the selection can be cut to the clipboard.

canPaste(This)

Returns true if the contents of the clipboard can be pasted into the text control.

canRedo(This)

Returns true if there is a redo facility available and the last operation can be redone.

canUndo(This)

Returns true if there is an undo facility available and the last operation can be undone.

changeValue(This, Value)

Sets the new text control value.

clear(This)

Clears the text in the control.

copy(This)

Copies the selected text to the clipboard.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates the text control for two-step construction.

cut(This)

Copies the selected text to the clipboard and removes it from the control.

destroy(This)

Destroys the object

discardEdits(This)

Resets the internal modified flag as if the current changes had been saved.

emulateKeyPress(This, Event)

This function inserts into the control the character which would have been inserted if the given key event had occurred in the text control.

getDefaultStyle(This)

Returns the style currently used for the new text.

getInsertionPoint(This)

Returns the insertion point, or cursor, position.

getLastPosition(This)

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

getLineLength(This, LineNo)

Gets the length of the specified line, not including any trailing newline character(s).

getLineText(This, LineNo)

Returns the contents of a given line in the text control, not including any trailing newline character(s).

getNumberOfLines(This)

Returns the number of lines in the text control buffer.

getRange(This, From, To)

Returns the string containing the text starting in the positions from and up to to in the control.

getSelection(This)

Gets the current selection span.

getStringSelection(This)

Gets the text currently selected in the control.

getStyle(This, Position, Style)

Returns the style at this position in the text control.

getValue(This)

Gets the contents of the control.

isEditable(This)

Returns true if the controls contents may be edited by user (note that it always can be changed by the program).

isModified(This)

Returns true if the text has been modified by user.

isMultiLine(This)

Returns true if this is a multi line edit control and false otherwise.

isSingleLine(This)

Returns true if this is a single line edit control and false otherwise.

loadFile(This, Filename)

Equivalent to loadFile(This, Filename, []).

loadFile/3

Loads and displays the named file, if it exists.

markDirty(This)

Mark text as modified (dirty).

new()

Default ctor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructor, creating and showing a text control.

paste(This)

Pastes text from the clipboard to the text item.

positionToXY(This, Pos)

Converts given position to a zero-based column, line number pair.

redo(This)

If there is a redo facility and the last operation can be redone, redoes the last operation.

remove(This, From, To)

Removes the text starting at the first given position up to (but not including) the character at the last position.

replace(This, From, To, Value)

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

saveFile(This)

Equivalent to saveFile(This, []).

saveFile/2

Saves the contents of the control in a text file.

setDefaultStyle(This, Style)

Changes the default style to use for the new text which is going to be added to the control.

setEditable(This, Editable)

Makes the text item editable or read-only, overriding the wxTE\_READONLY flag.

setInsertionPoint(This, Pos)

Sets the insertion point at the given position.

setInsertionPointEnd(This)

Sets the insertion point at the end of the text control.

setMaxLength(This, Len)

This function sets the maximum number of characters the user can enter into the control.

setSelection(This, From, To)

Selects the text starting at the first position up to (but not including) the character at the last position.

setStyle(This, Start, End, Style)

Changes the style of the given range.

setValue(This, Value)

Sets the new text control value.

showPosition(This, Pos)

Makes the line containing the given position visible.

undo(This)

If there is an undo facility and the last operation can be undone, undoes the last operation.

writeText(This, Text)

Writes the text into the text control at the current insertion position.

xYToPosition(This, X, Y)

Converts the given zero based column and line number to a position.

Types

wxTextCtrl()

-type wxTextCtrl() :: wx:wx_object().

Functions

appendText(This, Text)

-spec appendText(This, Text) -> ok when This :: wxTextCtrl(), Text :: unicode:chardata().

Appends the text to the end of the text control.

Remark: After the text is appended, the insertion point will be at the end of the text control. If this behaviour is not desired, the programmer should use getInsertionPoint/1 and setInsertionPoint/2.

See: writeText/2

canCopy(This)

-spec canCopy(This) -> boolean() when This :: wxTextCtrl().

Returns true if the selection can be copied to the clipboard.

canCut(This)

-spec canCut(This) -> boolean() when This :: wxTextCtrl().

Returns true if the selection can be cut to the clipboard.

canPaste(This)

-spec canPaste(This) -> boolean() when This :: wxTextCtrl().

Returns true if the contents of the clipboard can be pasted into the text control.

On some platforms (Motif, GTK) this is an approximation and returns true if the control is editable, false otherwise.

canRedo(This)

-spec canRedo(This) -> boolean() when This :: wxTextCtrl().

Returns true if there is a redo facility available and the last operation can be redone.

canUndo(This)

-spec canUndo(This) -> boolean() when This :: wxTextCtrl().

Returns true if there is an undo facility available and the last operation can be undone.

changeValue(This, Value)

-spec changeValue(This, Value) -> ok when This :: wxTextCtrl(), Value :: unicode:chardata().

Sets the new text control value.

It also marks the control as not-modified which means that IsModified() would return false immediately after the call to changeValue/2.

The insertion point is set to the start of the control (i.e. position 0) by this function.

This functions does not generate the wxEVT_TEXT event but otherwise is identical to setValue/2.

See overview_events_prog for more information.

Since: 2.7.1

clear(This)

-spec clear(This) -> ok when This :: wxTextCtrl().

Clears the text in the control.

Note that this function will generate a wxEVT_TEXT event, i.e. its effect is identical to calling SetValue("").

copy(This)

-spec copy(This) -> ok when This :: wxTextCtrl().

Copies the selected text to the clipboard.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxTextCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxTextCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {value, unicode:chardata()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the text control for two-step construction.

This method should be called if the default constructor was used for the control creation. Its parameters have the same meaning as for the non-default constructor.

cut(This)

-spec cut(This) -> ok when This :: wxTextCtrl().

Copies the selected text to the clipboard and removes it from the control.

destroy(This)

-spec destroy(This :: wxTextCtrl()) -> ok.

Destroys the object

discardEdits(This)

-spec discardEdits(This) -> ok when This :: wxTextCtrl().

Resets the internal modified flag as if the current changes had been saved.

emulateKeyPress(This, Event)

-spec emulateKeyPress(This, Event) -> boolean()
                         when This :: wxTextCtrl(), Event :: wxKeyEvent:wxKeyEvent().

This function inserts into the control the character which would have been inserted if the given key event had occurred in the text control.

The event object should be the same as the one passed to EVT_KEY_DOWN handler previously by wxWidgets. Please note that this function doesn't currently work correctly for all keys under any platform but MSW.

Return: true if the event resulted in a change to the control, false otherwise.

getDefaultStyle(This)

-spec getDefaultStyle(This) -> wxTextAttr:wxTextAttr() when This :: wxTextCtrl().

Returns the style currently used for the new text.

See: setDefaultStyle/2

getInsertionPoint(This)

-spec getInsertionPoint(This) -> integer() when This :: wxTextCtrl().

Returns the insertion point, or cursor, position.

This is defined as the zero based index of the character position to the right of the insertion point. For example, if the insertion point is at the end of the single-line text control, it is equal to getLastPosition/1.

Notice that insertion position is, in general, different from the index of the character the cursor position at in the string returned by getValue/1. While this is always the case for the single line controls, multi-line controls can use two characters "\\r\\n" as line separator (this is notably the case under MSW) meaning that indices in the control and its string value are offset by 1 for every line.

Hence to correctly get the character at the current cursor position, taking into account that there can be none if the cursor is at the end of the string, you could do the following:

getLastPosition(This)

-spec getLastPosition(This) -> integer() when This :: wxTextCtrl().

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

getLineLength(This, LineNo)

-spec getLineLength(This, LineNo) -> integer() when This :: wxTextCtrl(), LineNo :: integer().

Gets the length of the specified line, not including any trailing newline character(s).

Return: The length of the line, or -1 if lineNo was invalid.

getLineText(This, LineNo)

-spec getLineText(This, LineNo) -> unicode:charlist() when This :: wxTextCtrl(), LineNo :: integer().

Returns the contents of a given line in the text control, not including any trailing newline character(s).

Return: The contents of the line.

getNumberOfLines(This)

-spec getNumberOfLines(This) -> integer() when This :: wxTextCtrl().

Returns the number of lines in the text control buffer.

The returned number is the number of logical lines, i.e. just the count of the number of newline characters in the control + 1, for wxGTK and wxOSX/Cocoa ports while it is the number of physical lines, i.e. the count of lines actually shown in the control, in wxMSW. Because of this discrepancy, it is not recommended to use this function.

Remark: Note that even empty text controls have one line (where the insertion point is), so getNumberOfLines/1 never returns 0.

getRange(This, From, To)

-spec getRange(This, From, To) -> unicode:charlist()
                  when This :: wxTextCtrl(), From :: integer(), To :: integer().

Returns the string containing the text starting in the positions from and up to to in the control.

The positions must have been returned by another wxTextCtrl method. Please note that the positions in a multiline wxTextCtrl do not correspond to the indices in the string returned by getValue/1 because of the different new line representations (CR or CR LF) and so this method should be used to obtain the correct results instead of extracting parts of the entire value. It may also be more efficient, especially if the control contains a lot of data.

getSelection(This)

-spec getSelection(This) -> {From :: integer(), To :: integer()} when This :: wxTextCtrl().

Gets the current selection span.

If the returned values are equal, there was no selection. Please note that the indices returned may be used with the other wxTextCtrl methods but don't necessarily represent the correct indices into the string returned by getValue/1 for multiline controls under Windows (at least,) you should use getStringSelection/1 to get the selected text.

getStringSelection(This)

-spec getStringSelection(This) -> unicode:charlist() when This :: wxTextCtrl().

Gets the text currently selected in the control.

If there is no selection, the returned string is empty.

getStyle(This, Position, Style)

-spec getStyle(This, Position, Style) -> boolean()
                  when This :: wxTextCtrl(), Position :: integer(), Style :: wxTextAttr:wxTextAttr().

Returns the style at this position in the text control.

Not all platforms support this function.

Return: true on success, false if an error occurred (this may also mean that the styles are not supported under this platform).

See:

setStyle/4

wxTextAttr

getValue(This)

-spec getValue(This) -> unicode:charlist() when This :: wxTextCtrl().

Gets the contents of the control.

Notice that for a multiline text control, the lines will be separated by (Unix-style) \n characters, even under Windows where they are separated by a \r\n sequence in the native control.

isEditable(This)

-spec isEditable(This) -> boolean() when This :: wxTextCtrl().

Returns true if the controls contents may be edited by user (note that it always can be changed by the program).

In other words, this functions returns true if the control hasn't been put in read-only mode by a previous call to setEditable/2.

isModified(This)

-spec isModified(This) -> boolean() when This :: wxTextCtrl().

Returns true if the text has been modified by user.

Note that calling setValue/2 doesn't make the control modified.

See: markDirty/1

isMultiLine(This)

-spec isMultiLine(This) -> boolean() when This :: wxTextCtrl().

Returns true if this is a multi line edit control and false otherwise.

See: isSingleLine/1

isSingleLine(This)

-spec isSingleLine(This) -> boolean() when This :: wxTextCtrl().

Returns true if this is a single line edit control and false otherwise.

See:

isSingleLine/1

isMultiLine/1

loadFile(This, Filename)

-spec loadFile(This, Filename) -> boolean() when This :: wxTextCtrl(), Filename :: unicode:chardata().

Equivalent to loadFile(This, Filename, []).

loadFile/3

-spec loadFile(This, Filename, [Option]) -> boolean()
                  when
                      This :: wxTextCtrl(),
                      Filename :: unicode:chardata(),
                      Option :: {fileType, integer()}.

Loads and displays the named file, if it exists.

Return: true if successful, false otherwise.

markDirty(This)

-spec markDirty(This) -> ok when This :: wxTextCtrl().

Mark text as modified (dirty).

See: isModified/1

new()

-spec new() -> wxTextCtrl().

Default ctor.

new(Parent, Id)

-spec new(Parent, Id) -> wxTextCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxTextCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {value, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a text control.

Remark: The horizontal scrollbar (wxHSCROLL style flag) will only be created for multi-line text controls. Without a horizontal scrollbar, text lines that don't fit in the control's size will be wrapped (but no newline character is inserted). Single line controls don't have a horizontal scrollbar, the text is automatically scrolled so that the insertion point is always visible.

See: create/4

paste(This)

-spec paste(This) -> ok when This :: wxTextCtrl().

Pastes text from the clipboard to the text item.

positionToXY(This, Pos)

-spec positionToXY(This, Pos) -> Result
                      when
                          Result :: {Res :: boolean(), X :: integer(), Y :: integer()},
                          This :: wxTextCtrl(),
                          Pos :: integer().

Converts given position to a zero-based column, line number pair.

Return: true on success, false on failure (most likely due to a too large position parameter).

See: xYToPosition/3

redo(This)

-spec redo(This) -> ok when This :: wxTextCtrl().

If there is a redo facility and the last operation can be redone, redoes the last operation.

Does nothing if there is no redo facility.

remove(This, From, To)

-spec remove(This, From, To) -> ok when This :: wxTextCtrl(), From :: integer(), To :: integer().

Removes the text starting at the first given position up to (but not including) the character at the last position.

This function puts the current insertion point position at to as a side effect.

replace(This, From, To, Value)

-spec replace(This, From, To, Value) -> ok
                 when
                     This :: wxTextCtrl(),
                     From :: integer(),
                     To :: integer(),
                     Value :: unicode:chardata().

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

This function puts the current insertion point position at to as a side effect.

saveFile(This)

-spec saveFile(This) -> boolean() when This :: wxTextCtrl().

Equivalent to saveFile(This, []).

saveFile/2

-spec saveFile(This, [Option]) -> boolean()
                  when
                      This :: wxTextCtrl(), Option :: {file, unicode:chardata()} | {fileType, integer()}.

Saves the contents of the control in a text file.

Return: true if the operation was successful, false otherwise.

setDefaultStyle(This, Style)

-spec setDefaultStyle(This, Style) -> boolean()
                         when This :: wxTextCtrl(), Style :: wxTextAttr:wxTextAttr().

Changes the default style to use for the new text which is going to be added to the control.

This applies both to the text added programmatically using writeText/2 or appendText/2 and to the text entered by the user interactively.

If either of the font, foreground, or background colour is not set in style, the values of the previous default style are used for them. If the previous default style didn't set them neither, the global font or colours of the text control itself are used as fall back.

However if the style parameter is the default wxTextAttr, then the default style is just reset (instead of being combined with the new style which wouldn't change it at all).

Return: true on success, false if an error occurred (this may also mean that the styles are not supported under this platform).

See: getDefaultStyle/1

setEditable(This, Editable)

-spec setEditable(This, Editable) -> ok when This :: wxTextCtrl(), Editable :: boolean().

Makes the text item editable or read-only, overriding the wxTE\_READONLY flag.

See: isEditable/1

setInsertionPoint(This, Pos)

-spec setInsertionPoint(This, Pos) -> ok when This :: wxTextCtrl(), Pos :: integer().

Sets the insertion point at the given position.

setInsertionPointEnd(This)

-spec setInsertionPointEnd(This) -> ok when This :: wxTextCtrl().

Sets the insertion point at the end of the text control.

This is equivalent to calling setInsertionPoint/2 with getLastPosition/1 argument.

setMaxLength(This, Len)

-spec setMaxLength(This, Len) -> ok when This :: wxTextCtrl(), Len :: integer().

This function sets the maximum number of characters the user can enter into the control.

In other words, it allows limiting the text value length to len not counting the terminating NUL character.

If len is 0, the previously set max length limit, if any, is discarded and the user may enter as much text as the underlying native text control widget supports (typically at least 32Kb). If the user tries to enter more characters into the text control when it already is filled up to the maximal length, a wxEVT_TEXT_MAXLEN event is sent to notify the program about it (giving it the possibility to show an explanatory message, for example) and the extra input is discarded.

Note that in wxGTK this function may only be used with single line text controls.

setSelection(This, From, To)

-spec setSelection(This, From, To) -> ok when This :: wxTextCtrl(), From :: integer(), To :: integer().

Selects the text starting at the first position up to (but not including) the character at the last position.

If both parameters are equal to -1 all text in the control is selected.

Notice that the insertion point will be moved to from by this function.

setStyle(This, Start, End, Style)

-spec setStyle(This, Start, End, Style) -> boolean()
                  when
                      This :: wxTextCtrl(),
                      Start :: integer(),
                      End :: integer(),
                      Style :: wxTextAttr:wxTextAttr().

Changes the style of the given range.

If any attribute within style is not set, the corresponding attribute from getDefaultStyle/1 is used.

Return: true on success, false if an error occurred (this may also mean that the styles are not supported under this platform).

See:

getStyle/3

wxTextAttr

setValue(This, Value)

-spec setValue(This, Value) -> ok when This :: wxTextCtrl(), Value :: unicode:chardata().

Sets the new text control value.

It also marks the control as not-modified which means that IsModified() would return false immediately after the call to setValue/2.

The insertion point is set to the start of the control (i.e. position 0) by this function unless the control value doesn't change at all, in which case the insertion point is left at its original position.

Note that, unlike most other functions changing the controls values, this function generates a wxEVT_TEXT event. To avoid this you can use changeValue/2 instead.

showPosition(This, Pos)

-spec showPosition(This, Pos) -> ok when This :: wxTextCtrl(), Pos :: integer().

Makes the line containing the given position visible.

undo(This)

-spec undo(This) -> ok when This :: wxTextCtrl().

If there is an undo facility and the last operation can be undone, undoes the last operation.

Does nothing if there is no undo facility.

writeText(This, Text)

-spec writeText(This, Text) -> ok when This :: wxTextCtrl(), Text :: unicode:chardata().

Writes the text into the text control at the current insertion position.

Remark: Newlines in the text string are the only control characters allowed, and they will cause appropriate line breaks. See operator<<() and appendText/2 for more convenient ways of writing to the window. After the write operation, the insertion point will be at the end of the inserted text, so subsequent write operations will be appended. To append text after the user may have interacted with the control, call setInsertionPointEnd/1 before writing.

xYToPosition(This, X, Y)

-spec xYToPosition(This, X, Y) -> integer() when This :: wxTextCtrl(), X :: integer(), Y :: integer().

Converts the given zero based column and line number to a position.

Return: The position value, or -1 if x or y was invalid.

wxTextDataObject

wxTextDataObject is a specialization of wxDataObjectSimple (not implemented in wx) for text data.

It can be used without change to paste data into the wxClipboard or a wxDropSource (not implemented in wx). A user may wish to derive a new class from this class for providing text on-demand in order to minimize memory consumption when offering data in several formats, such as plain text and RTF because by default the text is stored in a string in this class, but it might as well be generated when requested. For this, getTextLength/1 and getText/1 will have to be overridden.

Note that if you already have the text inside a string, you will not achieve any efficiency gain by overriding these functions because copying wxStrings is already a very efficient operation (data is not actually copied because wxStrings are reference counted).

See:

Overview dnd

wxDataObject

wxFileDataObject

wxBitmapDataObject

This class is derived, and can use functions, from:

wxDataObject

wxWidgets docs: wxTextDataObject

Summary

Types

wxTextDataObject()

Functions

destroy(This)

Destroys the object

getText(This)

Returns the text associated with the data object.

getTextLength(This)

Returns the data size.

new()

Equivalent to new([]).

new(Options)

Constructor, may be used to initialise the text (otherwise setText/2 should be used later).

setText(This, StrText)

Sets the text associated with the data object.

Types

wxTextDataObject()

-type wxTextDataObject() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxTextDataObject()) -> ok.

Destroys the object

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxTextDataObject().

Returns the text associated with the data object.

You may wish to override this method when offering data on-demand, but this is not required by wxWidgets' internals. Use this method to get data in text form from the wxClipboard.

getTextLength(This)

-spec getTextLength(This) -> integer() when This :: wxTextDataObject().

Returns the data size.

By default, returns the size of the text data set in the constructor or using setText/2. This can be overridden to provide text size data on-demand. It is recommended to return the text length plus 1 for a trailing zero, but this is not strictly required.

new()

-spec new() -> wxTextDataObject().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxTextDataObject() when Option :: {text, unicode:chardata()}.

Constructor, may be used to initialise the text (otherwise setText/2 should be used later).

setText(This, StrText)

-spec setText(This, StrText) -> ok when This :: wxTextDataObject(), StrText :: unicode:chardata().

Sets the text associated with the data object.

This method is called when the data object receives the data and, by default, copies the text into the member variable. If you want to process the text on the fly you may wish to override this function.

wxTextEntryDialog

This class represents a dialog that requests a one-line text string from the user.

It is implemented as a generic wxWidgets dialog.

See: Overview cmndlg

This class is derived, and can use functions, from:

wxDialog

wxTopLevelWindow

wxWindow

wxEvtHandler

wxWidgets docs: wxTextEntryDialog

Summary

Types

wxTextEntryDialog()

Functions

destroy(This)

Destroys the object

getValue(This)

Returns the text that the user has entered if the user has pressed OK, or the original value if the user has pressed Cancel.

new()

Default constructor.

new(Parent, Message)

Equivalent to new(Parent, Message, []).

new/3

Constructor.

setValue(This, Value)

Sets the default text value.

Types

wxTextEntryDialog()

-type wxTextEntryDialog() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxTextEntryDialog()) -> ok.

Destroys the object

getValue(This)

-spec getValue(This) -> unicode:charlist() when This :: wxTextEntryDialog().

Returns the text that the user has entered if the user has pressed OK, or the original value if the user has pressed Cancel.

new()

-spec new() -> wxTextEntryDialog().

Default constructor.

Call Create() (not implemented in wx) to really create the dialog later.

Since: 2.9.5

new(Parent, Message)

-spec new(Parent, Message) -> wxTextEntryDialog()
             when Parent :: wxWindow:wxWindow(), Message :: unicode:chardata().

Equivalent to new(Parent, Message, []).

new/3

-spec new(Parent, Message, [Option]) -> wxTextEntryDialog()
             when
                 Parent :: wxWindow:wxWindow(),
                 Message :: unicode:chardata(),
                 Option ::
                     {caption, unicode:chardata()} |
                     {value, unicode:chardata()} |
                     {style, integer()} |
                     {pos, {X :: integer(), Y :: integer()}}.

Constructor.

Use wxDialog:showModal/1 to show the dialog.

See Create() (not implemented in wx) method for parameter description.

setValue(This, Value)

-spec setValue(This, Value) -> ok when This :: wxTextEntryDialog(), Value :: unicode:chardata().

Sets the default text value.

wxToggleButton

wxToggleButton is a button that stays pressed when clicked by the user.

In other words, it is similar to wxCheckBox in functionality but looks like a wxButton.

Since wxWidgets version 2.9.0 this control emits an update UI event.

You can see wxToggleButton in action in page_samples_widgets.

See:

wxCheckBox

wxButton

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxToggleButton

Events

Event types emitted from this class:

command_togglebutton_clicked

Summary

Types

wxToggleButton()

Functions

create(This, Parent, Id, Label)

Equivalent to create(This, Parent, Id, Label, []).

create/5

Creates the toggle button for two-step construction.

destroy(This)

Destroys the object

getValue(This)

Gets the state of the toggle button.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to new(Parent, Id, Label, []).

new/4

Constructor, creating and showing a toggle button.

setValue(This, State)

Sets the toggle button to the given state.

Types

wxToggleButton()

-type wxToggleButton() :: wx:wx_object().

Functions

create(This, Parent, Id, Label)

-spec create(This, Parent, Id, Label) -> boolean()
                when
                    This :: wxToggleButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata().

Equivalent to create(This, Parent, Id, Label, []).

create/5

-spec create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxToggleButton(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the toggle button for two-step construction.

See new/4 for details.

destroy(This)

-spec destroy(This :: wxToggleButton()) -> ok.

Destroys the object

getValue(This)

-spec getValue(This) -> boolean() when This :: wxToggleButton().

Gets the state of the toggle button.

Return: Returns true if it is pressed, false otherwise.

new()

-spec new() -> wxToggleButton().

Default constructor.

new(Parent, Id, Label)

-spec new(Parent, Id, Label) -> wxToggleButton()
             when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().

Equivalent to new(Parent, Id, Label, []).

new/4

-spec new(Parent, Id, Label, [Option]) -> wxToggleButton()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a toggle button.

See: create/5

setValue(This, State)

-spec setValue(This, State) -> ok when This :: wxToggleButton(), State :: boolean().

Sets the toggle button to the given state.

This does not cause a EVT_TOGGLEBUTTON event to be emitted.

wxToolBar

A toolbar is a bar of buttons and/or other controls usually placed below the menu bar in a wxFrame.

You may create a toolbar that is managed by a frame calling wxFrame:createToolBar/2. Under Pocket PC, you should always use this function for creating the toolbar to be managed by the frame, so that wxWidgets can use a combined menubar and toolbar. Where you manage your own toolbars, create wxToolBar as usual.

There are several different types of tools you can add to a toolbar. These types are controlled by the ?wxItemKind enumeration.

Note that many methods in wxToolBar such as addTool/6 return a wxToolBarToolBase* object. This should be regarded as an opaque handle representing the newly added toolbar item, providing access to its id and position within the toolbar. Changes to the item's state should be made through calls to wxToolBar methods, for example enableTool/3. Calls to wxToolBarToolBase (not implemented in wx) methods (undocumented by purpose) will not change the visible state of the item within the tool bar.

After you have added all the tools you need, you must call realize/1 to effectively construct and display the toolbar.

wxMSW note: Note that under wxMSW toolbar paints tools to reflect system-wide colours. If you use more than 16 colours in your tool bitmaps, you may wish to suppress this behaviour, otherwise system colours in your bitmaps will inadvertently be mapped to system colours. To do this, set the msw.remap system option before creating the toolbar: If you wish to use 32-bit images (which include an alpha channel for transparency) use: Then colour remapping is switched off, and a transparent background used. But only use this option under Windows XP with true colour:

Styles

This class supports the following styles:

wxTB_FLAT: Gives the toolbar a flat look (Windows and GTK only).

wxTB_DOCKABLE: Makes the toolbar floatable and dockable (GTK only).

wxTB_HORIZONTAL: Specifies horizontal layout (default).

wxTB_VERTICAL: Specifies vertical layout.

wxTB_TEXT: Shows the text in the toolbar buttons; by default only icons are shown.

wxTB_NOICONS: Specifies no icons in the toolbar buttons; by default they are shown.

wxTB_NODIVIDER: Specifies no divider (border) above the toolbar (Windows only)

wxTB_NOALIGN: Specifies no alignment with the parent window (Windows only, not very useful).

wxTB_HORZ_LAYOUT: Shows the text and the icons alongside, not vertically stacked (Windows and GTK 2 only). This style must be used with wxTB_TEXT.

wxTB_HORZ_TEXT: Combination of wxTB_HORZ_LAYOUT and wxTB_TEXT.

wxTB_NO_TOOLTIPS: Don't show the short help tooltips for the tools when the mouse hovers over them.

wxTB_BOTTOM: Align the toolbar at the bottom of parent window.

wxTB_RIGHT: Align the toolbar at the right side of parent window.

wxTB_DEFAULT_STYLE: Combination of wxTB_HORIZONTAL and wxTB_FLAT. This style is new since wxWidgets 2.9.5. See also overview_windowstyles. Note that the wxMSW native toolbar ignores wxTB_NOICONS style. Also, toggling the wxTB_TEXT works only if the style was initially on.

See: Overview toolbar

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxToolBar

Events

Event types emitted from this class:

command_tool_rclicked

command_tool_enter

tool_dropdown

Summary

Types

wxToolBar()

Functions

addCheckTool(This, ToolId, Label, Bitmap1)

Equivalent to addCheckTool(This, ToolId, Label, Bitmap1, []).

addCheckTool/5

Adds a new check (or toggle) tool to the toolbar.

addControl(This, Control)

Equivalent to addControl(This, Control, []).

addControl/3

Adds any control to the toolbar, typically e.g. a wxComboBox.

addRadioTool(This, ToolId, Label, Bitmap1)

Equivalent to addRadioTool(This, ToolId, Label, Bitmap1, []).

addRadioTool/5

Adds a new radio tool to the toolbar.

addSeparator(This)

Adds a separator for spacing groups of tools.

addStretchableSpace(This)

Adds a stretchable space to the toolbar.

addTool(This, Tool)

Adds a tool to the toolbar.

addTool(This, ToolId, Label, Bitmap)

Equivalent to addTool(This, ToolId, Label, Bitmap, []).

addTool/5

Adds a tool to the toolbar.

addTool/6

Adds a tool to the toolbar.

deleteTool(This, ToolId)

Removes the specified tool from the toolbar and deletes it.

deleteToolByPos(This, Pos)

This function behaves like deleteTool/2 but it deletes the tool at the specified position and not the one with the given id.

enableTool(This, ToolId, Enable)

Enables or disables the tool.

findById(This, Id)

Returns a pointer to the tool identified by id or NULL if no corresponding tool is found.

findControl(This, Id)

Returns a pointer to the control identified by id or NULL if no corresponding control is found.

findToolForPosition(This, X, Y)

Finds a tool for the given mouse position.

getMargins(This)

Returns the left/right and top/bottom margins, which are also used for inter-toolspacing.

getToolBitmapSize(This)

Returns the size of bitmap that the toolbar expects to have.

getToolEnabled(This, ToolId)

Called to determine whether a tool is enabled (responds to user input).

getToolLongHelp(This, ToolId)

Returns the long help for the given tool.

getToolPacking(This)

Returns the value used for packing tools.

getToolPos(This, ToolId)

Returns the tool position in the toolbar, or wxNOT_FOUND if the tool is not found.

getToolSeparation(This)

Returns the default separator size.

getToolShortHelp(This, ToolId)

Returns the short help for the given tool.

getToolSize(This)

Returns the size of a whole button, which is usually larger than a tool bitmap because of added 3D effects.

getToolState(This, ToolId)

Gets the on/off state of a toggle tool.

insertControl(This, Pos, Control)

Equivalent to insertControl(This, Pos, Control, []).

insertControl/4

Inserts the control into the toolbar at the given position.

insertSeparator(This, Pos)

Inserts the separator into the toolbar at the given position.

insertStretchableSpace(This, Pos)

Inserts a stretchable space at the given position.

insertTool(This, Pos, Tool)

insertTool(This, Pos, ToolId, Label, Bitmap)

Equivalent to insertTool(This, Pos, ToolId, Label, Bitmap, []).

insertTool/6

Inserts the tool with the specified attributes into the toolbar at the given position.

realize(This)

This function should be called after you have added tools.

removeTool(This, Id)

Removes the given tool from the toolbar but doesn't delete it.

setMargins(This, X, Y)

Set the values to be used as margins for the toolbar.

setToolBitmapSize(This, Size)

Sets the default size of each tool bitmap.

setToolLongHelp(This, ToolId, HelpString)

Sets the long help for the given tool.

setToolPacking(This, Packing)

Sets the value used for spacing tools.

setToolSeparation(This, Separation)

Sets the default separator size.

setToolShortHelp(This, ToolId, HelpString)

Sets the short help for the given tool.

toggleTool(This, ToolId, Toggle)

Toggles a tool on or off.

Types

wxToolBar()

-type wxToolBar() :: wx:wx_object().

Functions

addCheckTool(This, ToolId, Label, Bitmap1)

-spec addCheckTool(This, ToolId, Label, Bitmap1) -> wx:wx_object()
                      when
                          This :: wxToolBar(),
                          ToolId :: integer(),
                          Label :: unicode:chardata(),
                          Bitmap1 :: wxBitmap:wxBitmap().

Equivalent to addCheckTool(This, ToolId, Label, Bitmap1, []).

addCheckTool/5

-spec addCheckTool(This, ToolId, Label, Bitmap1, [Option]) -> wx:wx_object()
                      when
                          This :: wxToolBar(),
                          ToolId :: integer(),
                          Label :: unicode:chardata(),
                          Bitmap1 :: wxBitmap:wxBitmap(),
                          Option ::
                              {bmpDisabled, wxBitmap:wxBitmap()} |
                              {shortHelp, unicode:chardata()} |
                              {longHelp, unicode:chardata()} |
                              {data, wx:wx_object()}.

Adds a new check (or toggle) tool to the toolbar.

The parameters are the same as in addTool/6.

See: addTool/6

addControl(This, Control)

-spec addControl(This, Control) -> wx:wx_object()
                    when This :: wxToolBar(), Control :: wxControl:wxControl().

Equivalent to addControl(This, Control, []).

addControl/3

-spec addControl(This, Control, [Option]) -> wx:wx_object()
                    when
                        This :: wxToolBar(),
                        Control :: wxControl:wxControl(),
                        Option :: {label, unicode:chardata()}.

Adds any control to the toolbar, typically e.g. a wxComboBox.

Remark: wxMac: labels are only displayed if wxWidgets is built with wxMAC_USE_NATIVE_TOOLBAR set to 1

addRadioTool(This, ToolId, Label, Bitmap1)

-spec addRadioTool(This, ToolId, Label, Bitmap1) -> wx:wx_object()
                      when
                          This :: wxToolBar(),
                          ToolId :: integer(),
                          Label :: unicode:chardata(),
                          Bitmap1 :: wxBitmap:wxBitmap().

Equivalent to addRadioTool(This, ToolId, Label, Bitmap1, []).

addRadioTool/5

-spec addRadioTool(This, ToolId, Label, Bitmap1, [Option]) -> wx:wx_object()
                      when
                          This :: wxToolBar(),
                          ToolId :: integer(),
                          Label :: unicode:chardata(),
                          Bitmap1 :: wxBitmap:wxBitmap(),
                          Option ::
                              {bmpDisabled, wxBitmap:wxBitmap()} |
                              {shortHelp, unicode:chardata()} |
                              {longHelp, unicode:chardata()} |
                              {data, wx:wx_object()}.

Adds a new radio tool to the toolbar.

Consecutive radio tools form a radio group such that exactly one button in the group is pressed at any moment, in other words whenever a button in the group is pressed the previously pressed button is automatically released. You should avoid having the radio groups of only one element as it would be impossible for the user to use such button.

By default, the first button in the radio group is initially pressed, the others are not.

See: addTool/6

addSeparator(This)

-spec addSeparator(This) -> wx:wx_object() when This :: wxToolBar().

Adds a separator for spacing groups of tools.

Notice that the separator uses the look appropriate for the current platform so it can be a vertical line (MSW, some versions of GTK) or just an empty space or something else.

See:

addTool/6

setToolSeparation/2

addStretchableSpace/1

addStretchableSpace(This)

-spec addStretchableSpace(This) -> wx:wx_object() when This :: wxToolBar().

Adds a stretchable space to the toolbar.

Any space not taken up by the fixed items (all items except for stretchable spaces) is distributed in equal measure between the stretchable spaces in the toolbar. The most common use for this method is to add a single stretchable space before the items which should be right-aligned in the toolbar, but more exotic possibilities are possible, e.g. a stretchable space may be added in the beginning and the end of the toolbar to centre all toolbar items.

See:

addTool/6

addSeparator/1

insertStretchableSpace/2

Since: 2.9.1

addTool(This, Tool)

-spec addTool(This, Tool) -> wx:wx_object() when This :: wxToolBar(), Tool :: wx:wx_object().

Adds a tool to the toolbar.

Remark: After you have added tools to a toolbar, you must call realize/1 in order to have the tools appear.

See:

addSeparator/1

addCheckTool/5

addRadioTool/5

insertTool/6

deleteTool/2

realize/1

addTool(This, ToolId, Label, Bitmap)

-spec addTool(This, ToolId, Label, Bitmap) -> wx:wx_object()
                 when
                     This :: wxToolBar(),
                     ToolId :: integer(),
                     Label :: unicode:chardata(),
                     Bitmap :: wxBitmap:wxBitmap().

Equivalent to addTool(This, ToolId, Label, Bitmap, []).

addTool/5

-spec addTool(This, ToolId, Label, Bitmap, BmpDisabled) -> wx:wx_object()
                 when
                     This :: wxToolBar(),
                     ToolId :: integer(),
                     Label :: unicode:chardata(),
                     Bitmap :: wxBitmap:wxBitmap(),
                     BmpDisabled :: wxBitmap:wxBitmap();
             (This, ToolId, Label, Bitmap, [Option]) -> wx:wx_object()
                 when
                     This :: wxToolBar(),
                     ToolId :: integer(),
                     Label :: unicode:chardata(),
                     Bitmap :: wxBitmap:wxBitmap(),
                     Option :: {shortHelp, unicode:chardata()} | {kind, wx:wx_enum()}.

Adds a tool to the toolbar.

This most commonly used version has fewer parameters than the full version below which specifies the more rarely used button features.

Remark: After you have added tools to a toolbar, you must call realize/1 in order to have the tools appear.

See:

addSeparator/1

addCheckTool/5

addRadioTool/5

insertTool/6

deleteTool/2

realize/1

addTool/6

-spec addTool(This, ToolId, Label, Bitmap, BmpDisabled, [Option]) -> wx:wx_object()
                 when
                     This :: wxToolBar(),
                     ToolId :: integer(),
                     Label :: unicode:chardata(),
                     Bitmap :: wxBitmap:wxBitmap(),
                     BmpDisabled :: wxBitmap:wxBitmap(),
                     Option ::
                         {kind, wx:wx_enum()} |
                         {shortHelp, unicode:chardata()} |
                         {longHelp, unicode:chardata()} |
                         {data, wx:wx_object()}.

Adds a tool to the toolbar.

Remark: After you have added tools to a toolbar, you must call realize/1 in order to have the tools appear.

See:

addSeparator/1

addCheckTool/5

addRadioTool/5

insertTool/6

deleteTool/2

realize/1

deleteTool(This, ToolId)

-spec deleteTool(This, ToolId) -> boolean() when This :: wxToolBar(), ToolId :: integer().

Removes the specified tool from the toolbar and deletes it.

If you don't want to delete the tool, but just to remove it from the toolbar (to possibly add it back later), you may use removeTool/2 instead.

Note: It is unnecessary to call realize/1 for the change to take place, it will happen immediately.

Return: true if the tool was deleted, false otherwise.

See: deleteToolByPos/2

deleteToolByPos(This, Pos)

-spec deleteToolByPos(This, Pos) -> boolean() when This :: wxToolBar(), Pos :: integer().

This function behaves like deleteTool/2 but it deletes the tool at the specified position and not the one with the given id.

enableTool(This, ToolId, Enable)

-spec enableTool(This, ToolId, Enable) -> ok
                    when This :: wxToolBar(), ToolId :: integer(), Enable :: boolean().

Enables or disables the tool.

Remark: Some implementations will change the visible state of the tool to indicate that it is disabled.

See:

getToolEnabled/2

toggleTool/3

findById(This, Id)

-spec findById(This, Id) -> wx:wx_object() when This :: wxToolBar(), Id :: integer().

Returns a pointer to the tool identified by id or NULL if no corresponding tool is found.

findControl(This, Id)

-spec findControl(This, Id) -> wxControl:wxControl() when This :: wxToolBar(), Id :: integer().

Returns a pointer to the control identified by id or NULL if no corresponding control is found.

findToolForPosition(This, X, Y)

-spec findToolForPosition(This, X, Y) -> wx:wx_object()
                             when This :: wxToolBar(), X :: integer(), Y :: integer().

Finds a tool for the given mouse position.

Return: A pointer to a tool if a tool is found, or NULL otherwise.

Remark: Currently not implemented in wxGTK (always returns NULL there).

getMargins(This)

-spec getMargins(This) -> {W :: integer(), H :: integer()} when This :: wxToolBar().

Returns the left/right and top/bottom margins, which are also used for inter-toolspacing.

See: setMargins/3

getToolBitmapSize(This)

-spec getToolBitmapSize(This) -> {W :: integer(), H :: integer()} when This :: wxToolBar().

Returns the size of bitmap that the toolbar expects to have.

The default bitmap size is platform-dependent: for example, it is 1615 for MSW and 2424 for GTK. This size does not necessarily indicate the best size to use for the toolbars on the given platform, for this you should use wxArtProvider::GetNativeSizeHint(wxART_TOOLBAR) but in any case, as the bitmap size is deduced automatically from the size of the bitmaps associated with the tools added to the toolbar, it is usually unnecessary to call setToolBitmapSize/2 explicitly.

Remark: Note that this is the size of the bitmap you pass to addTool/6, and not the eventual size of the tool button.

See:

setToolBitmapSize/2

getToolSize/1

getToolEnabled(This, ToolId)

-spec getToolEnabled(This, ToolId) -> boolean() when This :: wxToolBar(), ToolId :: integer().

Called to determine whether a tool is enabled (responds to user input).

Return: true if the tool is enabled, false otherwise.

See: enableTool/3

getToolLongHelp(This, ToolId)

-spec getToolLongHelp(This, ToolId) -> unicode:charlist() when This :: wxToolBar(), ToolId :: integer().

Returns the long help for the given tool.

See:

setToolLongHelp/3

setToolShortHelp/3

getToolPacking(This)

-spec getToolPacking(This) -> integer() when This :: wxToolBar().

Returns the value used for packing tools.

See: setToolPacking/2

getToolPos(This, ToolId)

-spec getToolPos(This, ToolId) -> integer() when This :: wxToolBar(), ToolId :: integer().

Returns the tool position in the toolbar, or wxNOT_FOUND if the tool is not found.

getToolSeparation(This)

-spec getToolSeparation(This) -> integer() when This :: wxToolBar().

Returns the default separator size.

See: setToolSeparation/2

getToolShortHelp(This, ToolId)

-spec getToolShortHelp(This, ToolId) -> unicode:charlist() when This :: wxToolBar(), ToolId :: integer().

Returns the short help for the given tool.

See:

getToolLongHelp/2

setToolShortHelp/3

getToolSize(This)

-spec getToolSize(This) -> {W :: integer(), H :: integer()} when This :: wxToolBar().

Returns the size of a whole button, which is usually larger than a tool bitmap because of added 3D effects.

See:

setToolBitmapSize/2

getToolBitmapSize/1

getToolState(This, ToolId)

-spec getToolState(This, ToolId) -> boolean() when This :: wxToolBar(), ToolId :: integer().

Gets the on/off state of a toggle tool.

Return: true if the tool is toggled on, false otherwise.

See: toggleTool/3

insertControl(This, Pos, Control)

-spec insertControl(This, Pos, Control) -> wx:wx_object()
                       when This :: wxToolBar(), Pos :: integer(), Control :: wxControl:wxControl().

Equivalent to insertControl(This, Pos, Control, []).

insertControl/4

-spec insertControl(This, Pos, Control, [Option]) -> wx:wx_object()
                       when
                           This :: wxToolBar(),
                           Pos :: integer(),
                           Control :: wxControl:wxControl(),
                           Option :: {label, unicode:chardata()}.

Inserts the control into the toolbar at the given position.

You must call realize/1 for the change to take place.

See:

addControl/3

insertTool/6

insertSeparator(This, Pos)

-spec insertSeparator(This, Pos) -> wx:wx_object() when This :: wxToolBar(), Pos :: integer().

Inserts the separator into the toolbar at the given position.

You must call realize/1 for the change to take place.

See:

addSeparator/1

insertTool/6

insertStretchableSpace(This, Pos)

-spec insertStretchableSpace(This, Pos) -> wx:wx_object() when This :: wxToolBar(), Pos :: integer().

Inserts a stretchable space at the given position.

See addStretchableSpace/1 for details about stretchable spaces.

See:

insertTool/6

insertSeparator/2

Since: 2.9.1

insertTool(This, Pos, Tool)

-spec insertTool(This, Pos, Tool) -> wx:wx_object()
                    when This :: wxToolBar(), Pos :: integer(), Tool :: wx:wx_object().

insertTool(This, Pos, ToolId, Label, Bitmap)

-spec insertTool(This, Pos, ToolId, Label, Bitmap) -> wx:wx_object()
                    when
                        This :: wxToolBar(),
                        Pos :: integer(),
                        ToolId :: integer(),
                        Label :: unicode:chardata(),
                        Bitmap :: wxBitmap:wxBitmap().

Equivalent to insertTool(This, Pos, ToolId, Label, Bitmap, []).

insertTool/6

-spec insertTool(This, Pos, ToolId, Label, Bitmap, [Option]) -> wx:wx_object()
                    when
                        This :: wxToolBar(),
                        Pos :: integer(),
                        ToolId :: integer(),
                        Label :: unicode:chardata(),
                        Bitmap :: wxBitmap:wxBitmap(),
                        Option ::
                            {bmpDisabled, wxBitmap:wxBitmap()} |
                            {kind, wx:wx_enum()} |
                            {shortHelp, unicode:chardata()} |
                            {longHelp, unicode:chardata()} |
                            {clientData, wx:wx_object()}.

Inserts the tool with the specified attributes into the toolbar at the given position.

You must call realize/1 for the change to take place.

See:

addTool/6

insertControl/4

insertSeparator/2

Return: The newly inserted tool or NULL on failure. Notice that with the overload taking tool parameter the caller is responsible for deleting the tool in the latter case.

realize(This)

-spec realize(This) -> boolean() when This :: wxToolBar().

This function should be called after you have added tools.

removeTool(This, Id)

-spec removeTool(This, Id) -> wx:wx_object() when This :: wxToolBar(), Id :: integer().

Removes the given tool from the toolbar but doesn't delete it.

This allows inserting/adding this tool back to this (or another) toolbar later.

Note: It is unnecessary to call realize/1 for the change to take place, it will happen immediately.

See: deleteTool/2

setMargins(This, X, Y)

-spec setMargins(This, X, Y) -> ok when This :: wxToolBar(), X :: integer(), Y :: integer().

Set the values to be used as margins for the toolbar.

Remark: This must be called before the tools are added if absolute positioning is to be used, and the default (zero-size) margins are to be overridden.

See: getMargins/1

setToolBitmapSize(This, Size)

-spec setToolBitmapSize(This, Size) -> ok
                           when This :: wxToolBar(), Size :: {W :: integer(), H :: integer()}.

Sets the default size of each tool bitmap.

The default bitmap size is 16 by 15 pixels.

Remark: This should be called to tell the toolbar what the tool bitmap size is. Call it before you add tools.

See:

getToolBitmapSize/1

getToolSize/1

setToolLongHelp(This, ToolId, HelpString)

-spec setToolLongHelp(This, ToolId, HelpString) -> ok
                         when This :: wxToolBar(), ToolId :: integer(), HelpString :: unicode:chardata().

Sets the long help for the given tool.

Remark: You might use the long help for displaying the tool purpose on the status line.

See:

getToolLongHelp/2

setToolShortHelp/3

setToolPacking(This, Packing)

-spec setToolPacking(This, Packing) -> ok when This :: wxToolBar(), Packing :: integer().

Sets the value used for spacing tools.

The default value is 1.

Remark: The packing is used for spacing in the vertical direction if the toolbar is horizontal, and for spacing in the horizontal direction if the toolbar is vertical.

See: getToolPacking/1

setToolSeparation(This, Separation)

-spec setToolSeparation(This, Separation) -> ok when This :: wxToolBar(), Separation :: integer().

Sets the default separator size.

The default value is 5.

See: addSeparator/1

setToolShortHelp(This, ToolId, HelpString)

-spec setToolShortHelp(This, ToolId, HelpString) -> ok
                          when
                              This :: wxToolBar(), ToolId :: integer(), HelpString :: unicode:chardata().

Sets the short help for the given tool.

Remark: An application might use short help for identifying the tool purpose in a tooltip.

See:

getToolShortHelp/2

setToolLongHelp/3

toggleTool(This, ToolId, Toggle)

-spec toggleTool(This, ToolId, Toggle) -> ok
                    when This :: wxToolBar(), ToolId :: integer(), Toggle :: boolean().

Toggles a tool on or off.

This does not cause any event to get emitted.

Remark: Only applies to a tool that has been specified as a toggle tool.

wxToolTip

This class holds information about a tooltip associated with a window (see wxWindow:setToolTip/2).

The four static methods, enable/1, setDelay/1 wxToolTip::SetAutoPop() (not implemented in wx) and wxToolTip::SetReshow() (not implemented in wx) can be used to globally alter tooltips behaviour.

wxWidgets docs: wxToolTip

Summary

Types

wxToolTip()

Functions

destroy(This)

Destroys the object

enable(Flag)

Enable or disable tooltips globally.

getTip(This)

Get the tooltip text.

getWindow(This)

Get the associated window.

new(Tip)

Constructor.

setDelay(Msecs)

Set the delay after which the tooltip appears.

setTip(This, Tip)

Set the tooltip text.

Types

wxToolTip()

-type wxToolTip() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxToolTip()) -> ok.

Destroys the object

enable(Flag)

-spec enable(Flag) -> ok when Flag :: boolean().

Enable or disable tooltips globally.

Note: May not be supported on all platforms (eg. wxCocoa).

getTip(This)

-spec getTip(This) -> unicode:charlist() when This :: wxToolTip().

Get the tooltip text.

getWindow(This)

-spec getWindow(This) -> wxWindow:wxWindow() when This :: wxToolTip().

Get the associated window.

new(Tip)

-spec new(Tip) -> wxToolTip() when Tip :: unicode:chardata().

Constructor.

setDelay(Msecs)

-spec setDelay(Msecs) -> ok when Msecs :: integer().

Set the delay after which the tooltip appears.

Note: May not be supported on all platforms.

setTip(This, Tip)

-spec setTip(This, Tip) -> ok when This :: wxToolTip(), Tip :: unicode:chardata().

Set the tooltip text.

wxToolbook

wxToolbook is a class similar to wxNotebook but which uses a wxToolBar to show the labels instead of the tabs.

There is no documentation for this class yet but its usage is identical to wxNotebook (except for the features clearly related to tabs only), so please refer to that class documentation for now. You can also use the page_samples_notebook to see wxToolbook in action.

One feature of this class not supported by wxBookCtrlBase is the support for disabling some of the pages, see EnablePage() (not implemented in wx).

Styles

This class supports the following styles:

wxTBK_BUTTONBAR: Use wxButtonToolBar-based implementation under macOS (ignored under other platforms).

wxTBK_HORZ_LAYOUT: Shows the text and the icons alongside, not vertically stacked (only implement under Windows and GTK 2 platforms as it relies on wxTB_HORZ_LAYOUT flag support). The common wxBookCtrl styles described in the overview_bookctrl are also supported.

See:

Overview bookctrl

wxBookCtrlBase

wxNotebook

Examples

This class is derived, and can use functions, from:

wxBookCtrlBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxToolbook

Events

Event types emitted from this class:

toolbook_page_changed

toolbook_page_changing

Summary

Types

wxToolbook()

Functions

addPage(This, Page, Text)

Equivalent to addPage(This, Page, Text, []).

addPage/4

Adds a new page.

advanceSelection(This)

Equivalent to advanceSelection(This, []).

advanceSelection/2

Cycles through the tabs.

assignImageList(This, ImageList)

Sets the image list for the page control and takes ownership of the list.

changeSelection(This, Page)

Changes the selection to the given page, returning the previous selection.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Create the tool book control that has already been constructed with the default constructor.

deleteAllPages(This)

Deletes all pages.

destroy(This)

Destroys the object

getCurrentPage(This)

Returns the currently selected page or NULL.

getImageList(This)

Returns the associated image list, may be NULL.

getPage(This, Page)

Returns the window at the given page position.

getPageCount(This)

Returns the number of pages in the control.

getPageImage(This, NPage)

Returns the image index for the given page.

getPageText(This, NPage)

Returns the string for the given page.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

hitTest(This, Pt)

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

insertPage(This, Index, Page, Text)

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

Inserts a new page at the specified position.

new()

Constructs a choicebook control.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

setImageList(This, ImageList)

Sets the image list to use.

setPageImage(This, Page, Image)

Sets the image index for the given page.

setPageSize(This, Size)

Sets the width and height of the pages.

setPageText(This, Page, Text)

Sets the text for the given page.

setSelection(This, Page)

Sets the selection to the given page, returning the previous selection.

Types

wxToolbook()

-type wxToolbook() :: wx:wx_object().

Functions

addPage(This, Page, Text)

-spec addPage(This, Page, Text) -> boolean()
                 when This :: wxToolbook(), Page :: wxWindow:wxWindow(), Text :: unicode:chardata().

Equivalent to addPage(This, Page, Text, []).

addPage/4

-spec addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxToolbook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option :: {bSelect, boolean()} | {imageId, integer()}.

Adds a new page.

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function will generate the page changing and page changed events if select is true, but not when inserting the very first page (as there is no previous page selection to switch from in this case and so it wouldn't make sense to e.g. veto such event).

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: insertPage/5

advanceSelection(This)

-spec advanceSelection(This) -> ok when This :: wxToolbook().

Equivalent to advanceSelection(This, []).

advanceSelection/2

-spec advanceSelection(This, [Option]) -> ok when This :: wxToolbook(), Option :: {forward, boolean()}.

Cycles through the tabs.

The call to this function generates the page changing events.

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxToolbook(), ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list.

See:

wxImageList

setImageList/2

changeSelection(This, Page)

-spec changeSelection(This, Page) -> integer() when This :: wxToolbook(), Page :: integer().

Changes the selection to the given page, returning the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events.

See overview_events_prog for more information.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxToolbook(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxToolbook(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Create the tool book control that has already been constructed with the default constructor.

deleteAllPages(This)

-spec deleteAllPages(This) -> boolean() when This :: wxToolbook().

Deletes all pages.

destroy(This)

-spec destroy(This :: wxToolbook()) -> ok.

Destroys the object

getCurrentPage(This)

-spec getCurrentPage(This) -> wxWindow:wxWindow() when This :: wxToolbook().

Returns the currently selected page or NULL.

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxToolbook().

Returns the associated image list, may be NULL.

See:

wxImageList

setImageList/2

getPage(This, Page)

-spec getPage(This, Page) -> wxWindow:wxWindow() when This :: wxToolbook(), Page :: integer().

Returns the window at the given page position.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxToolbook().

Returns the number of pages in the control.

getPageImage(This, NPage)

-spec getPageImage(This, NPage) -> integer() when This :: wxToolbook(), NPage :: integer().

Returns the image index for the given page.

getPageText(This, NPage)

-spec getPageText(This, NPage) -> unicode:charlist() when This :: wxToolbook(), NPage :: integer().

Returns the string for the given page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxToolbook().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent:getSelection/1 should be used instead in this case.

hitTest(This, Pt)

-spec hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxToolbook(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage(This, Index, Page, Text)

-spec insertPage(This, Index, Page, Text) -> boolean()
                    when
                        This :: wxToolbook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata().

Equivalent to insertPage(This, Index, Page, Text, []).

insertPage/5

-spec insertPage(This, Index, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxToolbook(),
                        Index :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page at the specified position.

Return: true if successful, false otherwise.

Remark: Do not delete the page, it will be deleted by the book control.

See: addPage/4

new()

-spec new() -> wxToolbook().

Constructs a choicebook control.

new(Parent, Id)

-spec new(Parent, Id) -> wxToolbook() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxToolbook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxToolbook(), ImageList :: wxImageList:wxImageList().

Sets the image list to use.

It does not take ownership of the image list, you must delete it yourself.

See:

wxImageList

assignImageList/2

setPageImage(This, Page, Image)

-spec setPageImage(This, Page, Image) -> boolean()
                      when This :: wxToolbook(), Page :: integer(), Image :: integer().

Sets the image index for the given page.

image is an index into the image list which was set with setImageList/2.

setPageSize(This, Size)

-spec setPageSize(This, Size) -> ok when This :: wxToolbook(), Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxToolbook(), Page :: integer(), Text :: unicode:chardata().

Sets the text for the given page.

setSelection(This, Page)

-spec setSelection(This, Page) -> integer() when This :: wxToolbook(), Page :: integer().

Sets the selection to the given page, returning the previous selection.

Notice that the call to this function generates the page changing events, use the changeSelection/2 function if you don't want these events to be generated.

See: getSelection/1

wxTopLevelWindow

wxTopLevelWindow is a common base class for wxDialog and wxFrame.

It is an abstract base class meaning that you never work with objects of this class directly, but all of its methods are also applicable for the two classes above.

Note that the instances of wxTopLevelWindow are managed by wxWidgets in the internal top level window list.

See:

wxDialog

wxFrame

This class is derived, and can use functions, from:

wxWindow

wxEvtHandler

wxWidgets docs: wxTopLevelWindow

Events

Event types emitted from this class:

maximize

move

show

Summary

Types

wxTopLevelWindow()

Functions

centerOnScreen(This)

Equivalent to centerOnScreen(This, []).

centerOnScreen(This, Options)

Equivalent to: centreOnScreen/2

centreOnScreen(This)

Equivalent to centreOnScreen(This, []).

centreOnScreen/2

Centres the window on screen.

getIcon(This)

Returns the standard icon of the window.

getIcons(This)

Returns all icons associated with the window, there will be none of them if neither setIcon/2 nor setIcons/2 had been called before.

getTitle(This)

Gets a string containing the window title.

iconize(This)

Equivalent to iconize(This, []).

iconize/2

Iconizes or restores the window.

isActive(This)

Returns true if this window is currently active, i.e. if the user is currently working with it.

isFullScreen(This)

Returns true if the window is in fullscreen mode.

isIconized(This)

Returns true if the window is iconized.

isMaximized(This)

Returns true if the window is maximized.

maximize(This)

Equivalent to maximize(This, []).

maximize/2

Maximizes or restores the window.

requestUserAttention(This)

Equivalent to requestUserAttention(This, []).

requestUserAttention/2

Use a system-dependent way to attract users attention to the window when it is in background.

setIcon(This, Icon)

Sets the icon for this window.

setIcons(This, Icons)

Sets several icons of different sizes for this window: this allows using different icons for different situations (e.g.

setShape(This, Region)

If the platform supports it, sets the shape of the window to that depicted by region.

setTitle(This, Title)

Sets the window title.

showFullScreen(This, Show)

Equivalent to showFullScreen(This, Show, []).

showFullScreen/3

Depending on the value of show parameter the window is either shown full screen or restored to its normal state.

Types

wxTopLevelWindow()

-type wxTopLevelWindow() :: wx:wx_object().

Functions

centerOnScreen(This)

-spec centerOnScreen(This) -> ok when This :: wxTopLevelWindow().

Equivalent to centerOnScreen(This, []).

centerOnScreen(This, Options)

-spec centerOnScreen(This, [Option]) -> ok when This :: wxTopLevelWindow(), Option :: {dir, integer()}.

Equivalent to: centreOnScreen/2

centreOnScreen(This)

-spec centreOnScreen(This) -> ok when This :: wxTopLevelWindow().

Equivalent to centreOnScreen(This, []).

centreOnScreen/2

-spec centreOnScreen(This, [Option]) -> ok when This :: wxTopLevelWindow(), Option :: {dir, integer()}.

Centres the window on screen.

See: wxWindow:centreOnParent/2

getIcon(This)

-spec getIcon(This) -> wxIcon:wxIcon() when This :: wxTopLevelWindow().

Returns the standard icon of the window.

The icon will be invalid if it hadn't been previously set by setIcon/2.

See: getIcons/1

getIcons(This)

-spec getIcons(This) -> wxIconBundle:wxIconBundle() when This :: wxTopLevelWindow().

Returns all icons associated with the window, there will be none of them if neither setIcon/2 nor setIcons/2 had been called before.

Use getIcon/1 to get the main icon of the window.

See: wxIconBundle

getTitle(This)

-spec getTitle(This) -> unicode:charlist() when This :: wxTopLevelWindow().

Gets a string containing the window title.

See: setTitle/2

iconize(This)

-spec iconize(This) -> ok when This :: wxTopLevelWindow().

Equivalent to iconize(This, []).

iconize/2

-spec iconize(This, [Option]) -> ok when This :: wxTopLevelWindow(), Option :: {iconize, boolean()}.

Iconizes or restores the window.

Note that in wxGTK the change to the window state is not immediate, i.e. isIconized/1 will typically return false right after a call to iconize/2 and its return value will only change after the control flow returns to the event loop and the notification about the window being really iconized is received.

See:

isIconized/1

wxIconizeEvent

isActive(This)

-spec isActive(This) -> boolean() when This :: wxTopLevelWindow().

Returns true if this window is currently active, i.e. if the user is currently working with it.

isFullScreen(This)

-spec isFullScreen(This) -> boolean() when This :: wxTopLevelWindow().

Returns true if the window is in fullscreen mode.

See: showFullScreen/3

isIconized(This)

-spec isIconized(This) -> boolean() when This :: wxTopLevelWindow().

Returns true if the window is iconized.

isMaximized(This)

-spec isMaximized(This) -> boolean() when This :: wxTopLevelWindow().

Returns true if the window is maximized.

maximize(This)

-spec maximize(This) -> ok when This :: wxTopLevelWindow().

Equivalent to maximize(This, []).

maximize/2

-spec maximize(This, [Option]) -> ok when This :: wxTopLevelWindow(), Option :: {maximize, boolean()}.

Maximizes or restores the window.

Note that, just as with iconize/2, the change to the window state is not immediate in at least wxGTK port.

See: iconize/2

requestUserAttention(This)

-spec requestUserAttention(This) -> ok when This :: wxTopLevelWindow().

Equivalent to requestUserAttention(This, []).

requestUserAttention/2

-spec requestUserAttention(This, [Option]) -> ok
                              when This :: wxTopLevelWindow(), Option :: {flags, integer()}.

Use a system-dependent way to attract users attention to the window when it is in background.

flags may have the value of either ?wxUSER\_ATTENTION\_INFO (default) or ?wxUSER\_ATTENTION\_ERROR which results in a more drastic action. When in doubt, use the default value.

Note: This function should normally be only used when the application is not already in foreground.

This function is currently implemented for Win32 where it flashes the window icon in the taskbar, and for wxGTK with task bars supporting it.

setIcon(This, Icon)

-spec setIcon(This, Icon) -> ok when This :: wxTopLevelWindow(), Icon :: wxIcon:wxIcon().

Sets the icon for this window.

Remark: The window takes a 'copy' of icon, but since it uses reference counting, the copy is very quick. It is safe to delete icon after calling this function.

Note: In wxMSW, icon must be either 16x16 or 32x32 icon.

See:

wxIcon

setIcons/2

setIcons(This, Icons)

-spec setIcons(This, Icons) -> ok when This :: wxTopLevelWindow(), Icons :: wxIconBundle:wxIconBundle().

Sets several icons of different sizes for this window: this allows using different icons for different situations (e.g.

task switching bar, taskbar, window title bar) instead of scaling, with possibly bad looking results, the only icon set by setIcon/2.

Note: In wxMSW, icons must contain a 16x16 or 32x32 icon, preferably both.

See: wxIconBundle

setShape(This, Region)

-spec setShape(This, Region) -> boolean()
                  when
                      This :: wxTopLevelWindow(),
                      Region :: wxRegion:wxRegion() | wxGraphicsPath:wxGraphicsPath().

If the platform supports it, sets the shape of the window to that depicted by region.

The system will not display or respond to any mouse event for the pixels that lie outside of the region. To reset the window to the normal rectangular shape simply call setShape/2 again with an empty wxRegion. Returns true if the operation is successful.

This method is available in this class only since wxWidgets 2.9.3, previous versions only provided it in wxTopLevelWindow.

Note that windows with non default shape have a fixed size and can't be resized using wxWindow:setSize/6.

setTitle(This, Title)

-spec setTitle(This, Title) -> ok when This :: wxTopLevelWindow(), Title :: unicode:chardata().

Sets the window title.

See: getTitle/1

showFullScreen(This, Show)

-spec showFullScreen(This, Show) -> boolean() when This :: wxTopLevelWindow(), Show :: boolean().

Equivalent to showFullScreen(This, Show, []).

showFullScreen/3

-spec showFullScreen(This, Show, [Option]) -> boolean()
                        when This :: wxTopLevelWindow(), Show :: boolean(), Option :: {style, integer()}.

Depending on the value of show parameter the window is either shown full screen or restored to its normal state.

style is a bit list containing some or all of the following values, which indicate what elements of the window to hide in full-screen mode:

?wxFULLSCREEN\_NOMENUBAR

?wxFULLSCREEN\_NOTOOLBAR

?wxFULLSCREEN\_NOSTATUSBAR

?wxFULLSCREEN\_NOBORDER

?wxFULLSCREEN\_NOCAPTION

?wxFULLSCREEN\_ALL (all of the above)

This function has not been tested with MDI frames.

Note: Showing a window full screen also actually wxWindow:show/2s the window if it isn't shown.

See: isFullScreen/1

wxTreeCtrl

A tree control presents information as a hierarchy, with items that may be expanded to show further items.

Items in a tree control are referenced by wxTreeItemId (not implemented in wx) handles, which may be tested for validity by calling wxTreeItemId::IsOk() (not implemented in wx).

A similar control with a fully native implementation for GTK+ and macOS as well is wxDataViewTreeCtrl (not implemented in wx).

To intercept events from a tree control, use the event table macros described in wxTreeEvent.

Styles

This class supports the following styles:

wxTR_EDIT_LABELS: Use this style if you wish the user to be able to edit labels in the tree control.

wxTR_NO_BUTTONS: For convenience to document that no buttons are to be drawn.

wxTR_HAS_BUTTONS: Use this style to show + and - buttons to the left of parent items.

wxTR_TWIST_BUTTONS: Selects alternative style of +/- buttons and shows rotating ("twisting") arrows instead. Currently this style is only implemented under Microsoft Windows Vista and later Windows versions and is ignored under the other platforms as enabling it is equivalent to using wxSystemThemedControl::EnableSystemTheme() (not implemented in wx).

wxTR_NO_LINES: Use this style to hide vertical level connectors.

wxTR_FULL_ROW_HIGHLIGHT: Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window. (This flag is ignored under Windows unless you specify wxTR_NO_LINES as well.)

wxTR_LINES_AT_ROOT: Use this style to show lines leading to the root nodes (unless no wxTR_NO_LINES is also used, in which case no lines are shown). Note that in the MSW version, if this style is omitted, not only the lines, but also the button used for expanding the root item is not shown, which can be unexpected, so it is recommended to always use it.

wxTR_HIDE_ROOT: Use this style to suppress the display of the root node, effectively causing the first-level nodes to appear as a series of root nodes.

wxTR_ROW_LINES: Use this style to draw a contrasting border between displayed rows.

wxTR_HAS_VARIABLE_ROW_HEIGHT: Use this style to cause row heights to be just big enough to fit the content. If not set, all rows use the largest row height. The default is that this flag is unset. Generic only.

wxTR_SINGLE: For convenience to document that only one item may be selected at a time. Selecting another item causes the current selection, if any, to be deselected. This is the default.

wxTR_MULTIPLE: Use this style to allow a range of items to be selected. If a second range is selected, the current range, if any, is deselected.

wxTR_DEFAULT_STYLE: The set of flags that are closest to the defaults for the native control for a particular toolkit.

See also overview_windowstyles.

Win32 notes:

wxTreeCtrl class uses the standard common treeview control under Win32 implemented in the system library comctl32.dll. Some versions of this library are known to have bugs with handling the tree control colours: the usual symptom is that the expanded items leave black (or otherwise incorrectly coloured) background behind them, especially for the controls using non-default background colour. The recommended solution is to upgrade the comctl32.dll to a newer version: see http://www.microsoft.com/downloads/details.aspx?familyid=cb2cf3a2-8025-4e8f-8511-9b476a8d35d2

See:

wxTreeEvent

Overview treectrl

wxListBox

wxListCtrl

wxImageList

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxTreeCtrl

Events

Event types emitted from this class:

command_tree_begin_drag

command_tree_begin_rdrag

command_tree_end_drag

command_tree_begin_label_edit

command_tree_end_label_edit

command_tree_delete_item

command_tree_get_info

command_tree_set_info

command_tree_item_activated

command_tree_item_collapsed

command_tree_item_collapsing

command_tree_item_expanded

command_tree_item_expanding

command_tree_item_right_click

command_tree_item_middle_click

command_tree_sel_changed

command_tree_sel_changing

command_tree_key_down

command_tree_item_gettooltip

command_tree_item_menu

command_tree_state_image_click

Summary

Types

wxTreeCtrl()

Functions

addRoot(This, Text)

Equivalent to addRoot(This, Text, []).

addRoot/3

Adds the root node to the tree, returning the new item.

appendItem(This, Parent, Text)

Equivalent to appendItem(This, Parent, Text, []).

appendItem/4

Appends an item to the end of the branch identified by parent, return a new item id.

assignImageList(This, ImageList)

Sets the normal image list.

assignStateImageList(This, ImageList)

Sets the state image list.

collapse(This, Item)

Collapses the given item.

collapseAndReset(This, Item)

Collapses the given item and removes all children.

create(This, Parent)

Equivalent to create(This, Parent, []).

create/3

Creates the tree control.

delete(This, Item)

Deletes the specified item.

deleteAllItems(This)

Deletes all items in the control.

deleteChildren(This, Item)

Deletes all children of the given item (but not the item itself).

destroy(This)

Destroys the object

editLabel(This, Item)

Starts editing the label of the given item.

ensureVisible(This, Item)

Scrolls and/or expands items to ensure that the given item is visible.

expand(This, Item)

Expands the given item.

getBoundingRect(This, Item)

Equivalent to getBoundingRect(This, Item, []).

getBoundingRect/3

Retrieves the rectangle bounding the item.

getChildrenCount(This, Item)

Equivalent to getChildrenCount(This, Item, []).

getChildrenCount/3

Returns the number of items in the branch.

getCount(This)

Returns the number of items in the control.

getEditControl(This)

Returns the edit control being currently used to edit a label.

getFirstChild(This, Item)

Returns the first child; call getNextChild/3 for the next child.

getFirstVisibleItem(This)

Returns the first visible item.

getImageList(This)

Returns the normal image list.

getIndent(This)

Returns the current tree control indentation.

getItemBackgroundColour(This, Item)

Returns the background colour of the item.

getItemData(This, Item)

Returns the tree item data associated with the item.

getItemFont(This, Item)

Returns the font of the item label.

getItemImage(This, Item)

Equivalent to getItemImage(This, Item, []).

getItemImage/3

Gets the specified item image.

getItemParent(This, Item)

Returns the item's parent.

getItemText(This, Item)

Returns the item label.

getItemTextColour(This, Item)

Returns the colour of the item label.

getLastChild(This, Item)

Returns the last child of the item (or an invalid tree item if this item has no children).

getNextChild(This, Item, Cookie)

Returns the next child; call getFirstChild/2 for the first child.

getNextSibling(This, Item)

Returns the next sibling of the specified item; call getPrevSibling/2 for the previous sibling.

getNextVisible(This, Item)

Returns the next visible item or an invalid item if this item is the last visible one.

getPrevSibling(This, Item)

Returns the previous sibling of the specified item; call getNextSibling/2 for the next sibling.

getPrevVisible(This, Item)

Returns the previous visible item or an invalid item if this item is the first visible one.

getRootItem(This)

Returns the root item for the tree control.

getSelection(This)

Returns the selection, or an invalid item if there is no selection.

getSelections(This)

Fills the array of tree items passed in with the currently selected items.

getStateImageList(This)

Returns the state image list (from which application-defined state images are taken).

hitTest(This, Point)

Calculates which (if any) item is under the given point, returning the tree item id at this point plus extra information flags.

insertItem(This, Parent, Previous, Text)

Equivalent to insertItem(This, Parent, Previous, Text, []).

insertItem/5

Inserts an item after a given one (previous).

isBold(This, Item)

Returns true if the given item is in bold state.

isExpanded(This, Item)

Returns true if the item is expanded (only makes sense if it has children).

isSelected(This, Item)

Returns true if the item is selected.

isTreeItemIdOk(Item)

Returns true if the item is valid.

isVisible(This, Item)

Returns true if the item is visible on the screen.

itemHasChildren(This, Item)

Returns true if the item has children.

new()

Default Constructor.

new(Parent)

Equivalent to new(Parent, []).

new/2

Constructor, creating and showing a tree control.

prependItem(This, Parent, Text)

Equivalent to prependItem(This, Parent, Text, []).

prependItem/4

Appends an item as the first child of parent, return a new item id.

scrollTo(This, Item)

Scrolls the specified item into view.

selectItem(This, Item)

Equivalent to selectItem(This, Item, []).

selectItem/3

Selects the given item.

setImageList(This, ImageList)

Sets the normal image list.

setIndent(This, Indent)

Sets the indentation for the tree control.

setItemBackgroundColour(This, Item, Col)

Sets the colour of the item's background.

setItemBold(This, Item)

Equivalent to setItemBold(This, Item, []).

setItemBold/3

Makes item appear in bold font if bold parameter is true or resets it to the normal state.

setItemData(This, Item, Data)

Sets the item client data.

setItemDropHighlight(This, Item)

Equivalent to setItemDropHighlight(This, Item, []).

setItemDropHighlight/3

Gives the item the visual feedback for Drag'n'Drop actions, which is useful if something is dragged from the outside onto the tree control (as opposed to a DnD operation within the tree control, which already is implemented internally).

setItemFont(This, Item, Font)

Sets the item's font.

setItemHasChildren(This, Item)

Equivalent to setItemHasChildren(This, Item, []).

setItemHasChildren/3

Force appearance of the button next to the item.

setItemImage(This, Item, Image)

Equivalent to setItemImage(This, Item, Image, []).

setItemImage/4

Sets the specified item's image.

setItemText(This, Item, Text)

Sets the item label.

setItemTextColour(This, Item, Col)

Sets the colour of the item's text.

setStateImageList(This, ImageList)

Sets the state image list (from which application-defined state images are taken).

setWindowStyle(This, Styles)

Sets the mode flags associated with the display of the tree control.

sortChildren(This, Item)

Sorts the children of the given item using OnCompareItems() (not implemented in wx).

toggle(This, Item)

Toggles the given item between collapsed and expanded states.

toggleItemSelection(This, Item)

Toggles the given item between selected and unselected states.

unselect(This)

Removes the selection from the currently selected item (if any).

unselectAll(This)

This function either behaves the same as unselect/1 if the control doesn't have wxTR\_MULTIPLE style, or removes the selection from all items if it does have this style.

unselectItem(This, Item)

Unselects the given item.

Types

wxTreeCtrl()

-type wxTreeCtrl() :: wx:wx_object().

Functions

addRoot(This, Text)

-spec addRoot(This, Text) -> integer() when This :: wxTreeCtrl(), Text :: unicode:chardata().

Equivalent to addRoot(This, Text, []).

addRoot/3

-spec addRoot(This, Text, [Option]) -> integer()
                 when
                     This :: wxTreeCtrl(),
                     Text :: unicode:chardata(),
                     Option :: {image, integer()} | {selectedImage, integer()} | {data, term()}.

Adds the root node to the tree, returning the new item.

The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.

appendItem(This, Parent, Text)

-spec appendItem(This, Parent, Text) -> integer()
                    when This :: wxTreeCtrl(), Parent :: integer(), Text :: unicode:chardata().

Equivalent to appendItem(This, Parent, Text, []).

appendItem/4

-spec appendItem(This, Parent, Text, [Option]) -> integer()
                    when
                        This :: wxTreeCtrl(),
                        Parent :: integer(),
                        Text :: unicode:chardata(),
                        Option :: {image, integer()} | {selectedImage, integer()} | {data, term()}.

Appends an item to the end of the branch identified by parent, return a new item id.

The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxTreeCtrl(), ImageList :: wxImageList:wxImageList().

Sets the normal image list.

The image list assigned with this method will be automatically deleted by wxTreeCtrl as appropriate (i.e. it takes ownership of the list).

See: setImageList/2

assignStateImageList(This, ImageList)

-spec assignStateImageList(This, ImageList) -> ok
                              when This :: wxTreeCtrl(), ImageList :: wxImageList:wxImageList().

Sets the state image list.

Image list assigned with this method will be automatically deleted by wxTreeCtrl as appropriate (i.e. it takes ownership of the list).

See: setStateImageList/2

collapse(This, Item)

-spec collapse(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Collapses the given item.

collapseAndReset(This, Item)

-spec collapseAndReset(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Collapses the given item and removes all children.

create(This, Parent)

-spec create(This, Parent) -> boolean() when This :: wxTreeCtrl(), Parent :: wxWindow:wxWindow().

Equivalent to create(This, Parent, []).

create/3

-spec create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxTreeCtrl(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the tree control.

See new/2 for further details.

delete(This, Item)

-spec delete(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Deletes the specified item.

A EVT_TREE_DELETE_ITEM event will be generated.

This function may cause a subsequent call to getNextChild/3 to fail.

deleteAllItems(This)

-spec deleteAllItems(This) -> ok when This :: wxTreeCtrl().

Deletes all items in the control.

This function generates wxEVT_TREE_DELETE_ITEM events for each item being deleted, including the root one if it is shown, i.e. unless wxTR_HIDE_ROOT style is used.

deleteChildren(This, Item)

-spec deleteChildren(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Deletes all children of the given item (but not the item itself).

A wxEVT_TREE_DELETE_ITEM event will be generated for every item being deleted.

If you have called setItemHasChildren/3, you may need to call it again since deleteChildren/2 does not automatically clear the setting.

destroy(This)

-spec destroy(This :: wxTreeCtrl()) -> ok.

Destroys the object

editLabel(This, Item)

-spec editLabel(This, Item) -> wxTextCtrl:wxTextCtrl() when This :: wxTreeCtrl(), Item :: integer().

Starts editing the label of the given item.

This function generates a EVT_TREE_BEGIN_LABEL_EDIT event which can be vetoed so that no text control will appear for in-place editing.

If the user changed the label (i.e. s/he does not press ESC or leave the text control without changes, a EVT_TREE_END_LABEL_EDIT event will be sent which can be vetoed as well.

See: wxTreeEvent

ensureVisible(This, Item)

-spec ensureVisible(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Scrolls and/or expands items to ensure that the given item is visible.

This method can be used, and will work, even while the window is frozen (see wxWindow:freeze/1).

expand(This, Item)

-spec expand(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Expands the given item.

getBoundingRect(This, Item)

-spec getBoundingRect(This, Item) -> Result
                         when
                             Result ::
                                 {Res :: boolean(),
                                  Rect ::
                                      {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}},
                             This :: wxTreeCtrl(),
                             Item :: integer().

Equivalent to getBoundingRect(This, Item, []).

getBoundingRect/3

-spec getBoundingRect(This, Item, [Option]) -> Result
                         when
                             Result ::
                                 {Res :: boolean(),
                                  Rect ::
                                      {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}},
                             This :: wxTreeCtrl(),
                             Item :: integer(),
                             Option :: {textOnly, boolean()}.

Retrieves the rectangle bounding the item.

If textOnly is true, only the rectangle around the item's label will be returned, otherwise the item's image is also taken into account.

The return value is true if the rectangle was successfully retrieved or false if it was not (in this case rect is not changed) - for example, if the item is currently invisible.

Notice that the rectangle coordinates are logical, not physical ones. So, for example, the x coordinate may be negative if the tree has a horizontal scrollbar and its position is not 0.

getChildrenCount(This, Item)

-spec getChildrenCount(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Equivalent to getChildrenCount(This, Item, []).

getChildrenCount/3

-spec getChildrenCount(This, Item, [Option]) -> integer()
                          when
                              This :: wxTreeCtrl(),
                              Item :: integer(),
                              Option :: {recursively, boolean()}.

Returns the number of items in the branch.

If recursively is true, returns the total number of descendants, otherwise only one level of children is counted.

getCount(This)

-spec getCount(This) -> integer() when This :: wxTreeCtrl().

Returns the number of items in the control.

getEditControl(This)

-spec getEditControl(This) -> wxTextCtrl:wxTextCtrl() when This :: wxTreeCtrl().

Returns the edit control being currently used to edit a label.

Returns NULL if no label is being edited.

Note: This is currently only implemented for wxMSW.

getFirstChild(This, Item)

-spec getFirstChild(This, Item) -> Result
                       when
                           Result :: {Res :: integer(), Cookie :: integer()},
                           This :: wxTreeCtrl(),
                           Item :: integer().

Returns the first child; call getNextChild/3 for the next child.

For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie passed to getFirstChild/2 and getNextChild/3 should be the same variable.

Returns an invalid tree item (i.e. wxTreeItemId::IsOk() (not implemented in wx) returns false) if there are no further children.

See:

getNextChild/3

getNextSibling/2

getFirstVisibleItem(This)

-spec getFirstVisibleItem(This) -> integer() when This :: wxTreeCtrl().

Returns the first visible item.

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxTreeCtrl().

Returns the normal image list.

getIndent(This)

-spec getIndent(This) -> integer() when This :: wxTreeCtrl().

Returns the current tree control indentation.

getItemBackgroundColour(This, Item)

-spec getItemBackgroundColour(This, Item) -> wx:wx_colour4()
                                 when This :: wxTreeCtrl(), Item :: integer().

Returns the background colour of the item.

getItemData(This, Item)

-spec getItemData(This, Item) -> term() when This :: wxTreeCtrl(), Item :: integer().

Returns the tree item data associated with the item.

getItemFont(This, Item)

-spec getItemFont(This, Item) -> wxFont:wxFont() when This :: wxTreeCtrl(), Item :: integer().

Returns the font of the item label.

If the font hadn't been explicitly set for the specified item with setItemFont/3, returns an invalid ?wxNullFont font. wxWindow:getFont/1 can be used to retrieve the global tree control font used for the items without any specific font.

getItemImage(This, Item)

-spec getItemImage(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Equivalent to getItemImage(This, Item, []).

getItemImage/3

-spec getItemImage(This, Item, [Option]) -> integer()
                      when This :: wxTreeCtrl(), Item :: integer(), Option :: {which, wx:wx_enum()}.

Gets the specified item image.

The value of which may be:

?wxTreeItemIcon_Normal: to get the normal item image.

?wxTreeItemIcon_Selected: to get the selected item image (i.e. the image which is shown when the item is currently selected).

?wxTreeItemIcon_Expanded: to get the expanded image (this only makes sense for items which have children - then this image is shown when the item is expanded and the normal image is shown when it is collapsed).

?wxTreeItemIcon_SelectedExpanded: to get the selected expanded image (which is shown when an expanded item is currently selected).

getItemParent(This, Item)

-spec getItemParent(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the item's parent.

getItemText(This, Item)

-spec getItemText(This, Item) -> unicode:charlist() when This :: wxTreeCtrl(), Item :: integer().

Returns the item label.

getItemTextColour(This, Item)

-spec getItemTextColour(This, Item) -> wx:wx_colour4() when This :: wxTreeCtrl(), Item :: integer().

Returns the colour of the item label.

getLastChild(This, Item)

-spec getLastChild(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the last child of the item (or an invalid tree item if this item has no children).

See:

getFirstChild/2

getNextSibling/2

getLastChild/2

getNextChild(This, Item, Cookie)

-spec getNextChild(This, Item, Cookie) -> Result
                      when
                          Result :: {Res :: integer(), Cookie :: integer()},
                          This :: wxTreeCtrl(),
                          Item :: integer(),
                          Cookie :: integer().

Returns the next child; call getFirstChild/2 for the first child.

For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie passed to getFirstChild/2 and getNextChild/3 should be the same.

Returns an invalid tree item if there are no further children.

See: getFirstChild/2

getNextSibling(This, Item)

-spec getNextSibling(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the next sibling of the specified item; call getPrevSibling/2 for the previous sibling.

Returns an invalid tree item if there are no further siblings.

See: getPrevSibling/2

getNextVisible(This, Item)

-spec getNextVisible(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the next visible item or an invalid item if this item is the last visible one.

Note: The item itself must be visible.

getPrevSibling(This, Item)

-spec getPrevSibling(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the previous sibling of the specified item; call getNextSibling/2 for the next sibling.

Returns an invalid tree item if there are no further children.

See: getNextSibling/2

getPrevVisible(This, Item)

-spec getPrevVisible(This, Item) -> integer() when This :: wxTreeCtrl(), Item :: integer().

Returns the previous visible item or an invalid item if this item is the first visible one.

Note: The item itself must be visible.

getRootItem(This)

-spec getRootItem(This) -> integer() when This :: wxTreeCtrl().

Returns the root item for the tree control.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxTreeCtrl().

Returns the selection, or an invalid item if there is no selection.

This function only works with the controls without wxTR_MULTIPLE style, use getSelections/1 for the controls which do have this style or, if a single item is wanted, use GetFocusedItem() (not implemented in wx).

getSelections(This)

-spec getSelections(This) -> Result
                       when Result :: {Res :: integer(), Selection :: [integer()]}, This :: wxTreeCtrl().

Fills the array of tree items passed in with the currently selected items.

This function can be called only if the control has the wxTR_MULTIPLE style.

Returns the number of selected items.

getStateImageList(This)

-spec getStateImageList(This) -> wxImageList:wxImageList() when This :: wxTreeCtrl().

Returns the state image list (from which application-defined state images are taken).

hitTest(This, Point)

-spec hitTest(This, Point) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxTreeCtrl(),
                     Point :: {X :: integer(), Y :: integer()}.

Calculates which (if any) item is under the given point, returning the tree item id at this point plus extra information flags.

flags is a bitlist of the following:

wxTREE_HITTEST_ABOVE: Above the client area.

wxTREE_HITTEST_BELOW: Below the client area.

wxTREE_HITTEST_NOWHERE: In the client area but below the last item.

wxTREE_HITTEST_ONITEMBUTTON: On the button associated with an item.

wxTREE_HITTEST_ONITEMICON: On the bitmap associated with an item.

wxTREE_HITTEST_ONITEMINDENT: In the indentation associated with an item.

wxTREE_HITTEST_ONITEMLABEL: On the label (string) associated with an item.

wxTREE_HITTEST_ONITEMRIGHT: In the area to the right of an item.

wxTREE_HITTEST_ONITEMSTATEICON: On the state icon for a tree view item that is in a user-defined state.

wxTREE_HITTEST_TOLEFT: To the right of the client area.

wxTREE_HITTEST_TORIGHT: To the left of the client area.

insertItem(This, Parent, Previous, Text)

-spec insertItem(This, Parent, Previous, Text) -> integer()
                    when
                        This :: wxTreeCtrl(),
                        Parent :: integer(),
                        Previous :: integer(),
                        Text :: unicode:chardata().

Equivalent to insertItem(This, Parent, Previous, Text, []).

insertItem/5

-spec insertItem(This, Parent, Previous, Text, [Option]) -> integer()
                    when
                        This :: wxTreeCtrl(),
                        Parent :: integer(),
                        Previous :: integer(),
                        Text :: unicode:chardata(),
                        Option :: {image, integer()} | {selImage, integer()} | {data, term()}.

Inserts an item after a given one (previous).

The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.

isBold(This, Item)

-spec isBold(This, Item) -> boolean() when This :: wxTreeCtrl(), Item :: integer().

Returns true if the given item is in bold state.

See: setItemBold/3

isExpanded(This, Item)

-spec isExpanded(This, Item) -> boolean() when This :: wxTreeCtrl(), Item :: integer().

Returns true if the item is expanded (only makes sense if it has children).

isSelected(This, Item)

-spec isSelected(This, Item) -> boolean() when This :: wxTreeCtrl(), Item :: integer().

Returns true if the item is selected.

isTreeItemIdOk(Item)

-spec isTreeItemIdOk(Item) -> boolean() when Item :: integer().

Returns true if the item is valid.

isVisible(This, Item)

-spec isVisible(This, Item) -> boolean() when This :: wxTreeCtrl(), Item :: integer().

Returns true if the item is visible on the screen.

itemHasChildren(This, Item)

-spec itemHasChildren(This, Item) -> boolean() when This :: wxTreeCtrl(), Item :: integer().

Returns true if the item has children.

new()

-spec new() -> wxTreeCtrl().

Default Constructor.

new(Parent)

-spec new(Parent) -> wxTreeCtrl() when Parent :: wxWindow:wxWindow().

Equivalent to new(Parent, []).

new/2

-spec new(Parent, [Option]) -> wxTreeCtrl()
             when
                 Parent :: wxWindow:wxWindow(),
                 Option ::
                     {id, integer()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a tree control.

See: create/3

prependItem(This, Parent, Text)

-spec prependItem(This, Parent, Text) -> integer()
                     when This :: wxTreeCtrl(), Parent :: integer(), Text :: unicode:chardata().

Equivalent to prependItem(This, Parent, Text, []).

prependItem/4

-spec prependItem(This, Parent, Text, [Option]) -> integer()
                     when
                         This :: wxTreeCtrl(),
                         Parent :: integer(),
                         Text :: unicode:chardata(),
                         Option :: {image, integer()} | {selectedImage, integer()} | {data, term()}.

Appends an item as the first child of parent, return a new item id.

The image and selImage parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selImage is -1, the same image is used for both selected and unselected items.

scrollTo(This, Item)

-spec scrollTo(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Scrolls the specified item into view.

Note that this method doesn't work while the window is frozen (See wxWindow:freeze/1), at least under MSW.

See: ensureVisible/2

selectItem(This, Item)

-spec selectItem(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Equivalent to selectItem(This, Item, []).

selectItem/3

-spec selectItem(This, Item, [Option]) -> ok
                    when This :: wxTreeCtrl(), Item :: integer(), Option :: {select, boolean()}.

Selects the given item.

In multiple selection controls, can be also used to deselect a currently selected item if the value of select is false.

Notice that calling this method will generate wxEVT_TREE_SEL_CHANGING and wxEVT_TREE_SEL_CHANGED events and that the change could be vetoed by the former event handler.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxTreeCtrl(), ImageList :: wxImageList:wxImageList().

Sets the normal image list.

The image list assigned with this method will not be deleted by wxTreeCtrl's destructor, you must delete it yourself.

See: assignImageList/2

setIndent(This, Indent)

-spec setIndent(This, Indent) -> ok when This :: wxTreeCtrl(), Indent :: integer().

Sets the indentation for the tree control.

setItemBackgroundColour(This, Item, Col)

-spec setItemBackgroundColour(This, Item, Col) -> ok
                                 when This :: wxTreeCtrl(), Item :: integer(), Col :: wx:wx_colour().

Sets the colour of the item's background.

setItemBold(This, Item)

-spec setItemBold(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Equivalent to setItemBold(This, Item, []).

setItemBold/3

-spec setItemBold(This, Item, [Option]) -> ok
                     when This :: wxTreeCtrl(), Item :: integer(), Option :: {bold, boolean()}.

Makes item appear in bold font if bold parameter is true or resets it to the normal state.

See: isBold/2

setItemData(This, Item, Data)

-spec setItemData(This, Item, Data) -> ok when This :: wxTreeCtrl(), Item :: integer(), Data :: term().

Sets the item client data.

Notice that the client data previously associated with the item (if any) is not freed by this function and so calling this function multiple times for the same item will result in memory leaks unless you delete the old item data pointer yourself.

setItemDropHighlight(This, Item)

-spec setItemDropHighlight(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Equivalent to setItemDropHighlight(This, Item, []).

setItemDropHighlight/3

-spec setItemDropHighlight(This, Item, [Option]) -> ok
                              when
                                  This :: wxTreeCtrl(),
                                  Item :: integer(),
                                  Option :: {highlight, boolean()}.

Gives the item the visual feedback for Drag'n'Drop actions, which is useful if something is dragged from the outside onto the tree control (as opposed to a DnD operation within the tree control, which already is implemented internally).

setItemFont(This, Item, Font)

-spec setItemFont(This, Item, Font) -> ok
                     when This :: wxTreeCtrl(), Item :: integer(), Font :: wxFont:wxFont().

Sets the item's font.

All items in the tree should have the same height to avoid text clipping, so the fonts height should be the same for all of them, although font attributes may vary.

See: setItemBold/3

setItemHasChildren(This, Item)

-spec setItemHasChildren(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Equivalent to setItemHasChildren(This, Item, []).

setItemHasChildren/3

-spec setItemHasChildren(This, Item, [Option]) -> ok
                            when This :: wxTreeCtrl(), Item :: integer(), Option :: {has, boolean()}.

Force appearance of the button next to the item.

This is useful to allow the user to expand the items which don't have any children now, but instead adding them only when needed, thus minimizing memory usage and loading time.

setItemImage(This, Item, Image)

-spec setItemImage(This, Item, Image) -> ok
                      when This :: wxTreeCtrl(), Item :: integer(), Image :: integer().

Equivalent to setItemImage(This, Item, Image, []).

setItemImage/4

-spec setItemImage(This, Item, Image, [Option]) -> ok
                      when
                          This :: wxTreeCtrl(),
                          Item :: integer(),
                          Image :: integer(),
                          Option :: {which, wx:wx_enum()}.

Sets the specified item's image.

See getItemImage/3 for the description of the which parameter.

setItemText(This, Item, Text)

-spec setItemText(This, Item, Text) -> ok
                     when This :: wxTreeCtrl(), Item :: integer(), Text :: unicode:chardata().

Sets the item label.

setItemTextColour(This, Item, Col)

-spec setItemTextColour(This, Item, Col) -> ok
                           when This :: wxTreeCtrl(), Item :: integer(), Col :: wx:wx_colour().

Sets the colour of the item's text.

setStateImageList(This, ImageList)

-spec setStateImageList(This, ImageList) -> ok
                           when This :: wxTreeCtrl(), ImageList :: wxImageList:wxImageList().

Sets the state image list (from which application-defined state images are taken).

Image list assigned with this method will not be deleted by wxTreeCtrl's destructor, you must delete it yourself.

See: assignStateImageList/2

setWindowStyle(This, Styles)

-spec setWindowStyle(This, Styles) -> ok when This :: wxTreeCtrl(), Styles :: integer().

Sets the mode flags associated with the display of the tree control.

The new mode takes effect immediately.

Note: Generic only; MSW ignores changes.

sortChildren(This, Item)

-spec sortChildren(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Sorts the children of the given item using OnCompareItems() (not implemented in wx).

You should override that method to change the sort order (the default is ascending case-sensitive alphabetical order).

toggle(This, Item)

-spec toggle(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Toggles the given item between collapsed and expanded states.

toggleItemSelection(This, Item)

-spec toggleItemSelection(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Toggles the given item between selected and unselected states.

For multiselection controls only.

unselect(This)

-spec unselect(This) -> ok when This :: wxTreeCtrl().

Removes the selection from the currently selected item (if any).

unselectAll(This)

-spec unselectAll(This) -> ok when This :: wxTreeCtrl().

This function either behaves the same as unselect/1 if the control doesn't have wxTR\_MULTIPLE style, or removes the selection from all items if it does have this style.

unselectItem(This, Item)

-spec unselectItem(This, Item) -> ok when This :: wxTreeCtrl(), Item :: integer().

Unselects the given item.

This works in multiselection controls only.

wxTreeEvent

A tree event holds information about events associated with wxTreeCtrl objects.

To process input from a tree control, use these event handler macros to direct input to member functions that take a wxTreeEvent argument.

See: wxTreeCtrl

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxTreeEvent

Events

Use wxEvtHandler:connect/3 with wxTreeEventType to subscribe to events of this type.

Summary

Types

wxTree()

wxTreeEvent()

wxTreeEventType()

Functions

getItem(This)

Returns the item (valid for all events).

getKeyCode(This)

Returns the key code if the event is a key event.

getKeyEvent(This)

Returns the key event for EVT_TREE_KEY_DOWN events.

getLabel(This)

Returns the label if the event is a begin or end edit label event.

getOldItem(This)

Returns the old item index (valid for EVT\_TREE\_SEL\_CHANGING and EVT\_TREE\_SEL\_CHANGED events).

getPoint(This)

Returns the position of the mouse pointer if the event is a drag or menu-context event.

isEditCancelled(This)

Returns true if the label edit was cancelled.

setToolTip(This, Tooltip)

Set the tooltip for the item (valid for EVT\_TREE\_ITEM\_GETTOOLTIP events).

Types

wxTree()

-type wxTree() ::
          #wxTree{type :: wxTreeEvent:wxTreeEventType(),
                  item :: integer(),
                  itemOld :: integer(),
                  pointDrag :: {X :: integer(), Y :: integer()}}.

wxTreeEvent()

-type wxTreeEvent() :: wx:wx_object().

wxTreeEventType()

-type wxTreeEventType() ::
          command_tree_begin_drag | command_tree_begin_rdrag | command_tree_begin_label_edit |
          command_tree_end_label_edit | command_tree_delete_item | command_tree_get_info |
          command_tree_set_info | command_tree_item_expanded | command_tree_item_expanding |
          command_tree_item_collapsed | command_tree_item_collapsing | command_tree_sel_changed |
          command_tree_sel_changing | command_tree_key_down | command_tree_item_activated |
          command_tree_item_right_click | command_tree_item_middle_click | command_tree_end_drag |
          command_tree_state_image_click | command_tree_item_gettooltip | command_tree_item_menu |
          dirctrl_selectionchanged | dirctrl_fileactivated.

Functions

getItem(This)

-spec getItem(This) -> integer() when This :: wxTreeEvent().

Returns the item (valid for all events).

getKeyCode(This)

-spec getKeyCode(This) -> integer() when This :: wxTreeEvent().

Returns the key code if the event is a key event.

Use getKeyEvent/1 to get the values of the modifier keys for this event (i.e. Shift or Ctrl).

getKeyEvent(This)

-spec getKeyEvent(This) -> wxKeyEvent:wxKeyEvent() when This :: wxTreeEvent().

Returns the key event for EVT_TREE_KEY_DOWN events.

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxTreeEvent().

Returns the label if the event is a begin or end edit label event.

getOldItem(This)

-spec getOldItem(This) -> integer() when This :: wxTreeEvent().

Returns the old item index (valid for EVT\_TREE\_SEL\_CHANGING and EVT\_TREE\_SEL\_CHANGED events).

getPoint(This)

-spec getPoint(This) -> {X :: integer(), Y :: integer()} when This :: wxTreeEvent().

Returns the position of the mouse pointer if the event is a drag or menu-context event.

In both cases the position is in client coordinates - i.e. relative to the wxTreeCtrl window (so that you can pass it directly to e.g. wxWindow:popupMenu/4).

isEditCancelled(This)

-spec isEditCancelled(This) -> boolean() when This :: wxTreeEvent().

Returns true if the label edit was cancelled.

This should be called from within an EVT_TREE_END_LABEL_EDIT handler.

setToolTip(This, Tooltip)

-spec setToolTip(This, Tooltip) -> ok when This :: wxTreeEvent(), Tooltip :: unicode:chardata().

Set the tooltip for the item (valid for EVT\_TREE\_ITEM\_GETTOOLTIP events).

Windows only.

wxTreebook

This class is an extension of the wxNotebook class that allows a tree structured set of pages to be shown in a control.

A classic example is a netscape preferences dialog that shows a tree of preference sections on the left and select section page on the right.

To use the class simply create it and populate with pages using insertPage/5, insertSubPage/5, addPage/4, AddSubPage() (not implemented in wx).

If your tree is no more than 1 level in depth then you could simply use addPage/4 and AddSubPage() (not implemented in wx) to sequentially populate your tree by adding at every step a page or a subpage to the end of the tree.

See:

?wxBookCtrl

wxBookCtrlEvent

wxNotebook

wxTreeCtrl

wxImageList

Overview bookctrl

Examples

This class is derived, and can use functions, from:

wxBookCtrlBase

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxTreebook

Events

Event types emitted from this class:

treebook_page_changed

treebook_page_changing

Summary

Types

wxTreebook()

Functions

addPage(This, Page, Text)

Equivalent to addPage(This, Page, Text, []).

addPage/4

Adds a new page.

advanceSelection(This)

Equivalent to advanceSelection(This, []).

advanceSelection/2

Cycles through the tabs.

assignImageList(This, ImageList)

Sets the image list for the page control and takes ownership of the list.

changeSelection(This, Page)

Changes the selection to the given page, returning the previous selection.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Creates a treebook control.

deleteAllPages(This)

Deletes all pages.

destroy(This)

Destroys the object

expandNode(This, PageId)

Equivalent to expandNode(This, PageId, []).

expandNode/3

Expands (collapses) the pageId node.

getCurrentPage(This)

Returns the currently selected page or NULL.

getImageList(This)

Returns the associated image list, may be NULL.

getPage(This, Page)

Returns the window at the given page position.

getPageCount(This)

Returns the number of pages in the control.

getPageImage(This, NPage)

Returns the image index for the given page.

getPageText(This, NPage)

Returns the string for the given page.

getSelection(This)

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

hitTest(This, Pt)

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

insertPage(This, PagePos, Page, Text)

Equivalent to insertPage(This, PagePos, Page, Text, []).

insertPage/5

Inserts a new page just before the page indicated by pagePos.

insertSubPage(This, PagePos, Page, Text)

Equivalent to insertSubPage(This, PagePos, Page, Text, []).

insertSubPage/5

Inserts a sub page under the specified page.

isNodeExpanded(This, PageId)

Returns true if the page represented by pageId is expanded.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Creates an empty wxTreebook.

setImageList(This, ImageList)

Sets the image list to use.

setPageImage(This, Page, Image)

Sets the image index for the given page.

setPageSize(This, Size)

Sets the width and height of the pages.

setPageText(This, Page, Text)

Sets the text for the given page.

setSelection(This, Page)

Sets the selection to the given page, returning the previous selection.

Types

wxTreebook()

-type wxTreebook() :: wx:wx_object().

Functions

addPage(This, Page, Text)

-spec addPage(This, Page, Text) -> boolean()
                 when This :: wxTreebook(), Page :: wxWindow:wxWindow(), Text :: unicode:chardata().

Equivalent to addPage(This, Page, Text, []).

addPage/4

-spec addPage(This, Page, Text, [Option]) -> boolean()
                 when
                     This :: wxTreebook(),
                     Page :: wxWindow:wxWindow(),
                     Text :: unicode:chardata(),
                     Option :: {bSelect, boolean()} | {imageId, integer()}.

Adds a new page.

The page is placed at the topmost level after all other pages. NULL could be specified for page to create an empty page.

advanceSelection(This)

-spec advanceSelection(This) -> ok when This :: wxTreebook().

Equivalent to advanceSelection(This, []).

advanceSelection/2

-spec advanceSelection(This, [Option]) -> ok when This :: wxTreebook(), Option :: {forward, boolean()}.

Cycles through the tabs.

The call to this function generates the page changing events.

assignImageList(This, ImageList)

-spec assignImageList(This, ImageList) -> ok
                         when This :: wxTreebook(), ImageList :: wxImageList:wxImageList().

Sets the image list for the page control and takes ownership of the list.

See:

wxImageList

setImageList/2

changeSelection(This, Page)

-spec changeSelection(This, Page) -> integer() when This :: wxTreebook(), Page :: integer().

Changes the selection to the given page, returning the previous selection.

This function behaves as setSelection/2 but does not generate the page changing events.

See overview_events_prog for more information.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxTreebook(), Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxTreebook(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Creates a treebook control.

See new/3 for the description of the parameters.

deleteAllPages(This)

-spec deleteAllPages(This) -> boolean() when This :: wxTreebook().

Deletes all pages.

destroy(This)

-spec destroy(This :: wxTreebook()) -> ok.

Destroys the object

expandNode(This, PageId)

-spec expandNode(This, PageId) -> boolean() when This :: wxTreebook(), PageId :: integer().

Equivalent to expandNode(This, PageId, []).

expandNode/3

-spec expandNode(This, PageId, [Option]) -> boolean()
                    when This :: wxTreebook(), PageId :: integer(), Option :: {expand, boolean()}.

Expands (collapses) the pageId node.

Returns the previous state. May generate page changing events (if selected page is under the collapsed branch, then its parent is autoselected).

getCurrentPage(This)

-spec getCurrentPage(This) -> wxWindow:wxWindow() when This :: wxTreebook().

Returns the currently selected page or NULL.

getImageList(This)

-spec getImageList(This) -> wxImageList:wxImageList() when This :: wxTreebook().

Returns the associated image list, may be NULL.

See:

wxImageList

setImageList/2

getPage(This, Page)

-spec getPage(This, Page) -> wxWindow:wxWindow() when This :: wxTreebook(), Page :: integer().

Returns the window at the given page position.

getPageCount(This)

-spec getPageCount(This) -> integer() when This :: wxTreebook().

Returns the number of pages in the control.

getPageImage(This, NPage)

-spec getPageImage(This, NPage) -> integer() when This :: wxTreebook(), NPage :: integer().

Returns the image index for the given page.

getPageText(This, NPage)

-spec getPageText(This, NPage) -> unicode:charlist() when This :: wxTreebook(), NPage :: integer().

Returns the string for the given page.

getSelection(This)

-spec getSelection(This) -> integer() when This :: wxTreebook().

Returns the currently selected page, or wxNOT\_FOUND if none was selected.

Note: This method may return either the previously or newly selected page when called from the EVT_TREEBOOK_PAGE_CHANGED() handler depending on the platform and so wxBookCtrlEvent:getSelection/1 should be used instead in this case.

hitTest(This, Pt)

-spec hitTest(This, Pt) -> Result
                 when
                     Result :: {Res :: integer(), Flags :: integer()},
                     This :: wxTreebook(),
                     Pt :: {X :: integer(), Y :: integer()}.

Returns the index of the tab at the specified position or wxNOT\_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.

insertPage(This, PagePos, Page, Text)

-spec insertPage(This, PagePos, Page, Text) -> boolean()
                    when
                        This :: wxTreebook(),
                        PagePos :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata().

Equivalent to insertPage(This, PagePos, Page, Text, []).

insertPage/5

-spec insertPage(This, PagePos, Page, Text, [Option]) -> boolean()
                    when
                        This :: wxTreebook(),
                        PagePos :: integer(),
                        Page :: wxWindow:wxWindow(),
                        Text :: unicode:chardata(),
                        Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a new page just before the page indicated by pagePos.

The new page is placed before pagePos page and on the same level. NULL could be specified for page to create an empty page.

insertSubPage(This, PagePos, Page, Text)

-spec insertSubPage(This, PagePos, Page, Text) -> boolean()
                       when
                           This :: wxTreebook(),
                           PagePos :: integer(),
                           Page :: wxWindow:wxWindow(),
                           Text :: unicode:chardata().

Equivalent to insertSubPage(This, PagePos, Page, Text, []).

insertSubPage/5

-spec insertSubPage(This, PagePos, Page, Text, [Option]) -> boolean()
                       when
                           This :: wxTreebook(),
                           PagePos :: integer(),
                           Page :: wxWindow:wxWindow(),
                           Text :: unicode:chardata(),
                           Option :: {bSelect, boolean()} | {imageId, integer()}.

Inserts a sub page under the specified page.

NULL could be specified for page to create an empty page.

isNodeExpanded(This, PageId)

-spec isNodeExpanded(This, PageId) -> boolean() when This :: wxTreebook(), PageId :: integer().

Returns true if the page represented by pageId is expanded.

new()

-spec new() -> wxTreebook().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxTreebook() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxTreebook()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Creates an empty wxTreebook.

setImageList(This, ImageList)

-spec setImageList(This, ImageList) -> ok
                      when This :: wxTreebook(), ImageList :: wxImageList:wxImageList().

Sets the image list to use.

It does not take ownership of the image list, you must delete it yourself.

See:

wxImageList

assignImageList/2

setPageImage(This, Page, Image)

-spec setPageImage(This, Page, Image) -> boolean()
                      when This :: wxTreebook(), Page :: integer(), Image :: integer().

Sets the image index for the given page.

image is an index into the image list which was set with setImageList/2.

setPageSize(This, Size)

-spec setPageSize(This, Size) -> ok when This :: wxTreebook(), Size :: {W :: integer(), H :: integer()}.

Sets the width and height of the pages.

Note: This method is currently not implemented for wxGTK.

setPageText(This, Page, Text)

-spec setPageText(This, Page, Text) -> boolean()
                     when This :: wxTreebook(), Page :: integer(), Text :: unicode:chardata().

Sets the text for the given page.

setSelection(This, Page)

-spec setSelection(This, Page) -> integer() when This :: wxTreebook(), Page :: integer().

Sets the selection to the given page, returning the previous selection.

Notice that the call to this function generates the page changing events, use the changeSelection/2 function if you don't want these events to be generated.

See: wxBookCtrlBase:getSelection/1

wxUpdateUIEvent

This class is used for pseudo-events which are called by wxWidgets to give an application the chance to update various user interface elements.

Without update UI events, an application has to work hard to check/uncheck, enable/disable, show/hide, and set the text for elements such as menu items and toolbar buttons. The code for doing this has to be mixed up with the code that is invoked when an action is invoked for a menu item or button.

With update UI events, you define an event handler to look at the state of the application and change UI elements accordingly. wxWidgets will call your member functions in idle time, so you don't have to worry where to call this code.

In addition to being a clearer and more declarative method, it also means you don't have to worry whether you're updating a toolbar or menubar identifier. The same handler can update a menu item and toolbar button, if the identifier is the same. Instead of directly manipulating the menu or button, you call functions in the event object, such as check/2. wxWidgets will determine whether such a call has been made, and which UI element to update.

These events will work for popup menus as well as menubars. Just before a menu is popped up, wxMenu::UpdateUI (not implemented in wx) is called to process any UI events for the window that owns the menu.

If you find that the overhead of UI update processing is affecting your application, you can do one or both of the following:

Call setMode/1 with a value of wxUPDATE_UI_PROCESS_SPECIFIED, and set the extra style wxWS_EX_PROCESS_UI_UPDATES for every window that should receive update events. No other windows will receive update events.

Call setUpdateInterval/1 with a millisecond value to set the delay between updates. You may need to call wxWindow:updateWindowUI/2 at critical points, for example when a dialog is about to be shown, in case the user sees a slight delay before windows are updated.

Note that although events are sent in idle time, defining a wxIdleEvent handler for a window does not affect this because the events are sent from wxWindow::OnInternalIdle (not implemented in wx) which is always called in idle time.

wxWidgets tries to optimize update events on some platforms. On Windows and GTK+, events for menubar items are only sent when the menu is about to be shown, and not in idle time.

See: Overview events

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxUpdateUIEvent

Events

Use wxEvtHandler:connect/3 with wxUpdateUIEventType to subscribe to events of this type.

Summary

Types

wxUpdateUI()

wxUpdateUIEvent()

wxUpdateUIEventType()

Functions

canUpdate(Window)

Returns true if it is appropriate to update (send UI update events to) this window.

check(This, Check)

Check or uncheck the UI element.

enable(This, Enable)

Enable or disable the UI element.

getChecked(This)

Returns true if the UI element should be checked.

getEnabled(This)

Returns true if the UI element should be enabled.

getMode()

Static function returning a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.

getSetChecked(This)

Returns true if the application has called check/2.

getSetEnabled(This)

Returns true if the application has called enable/2.

getSetShown(This)

Returns true if the application has called show/2.

getSetText(This)

Returns true if the application has called setText/2.

getShown(This)

Returns true if the UI element should be shown.

getText(This)

Returns the text that should be set for the UI element.

getUpdateInterval()

Returns the current interval between updates in milliseconds.

resetUpdateTime()

Used internally to reset the last-updated time to the current time.

setMode(Mode)

Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.

setText(This, Text)

Sets the text for this UI element.

setUpdateInterval(UpdateInterval)

Sets the interval between updates in milliseconds.

show(This, Show)

Show or hide the UI element.

Types

wxUpdateUI()

-type wxUpdateUI() :: #wxUpdateUI{type :: wxUpdateUIEvent:wxUpdateUIEventType()}.

wxUpdateUIEvent()

-type wxUpdateUIEvent() :: wx:wx_object().

wxUpdateUIEventType()

-type wxUpdateUIEventType() :: update_ui.

Functions

canUpdate(Window)

-spec canUpdate(Window) -> boolean() when Window :: wxWindow:wxWindow().

Returns true if it is appropriate to update (send UI update events to) this window.

This function looks at the mode used (see setMode/1), the wxWS_EX_PROCESS_UI_UPDATES flag in window, the time update events were last sent in idle time, and the update interval, to determine whether events should be sent to this window now. By default this will always return true because the update mode is initially wxUPDATE_UI_PROCESS_ALL and the interval is set to 0; so update events will be sent as often as possible. You can reduce the frequency that events are sent by changing the mode and/or setting an update interval.

See:

resetUpdateTime/0

setUpdateInterval/1

setMode/1

check(This, Check)

-spec check(This, Check) -> ok when This :: wxUpdateUIEvent(), Check :: boolean().

Check or uncheck the UI element.

enable(This, Enable)

-spec enable(This, Enable) -> ok when This :: wxUpdateUIEvent(), Enable :: boolean().

Enable or disable the UI element.

getChecked(This)

-spec getChecked(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the UI element should be checked.

getEnabled(This)

-spec getEnabled(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the UI element should be enabled.

getMode()

-spec getMode() -> wx:wx_enum().

Static function returning a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.

See: setMode/1

getSetChecked(This)

-spec getSetChecked(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the application has called check/2.

For wxWidgets internal use only.

getSetEnabled(This)

-spec getSetEnabled(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the application has called enable/2.

For wxWidgets internal use only.

getSetShown(This)

-spec getSetShown(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the application has called show/2.

For wxWidgets internal use only.

getSetText(This)

-spec getSetText(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the application has called setText/2.

For wxWidgets internal use only.

getShown(This)

-spec getShown(This) -> boolean() when This :: wxUpdateUIEvent().

Returns true if the UI element should be shown.

getText(This)

-spec getText(This) -> unicode:charlist() when This :: wxUpdateUIEvent().

Returns the text that should be set for the UI element.

getUpdateInterval()

-spec getUpdateInterval() -> integer().

Returns the current interval between updates in milliseconds.

The value -1 disables updates, 0 updates as frequently as possible.

See: setUpdateInterval/1

resetUpdateTime()

-spec resetUpdateTime() -> ok.

Used internally to reset the last-updated time to the current time.

It is assumed that update events are normally sent in idle time, so this is called at the end of idle processing.

See:

canUpdate/1

setUpdateInterval/1

setMode/1

setMode(Mode)

-spec setMode(Mode) -> ok when Mode :: wx:wx_enum().

Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events.

setText(This, Text)

-spec setText(This, Text) -> ok when This :: wxUpdateUIEvent(), Text :: unicode:chardata().

Sets the text for this UI element.

setUpdateInterval(UpdateInterval)

-spec setUpdateInterval(UpdateInterval) -> ok when UpdateInterval :: integer().

Sets the interval between updates in milliseconds.

Set to -1 to disable updates, or to 0 to update as frequently as possible. The default is 0.

Use this to reduce the overhead of UI update events if your application has a lot of windows. If you set the value to -1 or greater than 0, you may also need to call wxWindow:updateWindowUI/2 at appropriate points in your application, such as when a dialog is about to be shown.

show(This, Show)

-spec show(This, Show) -> ok when This :: wxUpdateUIEvent(), Show :: boolean().

Show or hide the UI element.

wxWebView

This control may be used to render web (HTML / CSS / javascript) documents.

It is designed to allow the creation of multiple backends for each port, although currently just one is available. It differs from wxHtmlWindow in that each backend is actually a full rendering engine, Trident on MSW and Webkit on macOS and GTK. This allows the correct viewing of complex pages with javascript and css.

Backend Descriptions

Par:

The IE backend uses Microsoft's Trident rendering engine, specifically the version used by the locally installed copy of Internet Explorer. As such it is only available for the MSW port. By default recent versions of the WebBrowser control, which this backend uses, emulate Internet Explorer 7. This can be changed with a registry setting by wxWebView::MSWSetEmulationLevel() see this article for more information. This backend has full support for custom schemes and virtual file systems.

Par:

The Edge (Chromium) backend uses Microsoft's Edge WebView2. It is available for Windows 7 and newer. The following features are currently unsupported with this backend: virtual filesystems, custom urls, find.

This backend is not enabled by default, to build it follow these steps:

Visual Studio 2015, or newer, is required

Download the WebView2 SDK nuget package (Version 0.9.488 or newer)

Extract the package (it's a zip archive) to wxWidgets/3rdparty/webview2 (you should have 3rdparty/webview2/build/native/include/WebView2.h file after unpacking it)

Enable wxUSE_WEBVIEW_EDGE in CMake or setup.h

Build wxWidgets webview library

Copy WebView2Loader.dll from the subdirectory corresponding to the architecture used (x86 or x64) of wxWidgets/3rdparty/webview2/build/ to your applications executable

At runtime you can use isBackendAvailable/1 to check if the backend can be used (it will be available if WebView2Loader.dll can be loaded and Edge (Chromium) is installed)

Make sure to add a note about using the WebView2 SDK to your application documentation, as required by its licence

Par:

Under GTK the WebKit backend uses WebKitGTK+. The current minimum version required is 1.3.1 which ships by default with Ubuntu Natty and Debian Wheezy and has the package name libwebkitgtk-dev. Custom schemes and virtual files systems are supported under this backend, however embedded resources such as images and stylesheets are currently loaded using the data:// scheme.

Par:

Under GTK3 the WebKit2 version of WebKitGTK+ is used. In Ubuntu the required package name is libwebkit2gtk-4.0-dev and under Fedora it is webkitgtk4-devel. All wxWEBVIEW_WEBKIT features are supported except for clearing and enabling / disabling the history.

Par:

The macOS WebKit backend uses Apple's WebView class. This backend has full support for custom schemes and virtual file systems.

Asynchronous Notifications

Many of the methods in wxWebView are asynchronous, i.e. they return immediately and perform their work in the background. This includes functions such as loadURL/2 and reload/2. To receive notification of the progress and completion of these functions you need to handle the events that are provided. Specifically wxEVT_WEBVIEW_LOADED notifies when the page or a sub-frame has finished loading and wxEVT_WEBVIEW_ERROR notifies that an error has occurred.

Virtual File Systems and Custom Schemes

wxWebView supports the registering of custom scheme handlers, for example file or http. To do this create a new class which inherits from wxWebViewHandler (not implemented in wx), where wxWebHandler::GetFile() returns a pointer to a wxFSFile (not implemented in wx) which represents the given url. You can then register your handler with RegisterHandler() (not implemented in wx) it will be called for all pages and resources.

wxWebViewFSHandler (not implemented in wx) is provided to access the virtual file system encapsulated by wxFileSystem (not implemented in wx). The wxMemoryFSHandler (not implemented in wx) documentation gives an example of how this may be used.

wxWebViewArchiveHandler (not implemented in wx) is provided to allow the navigation of pages inside a zip archive. It supports paths of the form: scheme:///C:/example/docs.zip;protocol=zip/main.htm

This class is derived, and can use functions, from:

wxControl

wxWindow

wxEvtHandler

wxWidgets docs: wxWebView

Events

Event types emitted from this class:

webview_navigating

webview_navigated

webview_loaded

webview_error

webview_newwindow

webview_title_changed

Summary

Types

wxWebView()

Functions

canCopy(This)

Returns true if the current selection can be copied.

canCut(This)

Returns true if the current selection can be cut.

canGoBack(This)

Returns true if it is possible to navigate backward in the history of visited pages.

canGoForward(This)

Returns true if it is possible to navigate forward in the history of visited pages.

canPaste(This)

Returns true if data can be pasted.

canRedo(This)

Returns true if there is an action to redo.

canSetZoomType(This, Type)

Retrieve whether the current HTML engine supports a zoom type.

canUndo(This)

Returns true if there is an action to undo.

clearHistory(This)

Clear the history, this will also remove the visible page.

clearSelection(This)

Clears the current selection.

copy(This)

Copies the current selection.

cut(This)

Cuts the current selection.

deleteSelection(This)

Deletes the current selection.

enableContextMenu(This)

Equivalent to enableContextMenu(This, []).

enableContextMenu/2

Enable or disable the right click context menu.

enableHistory(This)

Equivalent to enableHistory(This, []).

enableHistory/2

Enable or disable the history.

find(This, Text)

Equivalent to find(This, Text, []).

find/3

Finds a phrase on the current page and if found, the control will scroll the phrase into view and select it.

getCurrentTitle(This)

Get the title of the current web page, or its URL/path if title is not available.

getCurrentURL(This)

Get the URL of the currently displayed document.

getPageSource(This)

Get the HTML source code of the currently displayed document.

getPageText(This)

Get the text of the current page.

getSelectedSource(This)

Returns the currently selected source, if any.

getSelectedText(This)

Returns the currently selected text, if any.

getZoom(This)

Get the zoom level of the page.

getZoomFactor(This)

Get the zoom factor of the page.

getZoomType(This)

Get how the zoom factor is currently interpreted.

goBack(This)

Navigate back in the history of visited pages.

goForward(This)

Navigate forward in the history of visited pages.

hasSelection(This)

Returns true if there is a current selection.

isBackendAvailable(Backend)

Allows to check if a specific backend is currently available.

isBusy(This)

Returns whether the web control is currently busy (e.g. loading a page).

isContextMenuEnabled(This)

Returns true if a context menu will be shown on right click.

isEditable(This)

Returns whether the web control is currently editable.

loadURL(This, Url)

Load a web page from a URL.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Factory function to create a new wxWebView using a wxWebViewFactory (not implemented in wx).

paste(This)

Pastes the current data.

print(This)

Opens a print dialog so that the user may print the currently displayed page.

redo(This)

Redos the last action.

reload(This)

Equivalent to reload(This, []).

reload/2

Reload the currently displayed URL.

runScript(This, Javascript)

Runs the given JavaScript code.

selectAll(This)

Selects the entire page.

setEditable(This)

Equivalent to setEditable(This, []).

setEditable/2

Set the editable property of the web control.

setPage(This, Html, BaseUrl)

Set the displayed page source to the contents of the given string.

setZoom(This, Zoom)

Set the zoom level of the page.

setZoomFactor(This, Zoom)

Set the zoom factor of the page.

setZoomType(This, ZoomType)

Set how to interpret the zoom factor.

stop(This)

Stop the current page loading process, if any.

undo(This)

Undos the last action.

Types

wxWebView()

-type wxWebView() :: wx:wx_object().

Functions

canCopy(This)

-spec canCopy(This) -> boolean() when This :: wxWebView().

Returns true if the current selection can be copied.

Note: This always returns true on the macOS WebKit backend.

canCut(This)

-spec canCut(This) -> boolean() when This :: wxWebView().

Returns true if the current selection can be cut.

Note: This always returns true on the macOS WebKit backend.

canGoBack(This)

-spec canGoBack(This) -> boolean() when This :: wxWebView().

Returns true if it is possible to navigate backward in the history of visited pages.

canGoForward(This)

-spec canGoForward(This) -> boolean() when This :: wxWebView().

Returns true if it is possible to navigate forward in the history of visited pages.

canPaste(This)

-spec canPaste(This) -> boolean() when This :: wxWebView().

Returns true if data can be pasted.

Note: This always returns true on the macOS WebKit backend.

canRedo(This)

-spec canRedo(This) -> boolean() when This :: wxWebView().

Returns true if there is an action to redo.

canSetZoomType(This, Type)

-spec canSetZoomType(This, Type) -> boolean() when This :: wxWebView(), Type :: wx:wx_enum().

Retrieve whether the current HTML engine supports a zoom type.

Return: Whether this type of zoom is supported by this HTML engine (and thus can be set through setZoomType/2).

canUndo(This)

-spec canUndo(This) -> boolean() when This :: wxWebView().

Returns true if there is an action to undo.

clearHistory(This)

-spec clearHistory(This) -> ok when This :: wxWebView().

Clear the history, this will also remove the visible page.

Note: This is not implemented on the WebKit2GTK+ backend.

clearSelection(This)

-spec clearSelection(This) -> ok when This :: wxWebView().

Clears the current selection.

copy(This)

-spec copy(This) -> ok when This :: wxWebView().

Copies the current selection.

cut(This)

-spec cut(This) -> ok when This :: wxWebView().

Cuts the current selection.

deleteSelection(This)

-spec deleteSelection(This) -> ok when This :: wxWebView().

Deletes the current selection.

Note that for wxWEBVIEW_BACKEND_WEBKIT the selection must be editable, either through SetEditable or the correct HTML attribute.

enableContextMenu(This)

-spec enableContextMenu(This) -> ok when This :: wxWebView().

Equivalent to enableContextMenu(This, []).

enableContextMenu/2

-spec enableContextMenu(This, [Option]) -> ok when This :: wxWebView(), Option :: {enable, boolean()}.

Enable or disable the right click context menu.

By default the standard context menu is enabled, this method can be used to disable it or re-enable it later.

Since: 2.9.5

enableHistory(This)

-spec enableHistory(This) -> ok when This :: wxWebView().

Equivalent to enableHistory(This, []).

enableHistory/2

-spec enableHistory(This, [Option]) -> ok when This :: wxWebView(), Option :: {enable, boolean()}.

Enable or disable the history.

This will also clear the history.

Note: This is not implemented on the WebKit2GTK+ backend.

find(This, Text)

-spec find(This, Text) -> integer() when This :: wxWebView(), Text :: unicode:chardata().

Equivalent to find(This, Text, []).

find/3

-spec find(This, Text, [Option]) -> integer()
              when This :: wxWebView(), Text :: unicode:chardata(), Option :: {flags, wx:wx_enum()}.

Finds a phrase on the current page and if found, the control will scroll the phrase into view and select it.

Return: If search phrase was not found in combination with the flags then wxNOT_FOUND is returned. If called for the first time with search phrase then the total number of results will be returned. Then for every time its called with the same search phrase it will return the number of the current match.

Note: This function will restart the search if the flags wxWEBVIEW_FIND_ENTIRE_WORD or wxWEBVIEW_FIND_MATCH_CASE are changed, since this will require a new search. To reset the search, for example resetting the highlights call the function with an empty search phrase. This always returns wxNOT_FOUND on the macOS WebKit backend.

Since: 2.9.5

getCurrentTitle(This)

-spec getCurrentTitle(This) -> unicode:charlist() when This :: wxWebView().

Get the title of the current web page, or its URL/path if title is not available.

getCurrentURL(This)

-spec getCurrentURL(This) -> unicode:charlist() when This :: wxWebView().

Get the URL of the currently displayed document.

getPageSource(This)

-spec getPageSource(This) -> unicode:charlist() when This :: wxWebView().

Get the HTML source code of the currently displayed document.

Return: The HTML source code, or an empty string if no page is currently shown.

getPageText(This)

-spec getPageText(This) -> unicode:charlist() when This :: wxWebView().

Get the text of the current page.

getSelectedSource(This)

-spec getSelectedSource(This) -> unicode:charlist() when This :: wxWebView().

Returns the currently selected source, if any.

getSelectedText(This)

-spec getSelectedText(This) -> unicode:charlist() when This :: wxWebView().

Returns the currently selected text, if any.

getZoom(This)

-spec getZoom(This) -> wx:wx_enum() when This :: wxWebView().

Get the zoom level of the page.

See getZoomFactor/1 to get more precise zoom scale value other than as provided by wxWebViewZoom.

Return: The current level of zoom.

getZoomFactor(This)

-spec getZoomFactor(This) -> number() when This :: wxWebView().

Get the zoom factor of the page.

Return: The current factor of zoom.

Since: 3.1.4

getZoomType(This)

-spec getZoomType(This) -> wx:wx_enum() when This :: wxWebView().

Get how the zoom factor is currently interpreted.

Return: How the zoom factor is currently interpreted by the HTML engine.

goBack(This)

-spec goBack(This) -> ok when This :: wxWebView().

Navigate back in the history of visited pages.

Only valid if canGoBack/1 returns true.

goForward(This)

-spec goForward(This) -> ok when This :: wxWebView().

Navigate forward in the history of visited pages.

Only valid if canGoForward/1 returns true.

hasSelection(This)

-spec hasSelection(This) -> boolean() when This :: wxWebView().

Returns true if there is a current selection.

isBackendAvailable(Backend)

-spec isBackendAvailable(Backend) -> boolean() when Backend :: unicode:chardata().

Allows to check if a specific backend is currently available.

Since: 3.1.4

isBusy(This)

-spec isBusy(This) -> boolean() when This :: wxWebView().

Returns whether the web control is currently busy (e.g. loading a page).

isContextMenuEnabled(This)

-spec isContextMenuEnabled(This) -> boolean() when This :: wxWebView().

Returns true if a context menu will be shown on right click.

Since: 2.9.5

isEditable(This)

-spec isEditable(This) -> boolean() when This :: wxWebView().

Returns whether the web control is currently editable.

loadURL(This, Url)

-spec loadURL(This, Url) -> ok when This :: wxWebView(), Url :: unicode:chardata().

Load a web page from a URL.

Note: Web engines generally report errors asynchronously, so if you wish to know whether loading the URL was successful, register to receive navigation error events.

new(Parent, Id)

-spec new(Parent, Id) -> wxWebView() when Parent :: wxWindow:wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxWebView()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Option ::
                     {url, unicode:chardata()} |
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {backend, unicode:chardata()} |
                     {style, integer()}.

Factory function to create a new wxWebView using a wxWebViewFactory (not implemented in wx).

Return: The created wxWebView, or NULL if the requested backend is not available

Since: 2.9.5

paste(This)

-spec paste(This) -> ok when This :: wxWebView().

Pastes the current data.

print(This)

-spec print(This) -> ok when This :: wxWebView().

Opens a print dialog so that the user may print the currently displayed page.

redo(This)

-spec redo(This) -> ok when This :: wxWebView().

Redos the last action.

reload(This)

-spec reload(This) -> ok when This :: wxWebView().

Equivalent to reload(This, []).

reload/2

-spec reload(This, [Option]) -> ok when This :: wxWebView(), Option :: {flags, wx:wx_enum()}.

Reload the currently displayed URL.

Note: The flags are ignored by the edge backend.

runScript(This, Javascript)

-spec runScript(This, Javascript) -> Result
                   when
                       Result :: {Res :: boolean(), Output :: unicode:charlist()},
                       This :: wxWebView(),
                       Javascript :: unicode:chardata().

Runs the given JavaScript code.

JavaScript code is executed inside the browser control and has full access to DOM and other browser-provided functionality. For example, this code will replace the current page contents with the provided string.

If output is non-null, it is filled with the result of executing this code on success, e.g. a JavaScript value such as a string, a number (integer or floating point), a boolean or JSON representation for non-primitive types such as arrays and objects. For example:

This function has a few platform-specific limitations:

When using WebKit v1 in wxGTK2, retrieving the result of JavaScript execution is unsupported and this function will always return false if output is non-null to indicate this. This functionality is fully supported when using WebKit v2 or later in wxGTK3.

When using WebKit under macOS, code execution is limited to at most 10MiB of memory and 10 seconds of execution time.

When using IE backend under MSW, scripts can only be executed when the current page is fully loaded (i.e. wxEVT_WEBVIEW_LOADED event was received). A script tag inside the page HTML is required in order to run JavaScript.

Also notice that under MSW converting JavaScript objects to JSON is not supported in the default emulation mode. wxWebView implements its own object-to-JSON conversion as a fallback for this case, however it is not as full-featured, well-tested or performing as the implementation of this functionality in the browser control itself, so it is recommended to use MSWSetEmulationLevel() to change emulation level to a more modern one in which JSON conversion is done by the control itself.

Return: true if there is a result, false if there is an error.

selectAll(This)

-spec selectAll(This) -> ok when This :: wxWebView().

Selects the entire page.

setEditable(This)

-spec setEditable(This) -> ok when This :: wxWebView().

Equivalent to setEditable(This, []).

setEditable/2

-spec setEditable(This, [Option]) -> ok when This :: wxWebView(), Option :: {enable, boolean()}.

Set the editable property of the web control.

Enabling allows the user to edit the page even if the contenteditable attribute is not set. The exact capabilities vary with the backend being used.

setPage(This, Html, BaseUrl)

-spec setPage(This, Html, BaseUrl) -> ok
                 when This :: wxWebView(), Html :: unicode:chardata(), BaseUrl :: unicode:chardata().

Set the displayed page source to the contents of the given string.

Note: When using wxWEBVIEW_BACKEND_IE you must wait for the current page to finish loading before calling setPage/3. The baseURL parameter is not used in this backend and the edge backend.

setZoom(This, Zoom)

-spec setZoom(This, Zoom) -> ok when This :: wxWebView(), Zoom :: wx:wx_enum().

Set the zoom level of the page.

See setZoomFactor/2 for more precise scaling other than the measured steps provided by wxWebViewZoom.

setZoomFactor(This, Zoom)

-spec setZoomFactor(This, Zoom) -> ok when This :: wxWebView(), Zoom :: number().

Set the zoom factor of the page.

Note: zoom scale in IE will be converted into wxWebViewZoom levels for wxWebViewZoomType of wxWEBVIEW_ZOOM_TYPE_TEXT.

Since: 3.1.4

setZoomType(This, ZoomType)

-spec setZoomType(This, ZoomType) -> ok when This :: wxWebView(), ZoomType :: wx:wx_enum().

Set how to interpret the zoom factor.

Note: invoke canSetZoomType/2 first, some HTML renderers may not support all zoom types.

stop(This)

-spec stop(This) -> ok when This :: wxWebView().

Stop the current page loading process, if any.

May trigger an error event of type wxWEBVIEW_NAV_ERR_USER_CANCELLED. TODO: make wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports.

undo(This)

-spec undo(This) -> ok when This :: wxWebView().

Undos the last action.

wxWebViewEvent

A navigation event holds information about events associated with wxWebView objects.

This class is derived, and can use functions, from:

wxNotifyEvent

wxCommandEvent

wxEvent

wxWidgets docs: wxWebViewEvent

Events

Use wxEvtHandler:connect/3 with wxWebViewEventType to subscribe to events of this type.

Summary

Types

wxWebView()

wxWebViewEvent()

wxWebViewEventType()

Functions

getInt(This)

Returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

getString(This)

Returns item string for a listbox or choice selection event.

getTarget(This)

Get the name of the target frame which the url of this event has been or will be loaded into.

getURL(This)

Get the URL being visited.

Types

wxWebView()

-type wxWebView() ::
          #wxWebView{type :: wxWebViewEvent:wxWebViewEventType(),
                     string :: unicode:chardata(),
                     int :: integer(),
                     target :: unicode:chardata(),
                     url :: unicode:chardata()}.

wxWebViewEvent()

-type wxWebViewEvent() :: wx:wx_object().

wxWebViewEventType()

-type wxWebViewEventType() ::
          webview_navigating | webview_navigated | webview_loaded | webview_error | webview_newwindow |
          webview_title_changed.

Functions

getInt(This)

-spec getInt(This) -> integer() when This :: wxWebViewEvent().

Returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

For a menu item, this method returns -1 if the item is not checkable or a boolean value (true or false) for checkable items indicating the new state of the item.

getString(This)

-spec getString(This) -> unicode:charlist() when This :: wxWebViewEvent().

Returns item string for a listbox or choice selection event.

If one or several items have been deselected, returns the index of the first deselected item. If some items have been selected and others deselected at the same time, it will return the index of the first selected item.

getTarget(This)

-spec getTarget(This) -> unicode:charlist() when This :: wxWebViewEvent().

Get the name of the target frame which the url of this event has been or will be loaded into.

This may return an empty string if the frame is not available.

getURL(This)

-spec getURL(This) -> unicode:charlist() when This :: wxWebViewEvent().

Get the URL being visited.

wxWindow

wxWindow is the base class for all windows and represents any visible object on screen.

All controls, top level windows and so on are windows. Sizers and device contexts are not, however, as they don't appear on screen themselves.

Please note that all children of the window will be deleted automatically by the destructor before the window itself is deleted which means that you don't have to worry about deleting them manually. Please see the window deletion overview for more information.

Also note that in this, and many others, wxWidgets classes some GetXXX() methods may be overloaded (as, for example, getSize/1 or getClientSize/1). In this case, the overloads are non-virtual because having multiple virtual functions with the same name results in a virtual function name hiding at the derived class level (in English, this means that the derived class has to override all overloaded variants if it overrides any of them). To allow overriding them in the derived class, wxWidgets uses a unique protected virtual DoGetXXX() method and all GetXXX() ones are forwarded to it, so overriding the former changes the behaviour of the latter.

Styles

This class supports the following styles:

wxBORDER_DEFAULT: The window class will decide the kind of border to show, if any.

wxBORDER_SIMPLE: Displays a thin border around the window. wxSIMPLE_BORDER is the old name for this style.

wxBORDER_SUNKEN: Displays a sunken border. wxSUNKEN_BORDER is the old name for this style.

wxBORDER_RAISED: Displays a raised border. wxRAISED_BORDER is the old name for this style.

wxBORDER_STATIC: Displays a border suitable for a static control. wxSTATIC_BORDER is the old name for this style. Windows only.

wxBORDER_THEME: Displays a native border suitable for a control, on the current platform. On Windows, this will be a themed border; on most other platforms a sunken border will be used. For more information for themed borders on Windows, please see Themed borders on Windows.

wxBORDER_NONE: Displays no border, overriding the default border style for the window. wxNO_BORDER is the old name for this style.

wxBORDER_DOUBLE: This style is obsolete and should not be used.

wxTRANSPARENT_WINDOW: The window is transparent, that is, it will not receive paint events. Windows only.

wxTAB_TRAVERSAL: This style is used by wxWidgets for the windows supporting TAB navigation among their children, such as wxDialog and wxPanel. It should almost never be used in the application code.

wxWANTS_CHARS: Use this to indicate that the window wants to get all char/key events for all keys - even for keys like TAB or ENTER which are usually used for dialog navigation and which wouldn't be generated without this style. If you need to use this style in order to get the arrows or etc., but would still like to have normal keyboard navigation take place, you should call Navigate in response to the key events for Tab and Shift-Tab.

wxNO_FULL_REPAINT_ON_RESIZE: On Windows, this style used to disable repainting the window completely when its size is changed. Since this behaviour is now the default, the style is now obsolete and no longer has an effect.

wxVSCROLL: Use this style to enable a vertical scrollbar. Notice that this style cannot be used with native controls which don't support scrollbars nor with top-level windows in most ports.

wxHSCROLL: Use this style to enable a horizontal scrollbar. The same limitations as for wxVSCROLL apply to this style.

wxALWAYS_SHOW_SB: If a window has scrollbars, disable them instead of hiding them when they are not needed (i.e. when the size of the window is big enough to not require the scrollbars to navigate it). This style is currently implemented for wxMSW, wxGTK and wxUniversal and does nothing on the other platforms.

wxCLIP_CHILDREN: Use this style to eliminate flicker caused by the background being repainted, then children being painted over them. Windows only.

wxFULL_REPAINT_ON_RESIZE: Use this style to force a complete redraw of the window whenever it is resized instead of redrawing just the part of the window affected by resizing. Note that this was the behaviour by default before 2.5.1 release and that if you experience redraw problems with code which previously used to work you may want to try this. Currently this style applies on GTK+ 2 and Windows only, and full repainting is always done on other platforms.

Extra Styles

This class supports the following extra styles:

wxWS_EX_BLOCK_EVENTS: wxCommandEvents and the objects of the derived classes are forwarded to the parent window and so on recursively by default. Using this flag for the given window allows blocking this propagation at this window, i.e. prevent the events from being propagated further upwards. Dialogs have this flag on by default for the reasons explained in the overview_events.

wxWS_EX_TRANSIENT: Don't use this window as an implicit parent for the other windows: this must be used with transient windows as otherwise there is the risk of creating a dialog/frame with this window as a parent, which would lead to a crash if the parent were destroyed before the child.

wxWS_EX_CONTEXTHELP: Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send a wxEVT_HELP event if the user clicked on an application window. This style cannot be used (because of the underlying native behaviour) together with wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so these two styles are automatically turned off if this one is used.

wxWS_EX_PROCESS_IDLE: This window should always process idle events, even if the mode set by wxIdleEvent:setMode/1 is wxIDLE_PROCESS_SPECIFIED.

wxWS_EX_PROCESS_UI_UPDATES: This window should always process UI update events, even if the mode set by wxUpdateUIEvent:setMode/1 is wxUPDATE_UI_PROCESS_SPECIFIED.

See:

Overview events

Overview windowsizing

This class is derived, and can use functions, from:

wxEvtHandler

wxWidgets docs: wxWindow

Events

Event types emitted from this class:

activate

child_focus

context_menu

help

drop_files

erase_background

set_focus

kill_focus

idle

joy_button_down

joy_button_up

joy_move

joy_zmove

key_down

key_up

char

char_hook

mouse_capture_lost

mouse_capture_changed

left_down

left_up

middle_down

middle_up

right_down

right_up

motion

enter_window

leave_window

left_dclick

middle_dclick

right_dclick

mousewheel

aux1_down

aux1_up

aux1_dclick

aux2_down

aux2_up

aux2_dclick

paint

scrollwin_top

scrollwin_bottom

scrollwin_lineup

scrollwin_linedown

scrollwin_pageup

scrollwin_pagedown

scrollwin_thumbtrack

scrollwin_thumbrelease

set_cursor

size

sys_colour_changed

Summary

Types

wxWindow()

Functions

cacheBestSize(This, Size)

Sets the cached best size value.

canSetTransparent(This)

Returns true if the system supports transparent windows and calling setTransparent/2 may succeed.

captureMouse(This)

Directs all mouse input to this window.

center(This)

Equivalent to center(This, []).

center(This, Options)

Equivalent to: centre/2

centerOnParent(This)

Equivalent to centerOnParent(This, []).

centerOnParent(This, Options)

Equivalent to: centreOnParent/2

centre(This)

Equivalent to centre(This, []).

centre/2

Centres the window.

centreOnParent(This)

Equivalent to centreOnParent(This, []).

centreOnParent/2

Centres the window on its parent.

clearBackground(This)

Clears the window by filling it with the current background colour.

clientToScreen(This, Pt)

Converts to screen coordinates from coordinates relative to this window.

clientToScreen(This, X, Y)

Converts to screen coordinates from coordinates relative to this window.

close(This)

Equivalent to close(This, []).

close/2

This function simply generates a wxCloseEvent whose handler usually tries to close the window.

convertDialogToPixels(This, Sz)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

convertPixelsToDialog(This, Sz)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create(This, Parent, Id)

Equivalent to create(This, Parent, Id, []).

create/4

Construct the actual window object after creating the C++ object.

'Destroy'(This)

Destroys the window safely.

destroy(This)

Destroys the object

destroyChildren(This)

Destroys all children of a window.

disable(This)

Disables the window.

dragAcceptFiles(This, Accept)

Enables or disables eligibility for drop file events (OnDropFiles).

enable(This)

Equivalent to enable(This, []).

enable/2

Enable or disable the window for user input.

findFocus()

Finds the window or control which currently has the keyboard focus.

findWindow/2

Find a child of this window, by name.

findWindowById(Id)

Equivalent to findWindowById(Id, []).

findWindowById(Id, Options)

Find the first window with the given id.

findWindowByLabel(Label)

Equivalent to findWindowByLabel(Label, []).

findWindowByLabel(Label, Options)

Find a window by its label.

findWindowByName(Name)

Equivalent to findWindowByName(Name, []).

findWindowByName(Name, Options)

Find a window by its name (as given in a window constructor or create/4 function call).

fit(This)

Sizes the window to fit its best size.

fitInside(This)

Similar to fit/1, but sizes the interior (virtual) size of a window.

freeze(This)

Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all.

fromDIP/2

Convert DPI-independent pixel values to the value in pixels appropriate for the current toolkit.

getAcceleratorTable(This)

Gets the accelerator table for this window.

getBackgroundColour(This)

Returns the background colour of the window.

getBackgroundStyle(This)

Returns the background style of the window.

getBestSize(This)

This functions returns the best acceptable minimal size for the window.

getCapture()

Returns the currently captured window.

getCaret(This)

Returns the caret() associated with the window.

getCharHeight(This)

Returns the character height for this window.

getCharWidth(This)

Returns the average character width for this window.

getChildren(This)

Returns a const reference to the list of the window's children.

getClientSize(This)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getContainingSizer(This)

Returns the sizer of which this window is a member, if any, otherwise NULL.

getContentScaleFactor(This)

Returns the factor mapping logical pixels of this window to physical pixels.

getCursor(This)

Return the cursor associated with this window.

getDPI(This)

Return the DPI of the display used by this window.

getDPIScaleFactor(This)

Returns the ratio of the DPI used by this window to the standard DPI.

getDropTarget(This)

Returns the associated drop target, which may be NULL.

getExtraStyle(This)

Returns the extra style bits for the window.

getFont(This)

Returns the font for this window.

getForegroundColour(This)

Returns the foreground colour of the window.

getGrandParent(This)

Returns the grandparent of a window, or NULL if there isn't one.

getHandle(This)

Returns the platform-specific handle of the physical window.

getHelpText(This)

Gets the help text to be used as context-sensitive help for this window.

getId(This)

Returns the identifier of the window.

getLabel(This)

Generic way of getting a label from any window, for identification purposes.

getMaxSize(This)

Returns the maximum size of the window.

getMinSize(This)

Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size.

getName(This)

Returns the window's name.

getParent(This)

Returns the parent of the window, or NULL if there is no parent.

getPosition(This)

This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.

getRect(This)

Returns the position and size of the window as a {X,Y,W,H} object.

getScreenPosition(This)

Returns the window position in screen coordinates, whether the window is a child window or a top level one.

getScreenRect(This)

Returns the position and size of the window on the screen as a {X,Y,W,H} object.

getScrollPos(This, Orientation)

Returns the built-in scrollbar position.

getScrollRange(This, Orientation)

Returns the built-in scrollbar range.

getScrollThumb(This, Orientation)

Returns the built-in scrollbar thumb size.

getSize(This)

See the GetSize(int,int) overload for more info.

getSizer(This)

Returns the sizer associated with the window by a previous call to setSizer/3, or NULL.

getTextExtent(This, String)

Equivalent to getTextExtent(This, String, []).

getTextExtent/3

Gets the dimensions of the string as it would be drawn on the window with the currently selected font.

getThemeEnabled(This)

Returns true if the window uses the system theme for drawing its background.

getToolTip(This)

Get the associated tooltip or NULL if none.

getUpdateRegion(This)

Gets the dimensions of the string as it would be drawn on the window with the currently selected font.

getVirtualSize(This)

This gets the virtual size of the window in pixels.

getWindowStyleFlag(This)

Gets the window style that was passed to the constructor or create/4 method.

getWindowVariant(This)

Returns the value previously passed to setWindowVariant/2.

hasCapture(This)

Returns true if this window has the current mouse capture.

hasScrollbar(This, Orient)

Returns true if this window currently has a scroll bar for this orientation.

hasTransparentBackground(This)

Returns true if this window background is transparent (as, for example, for wxStaticText) and should show the parent window background.

hide(This)

Equivalent to calling show/2(false).

inheritAttributes(This)

This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours.

initDialog(This)

Sends an wxEVT\_INIT\_DIALOG event, whose handler usually transfers data to the dialog via validators.

invalidateBestSize(This)

Resets the cached best size value so it will be recalculated the next time it is needed.

isDoubleBuffered(This)

Returns true if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later.

isEnabled(This)

Returns true if the window is enabled, i.e. if it accepts user input, false otherwise.

isExposed/2

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

isExposed(This, X, Y)

Returns true if the given point or rectangle area has been exposed since the last repaint.

isExposed(This, X, Y, W, H)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

isFrozen(This)

Returns true if the window is currently frozen by a call to freeze/1.

isRetained(This)

Returns true if the window is retained, false otherwise.

isShown(This)

Returns true if the window is shown, false if it has been hidden.

isShownOnScreen(This)

Returns true if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well.

isTopLevel(This)

Returns true if the given window is a top-level one.

layout(This)

Lays out the children of this window using the associated sizer.

lineDown(This)

Same as scrollLines/2 (1).

lineUp(This)

Same as scrollLines/2 (-1).

lower(This)

Lowers the window to the bottom of the window hierarchy (Z-order).

move(This, Pt)

Equivalent to move(This, Pt, []).

move/3

Moves the window to the given position.

move/4

Moves the window to the given position.

moveAfterInTabOrder(This, Win)

Moves this window in the tab navigation order after the specified win.

moveBeforeInTabOrder(This, Win)

Same as moveAfterInTabOrder/2 except that it inserts this window just before win instead of putting it right after it.

navigate(This)

Equivalent to navigate(This, []).

navigate/2

Performs a keyboard navigation action starting from this window.

new()

Default constructor.

new(Parent, Id)

Equivalent to new(Parent, Id, []).

new/3

Constructs a window, which can be a child of a frame, dialog or any other non-control window.

pageDown(This)

Same as scrollPages/2 (1).

pageUp(This)

Same as scrollPages/2 (-1).

popupMenu(This, Menu)

Equivalent to popupMenu(This, Menu, []).

popupMenu/3

Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu.

popupMenu(This, Menu, X, Y)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

raise(This)

Raises the window to the top of the window hierarchy (Z-order).

refresh(This)

Equivalent to refresh(This, []).

refresh/2

Causes this window, and all of its children recursively (except under wxGTK1 where this is not implemented), to be repainted.

refreshRect(This, Rect)

Equivalent to refreshRect(This, Rect, []).

refreshRect/3

Redraws the contents of the given rectangle: only the area inside it will be repainted.

releaseMouse(This)

Releases mouse input captured with captureMouse/1.

removeChild(This, Child)

Removes a child window.

reparent(This, NewParent)

Reparents the window, i.e. the window will be removed from its current parent window (e.g.

screenToClient(This)

Converts from screen to client window coordinates.

screenToClient(This, Pt)

Converts from screen to client window coordinates.

scrollLines(This, Lines)

Scrolls the window by the given number of lines down (if lines is positive) or up.

scrollPages(This, Pages)

Scrolls the window by the given number of pages down (if pages is positive) or up.

scrollWindow(This, Dx, Dy)

Equivalent to scrollWindow(This, Dx, Dy, []).

scrollWindow/4

Physically scrolls the pixels in the window and move child windows accordingly.

setAcceleratorTable(This, Accel)

Sets the accelerator table for this window.

setAutoLayout(This, AutoLayout)

Determines whether the layout/1 function will be called automatically when the window is resized.

setBackgroundColour(This, Colour)

Sets the background colour of the window.

setBackgroundStyle(This, Style)

Sets the background style of the window.

setCaret(This, Caret)

Sets the caret() associated with the window.

setClientSize/2

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setClientSize(This, Width, Height)

This sets the size of the window client area in pixels.

setContainingSizer(This, Sizer)

Used by wxSizer internally to notify the window about being managed by the given sizer.

setCursor(This, Cursor)

Sets the window's cursor.

setDoubleBuffered(This, On)

Turn on or off double buffering of the window if the system supports it.

setDropTarget(This, Target)

Associates a drop target with this window.

setExtraStyle(This, ExStyle)

Sets the extra style bits for the window.

setFocus(This)

This sets the window to receive keyboard input.

setFocusFromKbd(This)

This function is called by wxWidgets keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using TAB key).

setFont(This, Font)

Sets the font for this window.

setForegroundColour(This, Colour)

Sets the foreground colour of the window.

setHelpText(This, HelpText)

Sets the help text to be used as context-sensitive help for this window.

setId(This, Winid)

Sets the identifier of the window.

setLabel(This, Label)

Sets the window's label.

setMaxSize(This, Size)

Sets the maximum size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size.

setMinSize(This, Size)

Sets the minimum size of the window, to indicate to the sizer layout mechanism that this is the minimum required size.

setName(This, Name)

Sets the window's name.

setOwnBackgroundColour(This, Colour)

Sets the background colour of the window but prevents it from being inherited by the children of this window.

setOwnFont(This, Font)

Sets the font of the window but prevents it from being inherited by the children of this window.

setOwnForegroundColour(This, Colour)

Sets the foreground colour of the window but prevents it from being inherited by the children of this window.

setPalette(This, Pal)

Deprecated

setScrollbar(This, Orientation, Position, ThumbSize, Range)

Equivalent to setScrollbar(This, Orientation, Position, ThumbSize, Range, []).

setScrollbar/6

Sets the scrollbar properties of a built-in scrollbar.

setScrollPos(This, Orientation, Pos)

Equivalent to setScrollPos(This, Orientation, Pos, []).

setScrollPos/4

Sets the position of one of the built-in scrollbars.

setSize/2

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSize/3

Sets the size of the window in pixels.

setSize(This, X, Y, Width, Height)

Equivalent to setSize(This, X, Y, Width, Height, []).

setSize/6

Sets the size of the window in pixels.

setSizeHints(This, MinSize)

Equivalent to setSizeHints(This, MinSize, []).

setSizeHints/3

Use of this function for windows which are not toplevel windows (such as wxDialog or wxFrame) is discouraged.

setSizeHints/4

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSizer(This, Sizer)

Equivalent to setSizer(This, Sizer, []).

setSizer/3

Sets the window to have the given layout sizer.

setSizerAndFit(This, Sizer)

Equivalent to setSizerAndFit(This, Sizer, []).

setSizerAndFit/3

Associate the sizer with the window and set the window size and minimal size accordingly.

setThemeEnabled(This, Enable)

This function tells a window if it should use the system's "theme" code to draw the windows' background instead of its own background drawing code.

setToolTip/2

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setTransparent(This, Alpha)

Set the transparency of the window.

setVirtualSize(This, Size)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setVirtualSize(This, Width, Height)

Sets the virtual size of the window in pixels.

setWindowStyle(This, Style)

See setWindowStyleFlag/2 for more info.

setWindowStyleFlag(This, Style)

Sets the style of the window.

setWindowVariant(This, Variant)

Chooses a different variant of the window display to use.

shouldInheritColours(This)

Return true from here to allow the colours of this window to be changed by inheritAttributes/1.

show(This)

Equivalent to show(This, []).

show/2

Shows or hides the window.

thaw(This)

Re-enables window updating after a previous call to freeze/1.

toDIP/2

Convert pixel values of the current toolkit to DPI-independent pixel values.

transferDataFromWindow(This)

Transfers values from child controls to data areas specified by their validators.

transferDataToWindow(This)

Transfers values to child controls from data areas specified by their validators.

update(This)

Calling this method immediately repaints the invalidated area of the window and all of its children recursively (this normally only happens when the flow of control returns to the event loop).

updateWindowUI(This)

Equivalent to updateWindowUI(This, []).

updateWindowUI/2

This function sends one or more wxUpdateUIEvent to the window.

validate(This)

Validates the current values of the child controls using their validators.

warpPointer(This, X, Y)

Moves the pointer to the given position on the window.

Types

wxWindow()

-type wxWindow() :: wx:wx_object().

Functions

cacheBestSize(This, Size)

-spec cacheBestSize(This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()}.

Sets the cached best size value.

See: getBestSize/1

canSetTransparent(This)

-spec canSetTransparent(This) -> boolean() when This :: wxWindow().

Returns true if the system supports transparent windows and calling setTransparent/2 may succeed.

If this function returns false, transparent windows are definitely not supported by the current system.

captureMouse(This)

-spec captureMouse(This) -> ok when This :: wxWindow().

Directs all mouse input to this window.

Call releaseMouse/1 to release the capture.

Note that wxWidgets maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it, unless the window receives the wxMouseCaptureLostEvent event.

Any application which captures the mouse in the beginning of some operation must handle wxMouseCaptureLostEvent and cancel this operation when it receives the event. The event handler must not recapture mouse.

See:

releaseMouse/1

wxMouseCaptureLostEvent

center(This)

-spec center(This) -> ok when This :: wxWindow().

Equivalent to center(This, []).

center(This, Options)

-spec center(This, [Option]) -> ok when This :: wxWindow(), Option :: {dir, integer()}.

Equivalent to: centre/2

centerOnParent(This)

-spec centerOnParent(This) -> ok when This :: wxWindow().

Equivalent to centerOnParent(This, []).

centerOnParent(This, Options)

-spec centerOnParent(This, [Option]) -> ok when This :: wxWindow(), Option :: {dir, integer()}.

Equivalent to: centreOnParent/2

centre(This)

-spec centre(This) -> ok when This :: wxWindow().

Equivalent to centre(This, []).

centre/2

-spec centre(This, [Option]) -> ok when This :: wxWindow(), Option :: {dir, integer()}.

Centres the window.

Remark: If the window is a top level one (i.e. doesn't have a parent), it will be centred relative to the screen anyhow.

See: center/2

centreOnParent(This)

-spec centreOnParent(This) -> ok when This :: wxWindow().

Equivalent to centreOnParent(This, []).

centreOnParent/2

-spec centreOnParent(This, [Option]) -> ok when This :: wxWindow(), Option :: {dir, integer()}.

Centres the window on its parent.

This is a more readable synonym for centre/2.

Remark: This methods provides for a way to centre top level windows over their parents instead of the entire screen. If there is no parent or if the window is not a top level window, then behaviour is the same as centre/2.

See: wxTopLevelWindow:centreOnScreen/2

clearBackground(This)

-spec clearBackground(This) -> ok when This :: wxWindow().

Clears the window by filling it with the current background colour.

Does not cause an erase background event to be generated.

Notice that this uses wxClientDC to draw on the window and the results of doing it while also drawing on wxPaintDC for this window are undefined. Hence this method shouldn't be used from EVT_PAINT handlers, just use wxDC:clear/1 on the wxPaintDC you already use there instead.

clientToScreen(This, Pt)

-spec clientToScreen(This, Pt) -> {X :: integer(), Y :: integer()}
                        when This :: wxWindow(), Pt :: {X :: integer(), Y :: integer()}.

Converts to screen coordinates from coordinates relative to this window.

clientToScreen(This, X, Y)

-spec clientToScreen(This, X, Y) -> {X :: integer(), Y :: integer()}
                        when This :: wxWindow(), X :: integer(), Y :: integer().

Converts to screen coordinates from coordinates relative to this window.

close(This)

-spec close(This) -> boolean() when This :: wxWindow().

Equivalent to close(This, []).

close/2

-spec close(This, [Option]) -> boolean() when This :: wxWindow(), Option :: {force, boolean()}.

This function simply generates a wxCloseEvent whose handler usually tries to close the window.

It doesn't close the window itself, however.

Return: true if the event was handled and not vetoed, false otherwise.

Remark: Close calls the close handler for the window, providing an opportunity for the window to choose whether to destroy the window. Usually it is only used with the top level windows (wxFrame and wxDialog classes) as the others are not supposed to have any special OnClose() logic. The close handler should check whether the window is being deleted forcibly, using wxCloseEvent:canVeto/1, in which case it should destroy the window using 'Destroy'/1. Note that calling Close does not guarantee that the window will be destroyed; but it provides a way to simulate a manual close of a window, which may or may not be implemented by destroying the window. The default implementation of wxDialog::OnCloseWindow does not necessarily delete the dialog, since it will simply simulate an wxID_CANCEL event which is handled by the appropriate button event handler and may do anything at all. To guarantee that the window will be destroyed, call 'Destroy'/1 instead

See:

'Destroy'/1

wxCloseEvent

convertDialogToPixels(This, Sz)

-spec convertDialogToPixels(This, Sz) -> {W :: integer(), H :: integer()}
                               when This :: wxWindow(), Sz :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

convertPixelsToDialog(This, Sz)

-spec convertPixelsToDialog(This, Sz) -> {W :: integer(), H :: integer()}
                               when This :: wxWindow(), Sz :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create(This, Parent, Id)

-spec create(This, Parent, Id) -> boolean()
                when This :: wxWindow(), Parent :: wxWindow(), Id :: integer().

Equivalent to create(This, Parent, Id, []).

create/4

-spec create(This, Parent, Id, [Option]) -> boolean()
                when
                    This :: wxWindow(),
                    Parent :: wxWindow(),
                    Id :: integer(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

Construct the actual window object after creating the C++ object.

The non-default constructor of wxWindow class does two things: it initializes the C++ object and it also creates the window object in the underlying graphical toolkit. The create/4 method can be used to perform the second part later, while the default constructor can be used to perform the first part only.

Please note that the underlying window must be created exactly once, i.e. if you use the default constructor, which doesn't do this, you must call create/4 before using the window and if you use the non-default constructor, you can not call create/4, as the underlying window is already created.

Note that it is possible and, in fact, useful, to call some methods on the object between creating the C++ object itself and calling create/4 on it, e.g. a common pattern to avoid showing the contents of a window before it is fully initialized is:

Also note that it is possible to create an object of a derived type and then call create/4 on it: This is notably used by overview_xrc.

The parameters of this method have exactly the same meaning as the non-default constructor parameters, please refer to them for their description.

Return: true if window creation succeeded or false if it failed

'Destroy'(This)

-spec 'Destroy'(This) -> boolean() when This :: wxWindow().

Destroys the window safely.

Use this function instead of the delete operator, since different window classes can be destroyed differently. Frames and dialogs are not destroyed immediately when this function is called - they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows.

Return: true if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion.

destroy(This)

-spec destroy(This :: wxWindow()) -> ok.

Destroys the object

destroyChildren(This)

-spec destroyChildren(This) -> boolean() when This :: wxWindow().

Destroys all children of a window.

Called automatically by the destructor.

disable(This)

-spec disable(This) -> boolean() when This :: wxWindow().

Disables the window.

Same as enable/2 Enable(false).

Return: Returns true if the window has been disabled, false if it had been already disabled before the call to this function.

dragAcceptFiles(This, Accept)

-spec dragAcceptFiles(This, Accept) -> ok when This :: wxWindow(), Accept :: boolean().

Enables or disables eligibility for drop file events (OnDropFiles).

Remark: Windows only until version 2.8.9, available on all platforms since 2.8.10. Cannot be used together with setDropTarget/2 on non-Windows platforms.

See: setDropTarget/2

enable(This)

-spec enable(This) -> boolean() when This :: wxWindow().

Equivalent to enable(This, []).

enable/2

-spec enable(This, [Option]) -> boolean() when This :: wxWindow(), Option :: {enable, boolean()}.

Enable or disable the window for user input.

Note that when a parent window is disabled, all of its children are disabled as well and they are re-enabled again when the parent is.

A window can be created initially disabled by calling this method on it before calling create/4 to create the actual underlying window, e.g.

Return: Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state.

See:

isEnabled/1

disable/1

wxRadioBox:enable/3

findFocus()

-spec findFocus() -> wxWindow().

Finds the window or control which currently has the keyboard focus.

Remark: Note that this is a static function, so it can be called without needing a wxWindow pointer.

See: setFocus/1

findWindow/2

-spec findWindow(This, Id) -> wxWindow() when This :: wxWindow(), Id :: integer();
                (This, Name) -> wxWindow() when This :: wxWindow(), Name :: unicode:chardata().

Find a child of this window, by name.

May return this if it matches itself.

Notice that only real children, not top level windows using this window as parent, are searched by this function.

findWindowById(Id)

-spec findWindowById(Id) -> wxWindow() when Id :: integer().

Equivalent to findWindowById(Id, []).

findWindowById(Id, Options)

-spec findWindowById(Id, [Option]) -> wxWindow() when Id :: integer(), Option :: {parent, wxWindow()}.

Find the first window with the given id.

If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases.

See: findWindow/2

Return: Window with the given id or NULL if not found.

findWindowByLabel(Label)

-spec findWindowByLabel(Label) -> wxWindow() when Label :: unicode:chardata().

Equivalent to findWindowByLabel(Label, []).

findWindowByLabel(Label, Options)

-spec findWindowByLabel(Label, [Option]) -> wxWindow()
                           when Label :: unicode:chardata(), Option :: {parent, wxWindow()}.

Find a window by its label.

Depending on the type of window, the label may be a window title or panel item label. If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.

The search is recursive in both cases and, unlike with findWindow/2, recurses into top level child windows too.

See: findWindow/2

Return: Window with the given label or NULL if not found.

findWindowByName(Name)

-spec findWindowByName(Name) -> wxWindow() when Name :: unicode:chardata().

Equivalent to findWindowByName(Name, []).

findWindowByName(Name, Options)

-spec findWindowByName(Name, [Option]) -> wxWindow()
                          when Name :: unicode:chardata(), Option :: {parent, wxWindow()}.

Find a window by its name (as given in a window constructor or create/4 function call).

If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.

The search is recursive in both cases and, unlike findWindow/2, recurses into top level child windows too.

If no window with such name is found, findWindowByLabel/2 is called, i.e. the name is interpreted as (internal) name first but if this fails, it's internal as (user-visible) label. As this behaviour may be confusing, it is usually better to use either the findWindow/2 overload taking the name or findWindowByLabel/2 directly.

Return: Window with the given name or NULL if not found.

fit(This)

-spec fit(This) -> ok when This :: wxWindow().

Sizes the window to fit its best size.

Using this function is equivalent to setting window size to the return value of getBestSize/1.

Note that, unlike setSizerAndFit/3, this function only changes the current window size and doesn't change its minimal size.

See: Overview windowsizing

fitInside(This)

-spec fitInside(This) -> ok when This :: wxWindow().

Similar to fit/1, but sizes the interior (virtual) size of a window.

Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows.

freeze(This)

-spec freeze(This) -> ok when This :: wxWindow().

Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all.

thaw/1 must be called to re-enable window redrawing. Calls to these two functions may be nested but to ensure that the window is properly repainted again, you must thaw it exactly as many times as you froze it.

If the window has any children, they are recursively frozen too.

This method is useful for visual appearance optimization (for example, it is a good idea to use it before doing many large text insertions in a row into a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWidgets and not a mandatory directive.

See:

thaw/1

isFrozen/1

fromDIP/2

-spec fromDIP(D, W) -> integer() when D :: integer(), W :: wxWindow();
             (Sz, W) -> {W :: integer(), H :: integer()}
                 when Sz :: {W :: integer(), H :: integer()}, W :: wxWindow();
             (This, D) -> integer() when This :: wxWindow(), D :: integer();
             (This, Sz) -> {W :: integer(), H :: integer()}
                 when This :: wxWindow(), Sz :: {W :: integer(), H :: integer()}.

Convert DPI-independent pixel values to the value in pixels appropriate for the current toolkit.

A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by getDPIScaleFactor/1 but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit and so by using it with pixel values you can guarantee that the physical size of the corresponding elements will remain the same in all resolutions under all platforms. For example, instead of creating a bitmap of the hard coded size of 32 pixels you should use to avoid using tiny bitmaps on high DPI screens.

Notice that this function is only needed when using hard coded pixel values. It is not necessary if the sizes are already based on the DPI-independent units such as dialog units or if you are relying on the controls automatic best size determination and using sizers to lay out them.

Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").

Since: 3.1.0

getAcceleratorTable(This)

-spec getAcceleratorTable(This) -> wxAcceleratorTable:wxAcceleratorTable() when This :: wxWindow().

Gets the accelerator table for this window.

See wxAcceleratorTable.

getBackgroundColour(This)

-spec getBackgroundColour(This) -> wx:wx_colour4() when This :: wxWindow().

Returns the background colour of the window.

See:

setBackgroundColour/2

setForegroundColour/2

getForegroundColour/1

getBackgroundStyle(This)

-spec getBackgroundStyle(This) -> wx:wx_enum() when This :: wxWindow().

Returns the background style of the window.

See:

setBackgroundColour/2

getForegroundColour/1

setBackgroundStyle/2

setTransparent/2

getBestSize(This)

-spec getBestSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

This functions returns the best acceptable minimal size for the window.

For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically wxPanel), the size returned by this function will be the same as the size the window would have had after calling fit/1.

Override virtual DoGetBestSize() (not implemented in wx) or, better, because it's usually more convenient, DoGetBestClientSize() (not implemented in wx) when writing your own custom window class to change the value returned by this public non-virtual method.

Notice that the best size respects the minimal and maximal size explicitly set for the window, if any. So even if some window believes that it needs 200 pixels horizontally, calling setMaxSize/2 with a width of 100 would ensure that getBestSize/1 returns the width of at most 100 pixels.

See:

cacheBestSize/2

Overview windowsizing

getCapture()

-spec getCapture() -> wxWindow().

Returns the currently captured window.

See:

hasCapture/1

captureMouse/1

releaseMouse/1

wxMouseCaptureLostEvent

wxMouseCaptureChangedEvent

getCaret(This)

-spec getCaret(This) -> wxCaret:wxCaret() when This :: wxWindow().

Returns the caret() associated with the window.

getCharHeight(This)

-spec getCharHeight(This) -> integer() when This :: wxWindow().

Returns the character height for this window.

getCharWidth(This)

-spec getCharWidth(This) -> integer() when This :: wxWindow().

Returns the average character width for this window.

getChildren(This)

-spec getChildren(This) -> [wxWindow()] when This :: wxWindow().

Returns a const reference to the list of the window's children.

wxWindowList is a type-safe wxList-like class whose elements are of type wxWindow*.

getClientSize(This)

-spec getClientSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

getContainingSizer(This)

-spec getContainingSizer(This) -> wxSizer:wxSizer() when This :: wxWindow().

Returns the sizer of which this window is a member, if any, otherwise NULL.

getContentScaleFactor(This)

-spec getContentScaleFactor(This) -> number() when This :: wxWindow().

Returns the factor mapping logical pixels of this window to physical pixels.

This function can be used to portably determine the number of physical pixels in a window of the given size, by multiplying the window size by the value returned from it. I.e. it returns the factor converting window coordinates to "content view" coordinates, where the view can be just a simple window displaying a wxBitmap or wxGLCanvas or any other kind of window rendering arbitrary "content" on screen.

For the platforms not doing any pixel mapping, i.e. where logical and physical pixels are one and the same, this function always returns 1.0 and so using it is, in principle, unnecessary and could be avoided by using preprocessor check for wxHAVE_DPI_INDEPENDENT_PIXELS not being defined, however using this function unconditionally under all platforms is usually simpler and so preferable.

Note: Current behaviour of this function is compatible with wxWidgets 3.0, but different from its behaviour in versions 3.1.0 to 3.1.3, where it returned the same value as getDPIScaleFactor/1. Please use the other function if you need to use a scaling factor greater than 1.0 even for the platforms without wxHAVE_DPI_INDEPENDENT_PIXELS, such as wxMSW.

Since: 2.9.5

getCursor(This)

-spec getCursor(This) -> wxCursor:wxCursor() when This :: wxWindow().

Return the cursor associated with this window.

See: setCursor/2

getDPI(This)

-spec getDPI(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

Return the DPI of the display used by this window.

The returned value can be different for different windows on systems with support for per-monitor DPI values, such as Microsoft Windows 10.

If the DPI is not available, returns {Width,Height} object.

See: wxDisplay:getPPI/1

Since: 3.1.3

getDPIScaleFactor(This)

-spec getDPIScaleFactor(This) -> number() when This :: wxWindow().

Returns the ratio of the DPI used by this window to the standard DPI.

The returned value is 1 for standard DPI screens or 2 for "200% scaling" and, unlike for getContentScaleFactor/1, is the same under all platforms.

This factor should be used to increase the size of icons and similar windows whose best size is not based on text metrics when using DPI scaling.

E.g. the program may load a 32px bitmap if the content scale factor is 1.0 or 64px version of the same bitmap if it is 2.0 or bigger.

Notice that this method should not be used for window sizes expressed in pixels, as they are already scaled by this factor by the underlying toolkit under some platforms. Use fromDIP/2 for anything window-related instead.

Since: 3.1.4

getDropTarget(This)

-spec getDropTarget(This) -> wx:wx_object() when This :: wxWindow().

Returns the associated drop target, which may be NULL.

See:

setDropTarget/2

Overview dnd

getExtraStyle(This)

-spec getExtraStyle(This) -> integer() when This :: wxWindow().

Returns the extra style bits for the window.

getFont(This)

-spec getFont(This) -> wxFont:wxFont() when This :: wxWindow().

Returns the font for this window.

See: setFont/2

getForegroundColour(This)

-spec getForegroundColour(This) -> wx:wx_colour4() when This :: wxWindow().

Returns the foreground colour of the window.

Remark: The meaning of foreground colour varies according to the window class; it may be the text colour or other colour, or it may not be used at all.

See:

setForegroundColour/2

setBackgroundColour/2

getBackgroundColour/1

getGrandParent(This)

-spec getGrandParent(This) -> wxWindow() when This :: wxWindow().

Returns the grandparent of a window, or NULL if there isn't one.

getHandle(This)

-spec getHandle(This) -> integer() when This :: wxWindow().

Returns the platform-specific handle of the physical window.

Cast it to an appropriate handle, such as HWND for Windows, Widget for Motif or GtkWidget for GTK.

getHelpText(This)

-spec getHelpText(This) -> unicode:charlist() when This :: wxWindow().

Gets the help text to be used as context-sensitive help for this window.

Note that the text is actually stored by the current wxHelpProvider (not implemented in wx) implementation, and not in the window object itself.

See: setHelpText/2

getId(This)

-spec getId(This) -> integer() when This :: wxWindow().

Returns the identifier of the window.

Remark: Each window has an integer identifier. If the application has not provided one (or the default wxID_ANY) a unique identifier with a negative value will be generated.

See:

setId/2

Overview windowids

getLabel(This)

-spec getLabel(This) -> unicode:charlist() when This :: wxWindow().

Generic way of getting a label from any window, for identification purposes.

Remark: The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs (such as testing tools or special-needs access programs) which need to identify windows by name.

getMaxSize(This)

-spec getMaxSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

Returns the maximum size of the window.

This is an indication to the sizer layout mechanism that this is the maximum possible size as well as the upper bound on window's size settable using setSize/6.

See: Overview windowsizing

getMinSize(This)

-spec getMinSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size.

This method normally just returns the value set by setMinSize/2, but it can be overridden to do the calculation on demand.

See: Overview windowsizing

getName(This)

-spec getName(This) -> unicode:charlist() when This :: wxWindow().

Returns the window's name.

Remark: This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via setName/2.

See: setName/2

getParent(This)

-spec getParent(This) -> wxWindow() when This :: wxWindow().

Returns the parent of the window, or NULL if there is no parent.

getPosition(This)

-spec getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxWindow().

This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.

See: getScreenPosition/1

getRect(This)

-spec getRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                 when This :: wxWindow().

Returns the position and size of the window as a {X,Y,W,H} object.

See: getScreenRect/1

getScreenPosition(This)

-spec getScreenPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxWindow().

Returns the window position in screen coordinates, whether the window is a child window or a top level one.

See: getPosition/1

getScreenRect(This)

-spec getScreenRect(This) -> {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}
                       when This :: wxWindow().

Returns the position and size of the window on the screen as a {X,Y,W,H} object.

See: getRect/1

getScrollPos(This, Orientation)

-spec getScrollPos(This, Orientation) -> integer() when This :: wxWindow(), Orientation :: integer().

Returns the built-in scrollbar position.

See: setScrollbar/6

getScrollRange(This, Orientation)

-spec getScrollRange(This, Orientation) -> integer() when This :: wxWindow(), Orientation :: integer().

Returns the built-in scrollbar range.

See: setScrollbar/6

getScrollThumb(This, Orientation)

-spec getScrollThumb(This, Orientation) -> integer() when This :: wxWindow(), Orientation :: integer().

Returns the built-in scrollbar thumb size.

See: setScrollbar/6

getSize(This)

-spec getSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

See the GetSize(int,int) overload for more info.

getSizer(This)

-spec getSizer(This) -> wxSizer:wxSizer() when This :: wxWindow().

Returns the sizer associated with the window by a previous call to setSizer/3, or NULL.

getTextExtent(This, String)

-spec getTextExtent(This, String) -> Result
                       when
                           Result ::
                               {W :: integer(),
                                H :: integer(),
                                Descent :: integer(),
                                ExternalLeading :: integer()},
                           This :: wxWindow(),
                           String :: unicode:chardata().

Equivalent to getTextExtent(This, String, []).

getTextExtent/3

-spec getTextExtent(This, String, [Option]) -> Result
                       when
                           Result ::
                               {W :: integer(),
                                H :: integer(),
                                Descent :: integer(),
                                ExternalLeading :: integer()},
                           This :: wxWindow(),
                           String :: unicode:chardata(),
                           Option :: {theFont, wxFont:wxFont()}.

Gets the dimensions of the string as it would be drawn on the window with the currently selected font.

The text extent is returned in the w and h pointers.

getThemeEnabled(This)

-spec getThemeEnabled(This) -> boolean() when This :: wxWindow().

Returns true if the window uses the system theme for drawing its background.

See: setThemeEnabled/2

getToolTip(This)

-spec getToolTip(This) -> wxToolTip:wxToolTip() when This :: wxWindow().

Get the associated tooltip or NULL if none.

getUpdateRegion(This)

-spec getUpdateRegion(This) -> wxRegion:wxRegion() when This :: wxWindow().

Gets the dimensions of the string as it would be drawn on the window with the currently selected font.

Returns the region specifying which parts of the window have been damaged. Should only be called within an wxPaintEvent handler.

See: wxRegion

getVirtualSize(This)

-spec getVirtualSize(This) -> {W :: integer(), H :: integer()} when This :: wxWindow().

This gets the virtual size of the window in pixels.

By default it returns the client size of the window, but after a call to setVirtualSize/3 it will return the size set with that method.

See: Overview windowsizing

getWindowStyleFlag(This)

-spec getWindowStyleFlag(This) -> integer() when This :: wxWindow().

Gets the window style that was passed to the constructor or create/4 method.

GetWindowStyle() (not implemented in wx) is another name for the same function.

getWindowVariant(This)

-spec getWindowVariant(This) -> wx:wx_enum() when This :: wxWindow().

Returns the value previously passed to setWindowVariant/2.

hasCapture(This)

-spec hasCapture(This) -> boolean() when This :: wxWindow().

Returns true if this window has the current mouse capture.

See:

captureMouse/1

releaseMouse/1

wxMouseCaptureLostEvent

wxMouseCaptureChangedEvent

hasScrollbar(This, Orient)

-spec hasScrollbar(This, Orient) -> boolean() when This :: wxWindow(), Orient :: integer().

Returns true if this window currently has a scroll bar for this orientation.

This method may return false even when CanScroll() (not implemented in wx) for the same orientation returns true, but if CanScroll() (not implemented in wx) returns false, i.e. scrolling in this direction is not enabled at all, hasScrollbar/2 always returns false as well.

hasTransparentBackground(This)

-spec hasTransparentBackground(This) -> boolean() when This :: wxWindow().

Returns true if this window background is transparent (as, for example, for wxStaticText) and should show the parent window background.

This method is mostly used internally by the library itself and you normally shouldn't have to call it. You may, however, have to override it in your wxWindow-derived class to ensure that background is painted correctly.

hide(This)

-spec hide(This) -> boolean() when This :: wxWindow().

Equivalent to calling show/2(false).

inheritAttributes(This)

-spec inheritAttributes(This) -> ok when This :: wxWindow().

This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours.

By "intelligently" the following is meant: by default, all windows use their own GetClassDefaultAttributes() (not implemented in wx) default attributes. However if some of the parents attributes are explicitly (that is, using setFont/2 and not setOwnFont/2) changed and if the corresponding attribute hadn't been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides shouldInheritColours/1 to return false, the colours will not be changed no matter what and only the font might.

This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes.

initDialog(This)

-spec initDialog(This) -> ok when This :: wxWindow().

Sends an wxEVT\_INIT\_DIALOG event, whose handler usually transfers data to the dialog via validators.

invalidateBestSize(This)

-spec invalidateBestSize(This) -> ok when This :: wxWindow().

Resets the cached best size value so it will be recalculated the next time it is needed.

See: cacheBestSize/2

isDoubleBuffered(This)

-spec isDoubleBuffered(This) -> boolean() when This :: wxWindow().

Returns true if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later.

See: wxBufferedDC

isEnabled(This)

-spec isEnabled(This) -> boolean() when This :: wxWindow().

Returns true if the window is enabled, i.e. if it accepts user input, false otherwise.

Notice that this method can return false even if this window itself hadn't been explicitly disabled when one of its parent windows is disabled. To get the intrinsic status of this window, use IsThisEnabled() (not implemented in wx)

See: enable/2

isExposed/2

-spec isExposed(This, Pt) -> boolean() when This :: wxWindow(), Pt :: {X :: integer(), Y :: integer()};
               (This, Rect) -> boolean()
                   when
                       This :: wxWindow(),
                       Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

isExposed(This, X, Y)

-spec isExposed(This, X, Y) -> boolean() when This :: wxWindow(), X :: integer(), Y :: integer().

Returns true if the given point or rectangle area has been exposed since the last repaint.

Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.

isExposed(This, X, Y, W, H)

-spec isExposed(This, X, Y, W, H) -> boolean()
                   when
                       This :: wxWindow(),
                       X :: integer(),
                       Y :: integer(),
                       W :: integer(),
                       H :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

isFrozen(This)

-spec isFrozen(This) -> boolean() when This :: wxWindow().

Returns true if the window is currently frozen by a call to freeze/1.

See:

freeze/1

thaw/1

isRetained(This)

-spec isRetained(This) -> boolean() when This :: wxWindow().

Returns true if the window is retained, false otherwise.

Remark: Retained windows are only available on X platforms.

isShown(This)

-spec isShown(This) -> boolean() when This :: wxWindow().

Returns true if the window is shown, false if it has been hidden.

See: isShownOnScreen/1

isShownOnScreen(This)

-spec isShownOnScreen(This) -> boolean() when This :: wxWindow().

Returns true if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well.

See: isShown/1

isTopLevel(This)

-spec isTopLevel(This) -> boolean() when This :: wxWindow().

Returns true if the given window is a top-level one.

Currently all frames and dialogs are considered to be top-level windows (even if they have a parent window).

layout(This)

-spec layout(This) -> boolean() when This :: wxWindow().

Lays out the children of this window using the associated sizer.

If a sizer hadn't been associated with this window (see setSizer/3), this function doesn't do anything, unless this is a top level window (see layout/1).

Note that this method is called automatically when the window size changes if it has the associated sizer (or if setAutoLayout/2 with true argument had been explicitly called), ensuring that it is always laid out correctly.

See: Overview windowsizing

Return: Always returns true, the return value is not useful.

lineDown(This)

-spec lineDown(This) -> boolean() when This :: wxWindow().

Same as scrollLines/2 (1).

lineUp(This)

-spec lineUp(This) -> boolean() when This :: wxWindow().

Same as scrollLines/2 (-1).

lower(This)

-spec lower(This) -> ok when This :: wxWindow().

Lowers the window to the bottom of the window hierarchy (Z-order).

Remark: This function only works for wxTopLevelWindow-derived classes.

See: raise/1

move(This, Pt)

-spec move(This, Pt) -> ok when This :: wxWindow(), Pt :: {X :: integer(), Y :: integer()}.

Equivalent to move(This, Pt, []).

move/3

-spec move(This, X, Y) -> ok when This :: wxWindow(), X :: integer(), Y :: integer();
          (This, Pt, [Option]) -> ok
              when
                  This :: wxWindow(),
                  Pt :: {X :: integer(), Y :: integer()},
                  Option :: {flags, integer()}.

Moves the window to the given position.

Remark: Implementations of setSize/6 can also implicitly implement the move/4 function, which is defined in the base wxWindow class as the call:

See: setSize/6

move/4

-spec move(This, X, Y, [Option]) -> ok
              when This :: wxWindow(), X :: integer(), Y :: integer(), Option :: {flags, integer()}.

Moves the window to the given position.

Remark: Implementations of SetSize can also implicitly implement the move/4 function, which is defined in the base wxWindow class as the call:

See: setSize/6

moveAfterInTabOrder(This, Win)

-spec moveAfterInTabOrder(This, Win) -> ok when This :: wxWindow(), Win :: wxWindow().

Moves this window in the tab navigation order after the specified win.

This means that when the user presses TAB key on that other window, the focus switches to this window.

Default tab order is the same as creation order, this function and moveBeforeInTabOrder/2 allow to change it after creating all the windows.

moveBeforeInTabOrder(This, Win)

-spec moveBeforeInTabOrder(This, Win) -> ok when This :: wxWindow(), Win :: wxWindow().

Same as moveAfterInTabOrder/2 except that it inserts this window just before win instead of putting it right after it.

navigate(This)

-spec navigate(This) -> boolean() when This :: wxWindow().

Equivalent to navigate(This, []).

navigate/2

-spec navigate(This, [Option]) -> boolean() when This :: wxWindow(), Option :: {flags, integer()}.

Performs a keyboard navigation action starting from this window.

This method is equivalent to calling NavigateIn() (not implemented in wx) method on the parent window.

Return: Returns true if the focus was moved to another window or false if nothing changed.

Remark: You may wish to call this from a text control custom keypress handler to do the default navigation behaviour for the tab key, since the standard default behaviour for a multiline text control with the wxTE_PROCESS_TAB style is to insert a tab and not navigate to the next control. See also wxNavigationKeyEvent and HandleAsNavigationKey.

new()

-spec new() -> wxWindow().

Default constructor.

new(Parent, Id)

-spec new(Parent, Id) -> wxWindow() when Parent :: wxWindow(), Id :: integer().

Equivalent to new(Parent, Id, []).

new/3

-spec new(Parent, Id, [Option]) -> wxWindow()
             when
                 Parent :: wxWindow(),
                 Id :: integer(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()}.

Constructs a window, which can be a child of a frame, dialog or any other non-control window.

pageDown(This)

-spec pageDown(This) -> boolean() when This :: wxWindow().

Same as scrollPages/2 (1).

pageUp(This)

-spec pageUp(This) -> boolean() when This :: wxWindow().

Same as scrollPages/2 (-1).

popupMenu(This, Menu)

-spec popupMenu(This, Menu) -> boolean() when This :: wxWindow(), Menu :: wxMenu:wxMenu().

Equivalent to popupMenu(This, Menu, []).

popupMenu/3

-spec popupMenu(This, Menu, [Option]) -> boolean()
                   when
                       This :: wxWindow(),
                       Menu :: wxMenu:wxMenu(),
                       Option :: {pos, {X :: integer(), Y :: integer()}}.

Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu.

If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If coordinates are not specified, the current mouse cursor position is used.

menu is the menu to pop up.

The position where the menu will appear can be specified either as a {X,Y} pos or by two integers (x and y).

Note that this function switches focus to this window before showing the menu.

Remark: Just before the menu is popped up, wxMenu::UpdateUI (not implemented in wx) is called to ensure that the menu items are in the correct state. The menu does not get deleted by the window. It is recommended to not explicitly specify coordinates when calling PopupMenu in response to mouse click, because some of the ports (namely, wxGTK) can do a better job of positioning the menu in that case.

See: wxMenu

popupMenu(This, Menu, X, Y)

-spec popupMenu(This, Menu, X, Y) -> boolean()
                   when This :: wxWindow(), Menu :: wxMenu:wxMenu(), X :: integer(), Y :: integer().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

raise(This)

-spec raise(This) -> ok when This :: wxWindow().

Raises the window to the top of the window hierarchy (Z-order).

Notice that this function only requests the window manager to raise this window to the top of Z-order. Depending on its configuration, the window manager may raise the window, not do it at all or indicate that a window requested to be raised in some other way, e.g. by flashing its icon if it is minimized.

Remark: This function only works for wxTopLevelWindow-derived classes.

See: lower/1

refresh(This)

-spec refresh(This) -> ok when This :: wxWindow().

Equivalent to refresh(This, []).

refresh/2

-spec refresh(This, [Option]) -> ok
                 when
                     This :: wxWindow(),
                     Option ::
                         {eraseBackground, boolean()} |
                         {rect, {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}}.

Causes this window, and all of its children recursively (except under wxGTK1 where this is not implemented), to be repainted.

Note that repainting doesn't happen immediately but only during the next event loop iteration, if you need to update the window immediately you should use update/1 instead.

See: refreshRect/3

refreshRect(This, Rect)

-spec refreshRect(This, Rect) -> ok
                     when
                         This :: wxWindow(),
                         Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

Equivalent to refreshRect(This, Rect, []).

refreshRect/3

-spec refreshRect(This, Rect, [Option]) -> ok
                     when
                         This :: wxWindow(),
                         Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                         Option :: {eraseBackground, boolean()}.

Redraws the contents of the given rectangle: only the area inside it will be repainted.

This is the same as refresh/2 but has a nicer syntax as it can be called with a temporary {X,Y,W,H} object as argument like this RefreshRect(wxRect(x, y, w, h)).

releaseMouse(This)

-spec releaseMouse(This) -> ok when This :: wxWindow().

Releases mouse input captured with captureMouse/1.

See:

captureMouse/1

hasCapture/1

releaseMouse/1

wxMouseCaptureLostEvent

wxMouseCaptureChangedEvent

removeChild(This, Child)

-spec removeChild(This, Child) -> ok when This :: wxWindow(), Child :: wxWindow().

Removes a child window.

This is called automatically by window deletion functions so should not be required by the application programmer. Notice that this function is mostly internal to wxWidgets and shouldn't be called by the user code.

reparent(This, NewParent)

-spec reparent(This, NewParent) -> boolean() when This :: wxWindow(), NewParent :: wxWindow().

Reparents the window, i.e. the window will be removed from its current parent window (e.g.

a non-standard toolbar in a wxFrame) and then re-inserted into another.

Notice that currently you need to explicitly call wxBookCtrlBase:removePage/2 before reparenting a notebook page.

screenToClient(This)

-spec screenToClient(This) -> {X :: integer(), Y :: integer()} when This :: wxWindow().

Converts from screen to client window coordinates.

screenToClient(This, Pt)

-spec screenToClient(This, Pt) -> {X :: integer(), Y :: integer()}
                        when This :: wxWindow(), Pt :: {X :: integer(), Y :: integer()}.

Converts from screen to client window coordinates.

scrollLines(This, Lines)

-spec scrollLines(This, Lines) -> boolean() when This :: wxWindow(), Lines :: integer().

Scrolls the window by the given number of lines down (if lines is positive) or up.

Return: Returns true if the window was scrolled, false if it was already on top/bottom and nothing was done.

Remark: This function is currently only implemented under MSW and wxTextCtrl under wxGTK (it also works for wxScrolled (not implemented in wx) classes under all platforms).

See: scrollPages/2

scrollPages(This, Pages)

-spec scrollPages(This, Pages) -> boolean() when This :: wxWindow(), Pages :: integer().

Scrolls the window by the given number of pages down (if pages is positive) or up.

Return: Returns true if the window was scrolled, false if it was already on top/bottom and nothing was done.

Remark: This function is currently only implemented under MSW and wxGTK.

See: scrollLines/2

scrollWindow(This, Dx, Dy)

-spec scrollWindow(This, Dx, Dy) -> ok when This :: wxWindow(), Dx :: integer(), Dy :: integer().

Equivalent to scrollWindow(This, Dx, Dy, []).

scrollWindow/4

-spec scrollWindow(This, Dx, Dy, [Option]) -> ok
                      when
                          This :: wxWindow(),
                          Dx :: integer(),
                          Dy :: integer(),
                          Option ::
                              {rect, {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}}.

Physically scrolls the pixels in the window and move child windows accordingly.

Remark: Note that you can often use wxScrolled (not implemented in wx) instead of using this function directly.

setAcceleratorTable(This, Accel)

-spec setAcceleratorTable(This, Accel) -> ok
                             when This :: wxWindow(), Accel :: wxAcceleratorTable:wxAcceleratorTable().

Sets the accelerator table for this window.

See wxAcceleratorTable.

setAutoLayout(This, AutoLayout)

-spec setAutoLayout(This, AutoLayout) -> ok when This :: wxWindow(), AutoLayout :: boolean().

Determines whether the layout/1 function will be called automatically when the window is resized.

This method is called implicitly by setSizer/3 but if you use SetConstraints() (not implemented in wx) you should call it manually or otherwise the window layout won't be correctly updated when its size changes.

See: setSizer/3

setBackgroundColour(This, Colour)

-spec setBackgroundColour(This, Colour) -> boolean() when This :: wxWindow(), Colour :: wx:wx_colour().

Sets the background colour of the window.

Notice that as with setForegroundColour/2, setting the background colour of a native control may not affect the entire control and could be not supported at all depending on the control and platform.

Please see inheritAttributes/1 for explanation of the difference between this method and setOwnBackgroundColour/2.

Remark: The background colour is usually painted by the default wxEraseEvent event handler function under Windows and automatically under GTK. Note that setting the background colour does not cause an immediate refresh, so you may wish to call clearBackground/1 or refresh/2 after calling this function. Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system.

Return: true if the colour was really changed, false if it was already set to this colour and nothing was done.

See:

getBackgroundColour/1

setForegroundColour/2

getForegroundColour/1

clearBackground/1

refresh/2

wxEraseEvent

wxSystemSettings

setBackgroundStyle(This, Style)

-spec setBackgroundStyle(This, Style) -> boolean() when This :: wxWindow(), Style :: wx:wx_enum().

Sets the background style of the window.

The default background style is wxBG_STYLE_ERASE which indicates that the window background may be erased in EVT_ERASE_BACKGROUND handler. This is a safe, compatibility default; however you may want to change it to wxBG_STYLE_SYSTEM if you don't define any erase background event handlers at all, to avoid unnecessary generation of erase background events and always let system erase the background. And you should change the background style to wxBG_STYLE_PAINT if you define an EVT_PAINT handler which completely overwrites the window background as in this case erasing it previously, either in EVT_ERASE_BACKGROUND handler or in the system default handler, would result in flicker as the background pixels will be repainted twice every time the window is redrawn. Do ensure that the background is entirely erased by your EVT_PAINT handler in this case however as otherwise garbage may be left on screen.

Notice that in previous versions of wxWidgets a common way to work around the above mentioned flickering problem was to define an empty EVT_ERASE_BACKGROUND handler. Setting background style to wxBG_STYLE_PAINT is a simpler and more efficient solution to the same problem.

Under wxGTK and wxOSX, you can use ?wxBG_STYLE_TRANSPARENT to obtain full transparency of the window background. Note that wxGTK supports this only since GTK 2.12 with a compositing manager enabled, call IsTransparentBackgroundSupported() (not implemented in wx) to check whether this is the case.

Also, in order for SetBackgroundStyle(wxBG_STYLE_TRANSPARENT) to work, it must be called before create/4. If you're using your own wxWindow-derived class you should write your code in the following way:

See:

setBackgroundColour/2

getForegroundColour/1

setTransparent/2

setCaret(This, Caret)

-spec setCaret(This, Caret) -> ok when This :: wxWindow(), Caret :: wxCaret:wxCaret().

Sets the caret() associated with the window.

setClientSize/2

-spec setClientSize(This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()};
                   (This, Rect) -> ok
                       when
                           This :: wxWindow(),
                           Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setClientSize(This, Width, Height)

-spec setClientSize(This, Width, Height) -> ok
                       when This :: wxWindow(), Width :: integer(), Height :: integer().

This sets the size of the window client area in pixels.

Using this function to size a window tends to be more device-independent than setSize/6, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.

See: Overview windowsizing

setContainingSizer(This, Sizer)

-spec setContainingSizer(This, Sizer) -> ok when This :: wxWindow(), Sizer :: wxSizer:wxSizer().

Used by wxSizer internally to notify the window about being managed by the given sizer.

This method should not be called from outside the library, unless you're implementing a custom sizer class - and in the latter case you must call this method with the pointer to the sizer itself whenever a window is added to it and with NULL argument when the window is removed from it.

setCursor(This, Cursor)

-spec setCursor(This, Cursor) -> boolean() when This :: wxWindow(), Cursor :: wxCursor:wxCursor().

Sets the window's cursor.

Notice that the window cursor also sets it for the children of the window implicitly.

The cursor may be wxNullCursor in which case the window cursor will be reset back to default.

See:

wx_misc:setCursor/1

wxCursor

setDoubleBuffered(This, On)

-spec setDoubleBuffered(This, On) -> ok when This :: wxWindow(), On :: boolean().

Turn on or off double buffering of the window if the system supports it.

setDropTarget(This, Target)

-spec setDropTarget(This, Target) -> ok when This :: wxWindow(), Target :: wx:wx_object().

Associates a drop target with this window.

If the window already has a drop target, it is deleted.

See:

getDropTarget/1

Overview dnd

setExtraStyle(This, ExStyle)

-spec setExtraStyle(This, ExStyle) -> ok when This :: wxWindow(), ExStyle :: integer().

Sets the extra style bits for the window.

The currently defined extra style bits are reported in the class description.

setFocus(This)

-spec setFocus(This) -> ok when This :: wxWindow().

This sets the window to receive keyboard input.

See:

wxFocusEvent

setFocus/1

wxPanel:setFocusIgnoringChildren/1

setFocusFromKbd(This)

-spec setFocusFromKbd(This) -> ok when This :: wxWindow().

This function is called by wxWidgets keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using TAB key).

By default this method simply calls setFocus/1 but can be overridden to do something in addition to this in the derived classes.

setFont(This, Font)

-spec setFont(This, Font) -> boolean() when This :: wxWindow(), Font :: wxFont:wxFont().

Sets the font for this window.

This function should not be called for the parent window if you don't want its font to be inherited by its children, use setOwnFont/2 instead in this case and see inheritAttributes/1 for more explanations.

Please notice that the given font is not automatically used for wxPaintDC objects associated with this window, you need to call wxDC:setFont/2 too. However this font is used by any standard controls for drawing their text as well as by getTextExtent/3.

Return: true if the font was really changed, false if it was already set to this font and nothing was done.

See:

getFont/1

inheritAttributes/1

setForegroundColour(This, Colour)

-spec setForegroundColour(This, Colour) -> boolean() when This :: wxWindow(), Colour :: wx:wx_colour().

Sets the foreground colour of the window.

The meaning of foreground colour varies according to the window class; it may be the text colour or other colour, or it may not be used at all. Additionally, not all native controls support changing their foreground colour so this method may change their colour only partially or even not at all.

Please see inheritAttributes/1 for explanation of the difference between this method and setOwnForegroundColour/2.

Return: true if the colour was really changed, false if it was already set to this colour and nothing was done.

See:

getForegroundColour/1

setBackgroundColour/2

getBackgroundColour/1

shouldInheritColours/1

setHelpText(This, HelpText)

-spec setHelpText(This, HelpText) -> ok when This :: wxWindow(), HelpText :: unicode:chardata().

Sets the help text to be used as context-sensitive help for this window.

Note that the text is actually stored by the current wxHelpProvider (not implemented in wx) implementation, and not in the window object itself.

See: getHelpText/1

setId(This, Winid)

-spec setId(This, Winid) -> ok when This :: wxWindow(), Winid :: integer().

Sets the identifier of the window.

Remark: Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently.

See:

getId/1

Overview windowids

setLabel(This, Label)

-spec setLabel(This, Label) -> ok when This :: wxWindow(), Label :: unicode:chardata().

Sets the window's label.

See: getLabel/1

setMaxSize(This, Size)

-spec setMaxSize(This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()}.

Sets the maximum size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size.

See: Overview windowsizing

setMinSize(This, Size)

-spec setMinSize(This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()}.

Sets the minimum size of the window, to indicate to the sizer layout mechanism that this is the minimum required size.

You may need to call this if you change the window size after construction and before adding to its parent sizer.

Notice that calling this method doesn't prevent the program from making the window explicitly smaller than the specified size by calling setSize/6, it just ensures that it won't become smaller than this size during the automatic layout.

See: Overview windowsizing

setName(This, Name)

-spec setName(This, Name) -> ok when This :: wxWindow(), Name :: unicode:chardata().

Sets the window's name.

See: getName/1

setOwnBackgroundColour(This, Colour)

-spec setOwnBackgroundColour(This, Colour) -> ok when This :: wxWindow(), Colour :: wx:wx_colour().

Sets the background colour of the window but prevents it from being inherited by the children of this window.

See:

setBackgroundColour/2

inheritAttributes/1

setOwnFont(This, Font)

-spec setOwnFont(This, Font) -> ok when This :: wxWindow(), Font :: wxFont:wxFont().

Sets the font of the window but prevents it from being inherited by the children of this window.

See:

setFont/2

inheritAttributes/1

setOwnForegroundColour(This, Colour)

-spec setOwnForegroundColour(This, Colour) -> ok when This :: wxWindow(), Colour :: wx:wx_colour().

Sets the foreground colour of the window but prevents it from being inherited by the children of this window.

See:

setForegroundColour/2

inheritAttributes/1

setPalette(This, Pal)

-spec setPalette(This, Pal) -> ok when This :: wxWindow(), Pal :: wxPalette:wxPalette().

Deprecated:

use wxDC:setPalette/2 instead.

setScrollbar(This, Orientation, Position, ThumbSize, Range)

-spec setScrollbar(This, Orientation, Position, ThumbSize, Range) -> ok
                      when
                          This :: wxWindow(),
                          Orientation :: integer(),
                          Position :: integer(),
                          ThumbSize :: integer(),
                          Range :: integer().

Equivalent to setScrollbar(This, Orientation, Position, ThumbSize, Range, []).

setScrollbar/6

-spec setScrollbar(This, Orientation, Position, ThumbSize, Range, [Option]) -> ok
                      when
                          This :: wxWindow(),
                          Orientation :: integer(),
                          Position :: integer(),
                          ThumbSize :: integer(),
                          Range :: integer(),
                          Option :: {refresh, boolean()}.

Sets the scrollbar properties of a built-in scrollbar.

Remark: Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use: Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines are currently visible by dividing the current view size by the character height in pixels. When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and SetScrollbar call into a function named AdjustScrollbars, which can be called initially and also from your wxSizeEvent handler function.

See:

Overview scrolling

wxScrollBar

wxScrollWinEvent

setScrollPos(This, Orientation, Pos)

-spec setScrollPos(This, Orientation, Pos) -> ok
                      when This :: wxWindow(), Orientation :: integer(), Pos :: integer().

Equivalent to setScrollPos(This, Orientation, Pos, []).

setScrollPos/4

-spec setScrollPos(This, Orientation, Pos, [Option]) -> ok
                      when
                          This :: wxWindow(),
                          Orientation :: integer(),
                          Pos :: integer(),
                          Option :: {refresh, boolean()}.

Sets the position of one of the built-in scrollbars.

Remark: This function does not directly affect the contents of the window: it is up to the application to take note of scrollbar attributes and redraw contents accordingly.

See:

setScrollbar/6

getScrollPos/2

getScrollThumb/2

wxScrollBar

setSize/2

-spec setSize(This, Rect) -> ok
                 when
                     This :: wxWindow(),
                     Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()};
             (This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSize/3

-spec setSize(This, Width, Height) -> ok
                 when This :: wxWindow(), Width :: integer(), Height :: integer();
             (This, Rect, [Option]) -> ok
                 when
                     This :: wxWindow(),
                     Rect :: {X :: integer(), Y :: integer(), W :: integer(), H :: integer()},
                     Option :: {sizeFlags, integer()}.

Sets the size of the window in pixels.

The size is specified using a {X,Y,W,H}, {Width,Height} or by a couple of int objects.

Remark: This form must be used with non-default width and height values.

See:

move/4

Overview windowsizing

setSize(This, X, Y, Width, Height)

-spec setSize(This, X, Y, Width, Height) -> ok
                 when
                     This :: wxWindow(),
                     X :: integer(),
                     Y :: integer(),
                     Width :: integer(),
                     Height :: integer().

Equivalent to setSize(This, X, Y, Width, Height, []).

setSize/6

-spec setSize(This, X, Y, Width, Height, [Option]) -> ok
                 when
                     This :: wxWindow(),
                     X :: integer(),
                     Y :: integer(),
                     Width :: integer(),
                     Height :: integer(),
                     Option :: {sizeFlags, integer()}.

Sets the size of the window in pixels.

Remark: This overload sets the position and optionally size, of the window. Parameters may be wxDefaultCoord to indicate either that a default should be supplied by wxWidgets, or that the current value of the dimension should be used.

See:

move/4

Overview windowsizing

setSizeHints(This, MinSize)

-spec setSizeHints(This, MinSize) -> ok
                      when This :: wxWindow(), MinSize :: {W :: integer(), H :: integer()}.

Equivalent to setSizeHints(This, MinSize, []).

setSizeHints/3

-spec setSizeHints(This, MinW, MinH) -> ok when This :: wxWindow(), MinW :: integer(), MinH :: integer();
                  (This, MinSize, [Option]) -> ok
                      when
                          This :: wxWindow(),
                          MinSize :: {W :: integer(), H :: integer()},
                          Option ::
                              {maxSize, {W :: integer(), H :: integer()}} |
                              {incSize, {W :: integer(), H :: integer()}}.

Use of this function for windows which are not toplevel windows (such as wxDialog or wxFrame) is discouraged.

Please use setMinSize/2 and setMaxSize/2 instead.

See:

setSizeHints/4

Overview windowsizing

setSizeHints/4

-spec setSizeHints(This, MinW, MinH, [Option]) -> ok
                      when
                          This :: wxWindow(),
                          MinW :: integer(),
                          MinH :: integer(),
                          Option ::
                              {maxW, integer()} |
                              {maxH, integer()} |
                              {incW, integer()} |
                              {incH, integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setSizer(This, Sizer)

-spec setSizer(This, Sizer) -> ok when This :: wxWindow(), Sizer :: wxSizer:wxSizer().

Equivalent to setSizer(This, Sizer, []).

setSizer/3

-spec setSizer(This, Sizer, [Option]) -> ok
                  when This :: wxWindow(), Sizer :: wxSizer:wxSizer(), Option :: {deleteOld, boolean()}.

Sets the window to have the given layout sizer.

The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted if the deleteOld parameter is true.

Note that this function will also call setAutoLayout/2 implicitly with true parameter if the sizer is non-NULL and false otherwise so that the sizer will be effectively used to layout the window children whenever it is resized.

Remark: SetSizer enables and disables Layout automatically.

setSizerAndFit(This, Sizer)

-spec setSizerAndFit(This, Sizer) -> ok when This :: wxWindow(), Sizer :: wxSizer:wxSizer().

Equivalent to setSizerAndFit(This, Sizer, []).

setSizerAndFit/3

-spec setSizerAndFit(This, Sizer, [Option]) -> ok
                        when
                            This :: wxWindow(),
                            Sizer :: wxSizer:wxSizer(),
                            Option :: {deleteOld, boolean()}.

Associate the sizer with the window and set the window size and minimal size accordingly.

This method calls setSizer/3 and then wxSizer:setSizeHints/2 which sets the initial window size to the size needed to accommodate all sizer elements and sets the minimal size to the same size, this preventing the user from resizing this window to be less than this minimal size (if it's a top-level window which can be directly resized by the user).

setThemeEnabled(This, Enable)

-spec setThemeEnabled(This, Enable) -> ok when This :: wxWindow(), Enable :: boolean().

This function tells a window if it should use the system's "theme" code to draw the windows' background instead of its own background drawing code.

This does not always have any effect since the underlying platform obviously needs to support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme.

Dialogs, notebook pages and the status bar have this flag set to true by default so that the default look and feel is simulated best.

See: getThemeEnabled/1

setToolTip/2

-spec setToolTip(This, TipString) -> ok when This :: wxWindow(), TipString :: unicode:chardata();
                (This, Tip) -> ok when This :: wxWindow(), Tip :: wxToolTip:wxToolTip().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setTransparent(This, Alpha)

-spec setTransparent(This, Alpha) -> boolean() when This :: wxWindow(), Alpha :: integer().

Set the transparency of the window.

If the system supports transparent windows, returns true, otherwise returns false and the window remains fully opaque. See also canSetTransparent/1.

The parameter alpha is in the range 0..255 where 0 corresponds to a fully transparent window and 255 to the fully opaque one. The constants wxIMAGE_ALPHA_TRANSPARENT and wxIMAGE_ALPHA_OPAQUE can be used.

setVirtualSize(This, Size)

-spec setVirtualSize(This, Size) -> ok when This :: wxWindow(), Size :: {W :: integer(), H :: integer()}.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

setVirtualSize(This, Width, Height)

-spec setVirtualSize(This, Width, Height) -> ok
                        when This :: wxWindow(), Width :: integer(), Height :: integer().

Sets the virtual size of the window in pixels.

See: Overview windowsizing

setWindowStyle(This, Style)

-spec setWindowStyle(This, Style) -> ok when This :: wxWindow(), Style :: integer().

See setWindowStyleFlag/2 for more info.

setWindowStyleFlag(This, Style)

-spec setWindowStyleFlag(This, Style) -> ok when This :: wxWindow(), Style :: integer().

Sets the style of the window.

Please note that some styles cannot be changed after the window creation and that refresh/2 might need to be called after changing the others for the change to take place immediately.

See Window styles for more information about flags.

See: getWindowStyleFlag/1

setWindowVariant(This, Variant)

-spec setWindowVariant(This, Variant) -> ok when This :: wxWindow(), Variant :: wx:wx_enum().

Chooses a different variant of the window display to use.

Window variants currently just differ in size, as can be seen from ?wxWindowVariant documentation. Under all platforms but macOS, this function does nothing more than change the font used by the window. However under macOS it is implemented natively and selects the appropriate variant of the native widget, which has better appearance than just scaled down or up version of the normal variant, so it should be preferred to directly tweaking the font size.

By default the controls naturally use the normal variant.

shouldInheritColours(This)

-spec shouldInheritColours(This) -> boolean() when This :: wxWindow().

Return true from here to allow the colours of this window to be changed by inheritAttributes/1.

Returning false forbids inheriting them from the parent window.

The base class version returns false, but this method is overridden in wxControl where it returns true.

show(This)

-spec show(This) -> boolean() when This :: wxWindow().

Equivalent to show(This, []).

show/2

-spec show(This, [Option]) -> boolean() when This :: wxWindow(), Option :: {show, boolean()}.

Shows or hides the window.

You may need to call raise/1 for a top level window if you want to bring it to top, although this is not needed if show/2 is called immediately after the frame creation.

Notice that the default state of newly created top level windows is hidden (to allow you to create their contents without flicker) unlike for all the other, not derived from wxTopLevelWindow, windows that are by default created in the shown state.

Return: true if the window has been shown or hidden or false if nothing was done because it already was in the requested state.

See:

isShown/1

hide/1

wxRadioBox:show/3

wxShowEvent

thaw(This)

-spec thaw(This) -> ok when This :: wxWindow().

Re-enables window updating after a previous call to freeze/1.

To really thaw the control, it must be called exactly the same number of times as freeze/1.

If the window has any children, they are recursively thawed too.

See:

freeze/1

isFrozen/1

toDIP/2

-spec toDIP(D, W) -> integer() when D :: integer(), W :: wxWindow();
           (Sz, W) -> {W :: integer(), H :: integer()}
               when Sz :: {W :: integer(), H :: integer()}, W :: wxWindow();
           (This, D) -> integer() when This :: wxWindow(), D :: integer();
           (This, Sz) -> {W :: integer(), H :: integer()}
               when This :: wxWindow(), Sz :: {W :: integer(), H :: integer()}.

Convert pixel values of the current toolkit to DPI-independent pixel values.

A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by getDPIScaleFactor/1 but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit, For example, you may want to use this to store window sizes and positions so that they can be re-used regardless of the display DPI:

Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").

Since: 3.1.0

transferDataFromWindow(This)

-spec transferDataFromWindow(This) -> boolean() when This :: wxWindow().

Transfers values from child controls to data areas specified by their validators.

Returns false if a transfer failed.

Notice that this also calls transferDataFromWindow/1 for all children recursively.

See:

transferDataToWindow/1

validate/1

transferDataToWindow(This)

-spec transferDataToWindow(This) -> boolean() when This :: wxWindow().

Transfers values to child controls from data areas specified by their validators.

Notice that this also calls transferDataToWindow/1 for all children recursively.

Return: Returns false if a transfer failed.

See:

transferDataFromWindow/1

validate/1

update(This)

-spec update(This) -> ok when This :: wxWindow().

Calling this method immediately repaints the invalidated area of the window and all of its children recursively (this normally only happens when the flow of control returns to the event loop).

Notice that this function doesn't invalidate any area of the window so nothing happens if nothing has been invalidated (i.e. marked as requiring a redraw). Use refresh/2 first if you want to immediately redraw the window unconditionally.

updateWindowUI(This)

-spec updateWindowUI(This) -> ok when This :: wxWindow().

Equivalent to updateWindowUI(This, []).

updateWindowUI/2

-spec updateWindowUI(This, [Option]) -> ok when This :: wxWindow(), Option :: {flags, integer()}.

This function sends one or more wxUpdateUIEvent to the window.

The particular implementation depends on the window; for example a wxToolBar will send an update UI event for each toolbar button, and a wxFrame will send an update UI event for each menubar menu item.

You can call this function from your application to ensure that your UI is up-to-date at this point (as far as your wxUpdateUIEvent handlers are concerned). This may be necessary if you have called wxUpdateUIEvent:setMode/1 or wxUpdateUIEvent:setUpdateInterval/1 to limit the overhead that wxWidgets incurs by sending update UI events in idle time. flags should be a bitlist of one or more of the ?wxUpdateUI enumeration.

If you are calling this function from an OnInternalIdle or OnIdle function, make sure you pass the wxUPDATE_UI_FROMIDLE flag, since this tells the window to only update the UI elements that need to be updated in idle time. Some windows update their elements only when necessary, for example when a menu is about to be shown. The following is an example of how to call UpdateWindowUI from an idle function.

See: wxUpdateUIEvent

validate(This)

-spec validate(This) -> boolean() when This :: wxWindow().

Validates the current values of the child controls using their validators.

Notice that this also calls validate/1 for all children recursively.

Return: Returns false if any of the validations failed.

See:

transferDataFromWindow/1

transferDataToWindow/1

warpPointer(This, X, Y)

-spec warpPointer(This, X, Y) -> ok when This :: wxWindow(), X :: integer(), Y :: integer().

Moves the pointer to the given position on the window.

Note: Apple Human Interface Guidelines forbid moving the mouse cursor programmatically so you should avoid using this function in Mac applications (and probably avoid using it under the other platforms without good reason as well).

wxWindowCreateEvent

This event is sent just after the actual window associated with a wxWindow object has been created.

Since it is derived from wxCommandEvent, the event propagates up the window hierarchy.

See:

Overview events

wxWindowDestroyEvent

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxWindowCreateEvent

Events

Use wxEvtHandler:connect/3 with wxWindowCreateEventType to subscribe to events of this type.

Summary

Types

wxWindowCreate()

wxWindowCreateEvent()

wxWindowCreateEventType()

Types

wxWindowCreate()

-type wxWindowCreate() :: #wxWindowCreate{type :: wxWindowCreateEvent:wxWindowCreateEventType()}.

wxWindowCreateEvent()

-type wxWindowCreateEvent() :: wx:wx_object().

wxWindowCreateEventType()

-type wxWindowCreateEventType() :: create.

wxWindowDC

A wxWindowDC must be constructed if an application wishes to paint on the whole area of a window (client and decorations).

This should normally be constructed as a temporary stack object; don't store a wxWindowDC object.

To draw on a window from inside an EVT_PAINT() handler, construct a wxPaintDC object instead.

To draw on the client area of a window from outside an EVT_PAINT() handler, construct a wxClientDC object.

A wxWindowDC object is initialized to use the same font and colours as the window it is associated with.

See:

wxDC

wxMemoryDC

wxPaintDC

wxClientDC

wxScreenDC

This class is derived, and can use functions, from:

wxDC

wxWidgets docs: wxWindowDC

Summary

Types

wxWindowDC()

Functions

destroy(This)

Destroys the object

new(Window)

Constructor.

Types

wxWindowDC()

-type wxWindowDC() :: wx:wx_object().

Functions

destroy(This)

-spec destroy(This :: wxWindowDC()) -> ok.

Destroys the object

new(Window)

-spec new(Window) -> wxWindowDC() when Window :: wxWindow:wxWindow().

Constructor.

Pass a pointer to the window on which you wish to paint.

wxWindowDestroyEvent

This event is sent as early as possible during the window destruction process.

For the top level windows, as early as possible means that this is done by wxFrame or wxDialog destructor, i.e. after the destructor of the derived class was executed and so any methods specific to the derived class can't be called any more from this event handler. If you need to do this, you must call wxWindow::SendDestroyEvent() (not implemented in wx) from your derived class destructor.

For the child windows, this event is generated just before deleting the window from wxWindow:'Destroy'/1 (which is also called when the parent window is deleted) or from the window destructor if operator delete was used directly (which is not recommended for this very reason).

It is usually pointless to handle this event in the window itself but it ca be very useful to receive notifications about the window destruction in the parent window or in any other object interested in this window.

See:

Overview events

wxWindowCreateEvent

This class is derived, and can use functions, from:

wxCommandEvent

wxEvent

wxWidgets docs: wxWindowDestroyEvent

Summary

Types

wxWindowDestroy()

wxWindowDestroyEvent()

wxWindowDestroyEventType()

Types

wxWindowDestroy()

-type wxWindowDestroy() :: #wxWindowDestroy{type :: wxWindowDestroyEvent:wxWindowDestroyEventType()}.

wxWindowDestroyEvent()

-type wxWindowDestroyEvent() :: wx:wx_object().

wxWindowDestroyEventType()

-type wxWindowDestroyEventType() :: destroy.

wxXmlResource

This is the main class for interacting with the XML-based resource system.

The class holds XML resources from one or more .xml files, binary files or zip archive files.

Note that this is a singleton class and you'll never allocate/deallocate it. Just use the static get/0 getter.

See:

Overview xrc

Overview xrcformat

wxWidgets docs: wxXmlResource

Summary

Types

wxXmlResource()

Functions

attachUnknownControl(This, Name, Control)

Equivalent to attachUnknownControl(This, Name, Control, []).

attachUnknownControl/4

Attaches an unknown control to the given panel/window/dialog.

clearHandlers(This)

Removes all handlers and deletes them (this means that any handlers added using AddHandler() (not implemented in wx) must be allocated on the heap).

compareVersion(This, Major, Minor, Release, Revision)

Compares the XRC version to the argument.

destroy(This)

Destroys the object

get()

Gets the global resources object or creates one if none exists.

getFlags(This)

Returns flags, which may be a bitlist of ?wxXmlResourceFlags enumeration values.

getVersion(This)

Returns version information (a.b.c.d = d + 256c + 2562b + 2563*a).

getXRCID(Str_id)

Equivalent to getXRCID(Str_id, []).

getXRCID(Str_id, Options)

Returns a numeric ID that is equivalent to the string ID used in an XML resource.

initAllHandlers(This)

Initializes handlers for all supported controls/windows.

load(This, Filemask)

Loads resources from XML files that match given filemask.

loadBitmap(This, Name)

Loads a bitmap resource from a file.

loadDialog(This, Parent, Name)

Loads a dialog.

loadDialog(This, Dlg, Parent, Name)

Loads a dialog.

loadFrame(This, Parent, Name)

Loads a frame from the resource.

loadFrame(This, Frame, Parent, Name)

Loads the contents of a frame onto an existing wxFrame.

loadIcon(This, Name)

Loads an icon resource from a file.

loadMenu(This, Name)

Loads menu from resource.

loadMenuBar(This, Name)

loadMenuBar(This, Parent, Name)

Loads a menubar from resource.

loadPanel(This, Parent, Name)

Loads a panel.

loadPanel(This, Panel, Parent, Name)

Loads a panel.

loadToolBar(This, Parent, Name)

Loads a toolbar.

new()

Equivalent to new([]).

new(Options)

Constructor.

new(Filemask, Options)

Constructor.

set(Res)

Sets the global resources object and returns a pointer to the previous one (may be NULL).

setFlags(This, Flags)

Sets flags (bitlist of ?wxXmlResourceFlags enumeration values).

unload(This, Filename)

This function unloads a resource previously loaded by load/2.

xrcctrl(Window, Name, Type)

Types

wxXmlResource()

-type wxXmlResource() :: wx:wx_object().

Functions

attachUnknownControl(This, Name, Control)

-spec attachUnknownControl(This, Name, Control) -> boolean()
                              when
                                  This :: wxXmlResource(),
                                  Name :: unicode:chardata(),
                                  Control :: wxWindow:wxWindow().

Equivalent to attachUnknownControl(This, Name, Control, []).

attachUnknownControl/4

-spec attachUnknownControl(This, Name, Control, [Option]) -> boolean()
                              when
                                  This :: wxXmlResource(),
                                  Name :: unicode:chardata(),
                                  Control :: wxWindow:wxWindow(),
                                  Option :: {parent, wxWindow:wxWindow()}.

Attaches an unknown control to the given panel/window/dialog.

Unknown controls are used in conjunction with <object class="unknown">.

clearHandlers(This)

-spec clearHandlers(This) -> ok when This :: wxXmlResource().

Removes all handlers and deletes them (this means that any handlers added using AddHandler() (not implemented in wx) must be allocated on the heap).

compareVersion(This, Major, Minor, Release, Revision)

-spec compareVersion(This, Major, Minor, Release, Revision) -> integer()
                        when
                            This :: wxXmlResource(),
                            Major :: integer(),
                            Minor :: integer(),
                            Release :: integer(),
                            Revision :: integer().

Compares the XRC version to the argument.

Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they are equal.

destroy(This)

-spec destroy(This :: wxXmlResource()) -> ok.

Destroys the object

get()

-spec get() -> wxXmlResource().

Gets the global resources object or creates one if none exists.

getFlags(This)

-spec getFlags(This) -> integer() when This :: wxXmlResource().

Returns flags, which may be a bitlist of ?wxXmlResourceFlags enumeration values.

getVersion(This)

-spec getVersion(This) -> integer() when This :: wxXmlResource().

Returns version information (a.b.c.d = d + 256c + 2562b + 2563*a).

getXRCID(Str_id)

-spec getXRCID(Str_id) -> integer() when Str_id :: unicode:chardata().

Equivalent to getXRCID(Str_id, []).

getXRCID(Str_id, Options)

-spec getXRCID(Str_id, [Option]) -> integer()
                  when Str_id :: unicode:chardata(), Option :: {value_if_not_found, integer()}.

Returns a numeric ID that is equivalent to the string ID used in an XML resource.

If an unknown str_id is requested (i.e. other than wxID_XXX or integer), a new record is created which associates the given string with a number.

If value_if_not_found is wxID_NONE, the number is obtained via wx_misc:newId/0. Otherwise value_if_not_found is used.

Macro XRCID(name) is provided for convenient use in event tables.

Note: IDs returned by XRCID() cannot be used with the EVT_*_RANGE macros, because the order in which they are assigned to symbolic name values is not guaranteed.

initAllHandlers(This)

-spec initAllHandlers(This) -> ok when This :: wxXmlResource().

Initializes handlers for all supported controls/windows.

This will make the executable quite big because it forces linking against most of the wxWidgets library.

load(This, Filemask)

-spec load(This, Filemask) -> boolean() when This :: wxXmlResource(), Filemask :: unicode:chardata().

Loads resources from XML files that match given filemask.

Example:

Note: If wxUSE_FILESYS is enabled, this method understands wxFileSystem (not implemented in wx) URLs (see wxFileSystem::FindFirst() (not implemented in wx)).

Note: If you are sure that the argument is name of single XRC file (rather than an URL or a wildcard), use LoadFile() (not implemented in wx) instead.

loadBitmap(This, Name)

-spec loadBitmap(This, Name) -> wxBitmap:wxBitmap()
                    when This :: wxXmlResource(), Name :: unicode:chardata().

Loads a bitmap resource from a file.

loadDialog(This, Parent, Name)

-spec loadDialog(This, Parent, Name) -> wxDialog:wxDialog()
                    when
                        This :: wxXmlResource(),
                        Parent :: wxWindow:wxWindow(),
                        Name :: unicode:chardata().

Loads a dialog.

parent points to parent window (if any).

loadDialog(This, Dlg, Parent, Name)

-spec loadDialog(This, Dlg, Parent, Name) -> boolean()
                    when
                        This :: wxXmlResource(),
                        Dlg :: wxDialog:wxDialog(),
                        Parent :: wxWindow:wxWindow(),
                        Name :: unicode:chardata().

Loads a dialog.

parent points to parent window (if any).

This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example:

loadFrame(This, Parent, Name)

-spec loadFrame(This, Parent, Name) -> wxFrame:wxFrame()
                   when
                       This :: wxXmlResource(),
                       Parent :: wxWindow:wxWindow(),
                       Name :: unicode:chardata().

Loads a frame from the resource.

parent points to parent window (if any).

loadFrame(This, Frame, Parent, Name)

-spec loadFrame(This, Frame, Parent, Name) -> boolean()
                   when
                       This :: wxXmlResource(),
                       Frame :: wxFrame:wxFrame(),
                       Parent :: wxWindow:wxWindow(),
                       Name :: unicode:chardata().

Loads the contents of a frame onto an existing wxFrame.

This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table).

loadIcon(This, Name)

-spec loadIcon(This, Name) -> wxIcon:wxIcon() when This :: wxXmlResource(), Name :: unicode:chardata().

Loads an icon resource from a file.

loadMenu(This, Name)

-spec loadMenu(This, Name) -> wxMenu:wxMenu() when This :: wxXmlResource(), Name :: unicode:chardata().

Loads menu from resource.

Returns NULL on failure.

loadMenuBar(This, Name)

-spec loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar()
                     when This :: wxXmlResource(), Name :: unicode:chardata().

loadMenuBar(This, Parent, Name)

-spec loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar()
                     when
                         This :: wxXmlResource(),
                         Parent :: wxWindow:wxWindow(),
                         Name :: unicode:chardata().

Loads a menubar from resource.

Returns NULL on failure.

loadPanel(This, Parent, Name)

-spec loadPanel(This, Parent, Name) -> wxPanel:wxPanel()
                   when
                       This :: wxXmlResource(),
                       Parent :: wxWindow:wxWindow(),
                       Name :: unicode:chardata().

Loads a panel.

parent points to the parent window.

loadPanel(This, Panel, Parent, Name)

-spec loadPanel(This, Panel, Parent, Name) -> boolean()
                   when
                       This :: wxXmlResource(),
                       Panel :: wxPanel:wxPanel(),
                       Parent :: wxWindow:wxWindow(),
                       Name :: unicode:chardata().

Loads a panel.

parent points to the parent window. This form is used to finish creation of an already existing instance.

loadToolBar(This, Parent, Name)

-spec loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar()
                     when
                         This :: wxXmlResource(),
                         Parent :: wxWindow:wxWindow(),
                         Name :: unicode:chardata().

Loads a toolbar.

new()

-spec new() -> wxXmlResource().

Equivalent to new([]).

new(Options)

-spec new([Option]) -> wxXmlResource() when Option :: {flags, integer()} | {domain, unicode:chardata()}.

Constructor.

new(Filemask, Options)

-spec new(Filemask, [Option]) -> wxXmlResource()
             when
                 Filemask :: unicode:chardata(),
                 Option :: {flags, integer()} | {domain, unicode:chardata()}.

Constructor.

set(Res)

-spec set(Res) -> wxXmlResource() when Res :: wxXmlResource().

Sets the global resources object and returns a pointer to the previous one (may be NULL).

setFlags(This, Flags)

-spec setFlags(This, Flags) -> ok when This :: wxXmlResource(), Flags :: integer().

Sets flags (bitlist of ?wxXmlResourceFlags enumeration values).

unload(This, Filename)

-spec unload(This, Filename) -> boolean() when This :: wxXmlResource(), Filename :: unicode:chardata().

This function unloads a resource previously loaded by load/2.

Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources.

xrcctrl(Window, Name, Type)

-spec xrcctrl(Window, Name, Type) -> wx:wx_object()
                 when Window :: wxWindow:wxWindow(), Name :: string(), Type :: atom().

wx_misc

Miscellaneous functions.

Summary

Functions

beginBusyCursor()

Equivalent to beginBusyCursor([]).

beginBusyCursor(Options)

Changes the cursor to the given cursor for all windows in the application.

bell()

Ring the system bell.

displaySize()

Returns the display size in pixels.

endBusyCursor()

Changes the cursor back to the original cursor, for all windows in the application.

findMenuItemId(Frame, MenuString, ItemString)

Find a menu item identifier associated with the given frame's menu bar.

findWindowAtPoint(Pt)

Find the deepest window at the given mouse position in screen coordinates, returning the window if found, or NULL if not.

getCurrentId()

Returns the current id.

getEmailAddress()

Copies the user's email address into the supplied buffer, by concatenating the values returned by wxGetFullHostName() (not implemented in wx) and wx_misc:getUserId/0.

getHomeDir()

Return the (current) user's home directory.

getKeyState(Key)

For normal keys, returns true if the specified key is currently down.

getMousePosition()

Returns the mouse position in screen coordinates.

getMouseState()

Returns the current state of the mouse.

getOsDescription()

Returns the string containing the description of the current platform in a user-readable form.

getUserId()

This function returns the "user id" also known as "login name" under Unix (i.e.

isBusy()

Returns true if between two wx_misc:beginBusyCursor/1 and wx_misc:endBusyCursor/0 calls.

isPlatform64Bit()

Returns true if the operating system the program is running under is 64 bit.

isPlatformLittleEndian()

Returns true if the current platform is little endian (instead of big endian).

launchDefaultBrowser(Url)

Equivalent to launchDefaultBrowser(Url, []).

launchDefaultBrowser(Url, Options)

Opens the url in user's default browser.

mSWSetEmulationLevel(Level)

mSWSetEmulationLevel(Level, Executable)

newId()

Deprecated

registerId(Id)

Ensures that Ids subsequently generated by wx_misc:newId/0 do not clash with the given id.

setCursor(Cursor)

Globally sets the cursor; only has an effect on Windows, Mac and GTK+.

setDetectableAutoRepeat(Flag)

Don't synthesize KeyUp events holding down a key and producing KeyDown events with autorepeat.

shell()

Equivalent to shell([]).

shell(Options)

Executes a command in an interactive shell window.

shutdown()

Equivalent to shutdown([]).

shutdown(Options)

This function shuts down or reboots the computer depending on the value of the flags.

Functions

beginBusyCursor()

-spec beginBusyCursor() -> ok.

Equivalent to beginBusyCursor([]).

beginBusyCursor(Options)

-spec beginBusyCursor([Option]) -> ok when Option :: {cursor, wxCursor:wxCursor()}.

Changes the cursor to the given cursor for all windows in the application.

Use wx_misc:endBusyCursor/0 to revert the cursor back to its previous state. These two calls can be nested, and a counter ensures that only the outer calls take effect.

See: wx_misc:isBusy/0

bell()

-spec bell() -> ok.

Ring the system bell.

Note: This function is categorized as a GUI one and so is not thread-safe.

displaySize()

-spec displaySize() -> {Width :: integer(), Height :: integer()}.

Returns the display size in pixels.

Note: Use of this function is not recommended in the new code as it only works for the primary display. Use wxDisplay:getGeometry/1 to retrieve the size of the appropriate display instead.

Either of output pointers can be NULL if the caller is not interested in the corresponding value.

See: wxDisplay

endBusyCursor()

-spec endBusyCursor() -> ok.

Changes the cursor back to the original cursor, for all windows in the application.

Use with wx_misc:beginBusyCursor/1.

See: wx_misc:isBusy/0

findMenuItemId(Frame, MenuString, ItemString)

-spec findMenuItemId(Frame, MenuString, ItemString) -> integer()
                        when
                            Frame :: wxFrame:wxFrame(),
                            MenuString :: unicode:chardata(),
                            ItemString :: unicode:chardata().

Find a menu item identifier associated with the given frame's menu bar.

findWindowAtPoint(Pt)

-spec findWindowAtPoint(Pt) -> wxWindow:wxWindow() when Pt :: {X :: integer(), Y :: integer()}.

Find the deepest window at the given mouse position in screen coordinates, returning the window if found, or NULL if not.

This function takes child windows at the given position into account even if they are disabled. The hidden children are however skipped by it.

getCurrentId()

-spec getCurrentId() -> integer().

Returns the current id.

getEmailAddress()

-spec getEmailAddress() -> unicode:charlist().

Copies the user's email address into the supplied buffer, by concatenating the values returned by wxGetFullHostName() (not implemented in wx) and wx_misc:getUserId/0.

Return: true if successful, false otherwise.

getHomeDir()

-spec getHomeDir() -> unicode:charlist().

Return the (current) user's home directory.

getKeyState(Key)

-spec getKeyState(Key) -> boolean() when Key :: wx:wx_enum().

For normal keys, returns true if the specified key is currently down.

For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns true if the key is toggled such that its LED indicator is lit. There is currently no way to test whether togglable keys are up or down.

Even though there are virtual key codes defined for mouse buttons, they cannot be used with this function currently.

In wxGTK, this function can be only used with modifier keys (WXK_ALT, WXK_CONTROL and WXK_SHIFT) when not using X11 backend currently.

getMousePosition()

-spec getMousePosition() -> {X :: integer(), Y :: integer()}.

Returns the mouse position in screen coordinates.

getMouseState()

-spec getMouseState() -> wx:wx_wxMouseState().

Returns the current state of the mouse.

Returns a wx_wxMouseState() instance that contains the current position of the mouse pointer in screen coordinates, as well as boolean values indicating the up/down status of the mouse buttons and the modifier keys.

getOsDescription()

-spec getOsDescription() -> unicode:charlist().

Returns the string containing the description of the current platform in a user-readable form.

For example, this function may return strings like "Windows 10 (build 10240), 64-bit edition" or "Linux 4.1.4 i386".

getUserId()

-spec getUserId() -> unicode:charlist().

This function returns the "user id" also known as "login name" under Unix (i.e.

something like "jsmith"). It uniquely identifies the current user (on this system). Under Windows or NT, this function first looks in the environment variables USER and LOGNAME; if neither of these is found, the entry UserId in the wxWidgets section of the WIN.INI file is tried.

Return: The login name if successful or an empty string otherwise.

isBusy()

-spec isBusy() -> boolean().

Returns true if between two wx_misc:beginBusyCursor/1 and wx_misc:endBusyCursor/0 calls.

isPlatform64Bit()

-spec isPlatform64Bit() -> boolean().

Returns true if the operating system the program is running under is 64 bit.

The check is performed at run-time and may differ from the value available at compile-time (at compile-time you can just check if sizeof(void*) == 8) since the program could be running in emulation mode or in a mixed 32/64 bit system (bi-architecture operating system).

Note: This function is not 100% reliable on some systems given the fact that there isn't always a standard way to do a reliable check on the OS architecture.

isPlatformLittleEndian()

-spec isPlatformLittleEndian() -> boolean().

Returns true if the current platform is little endian (instead of big endian).

The check is performed at run-time.

launchDefaultBrowser(Url)

-spec launchDefaultBrowser(Url) -> boolean() when Url :: unicode:chardata().

Equivalent to launchDefaultBrowser(Url, []).

launchDefaultBrowser(Url, Options)

-spec launchDefaultBrowser(Url, [Option]) -> boolean()
                              when Url :: unicode:chardata(), Option :: {flags, integer()}.

Opens the url in user's default browser.

If the flags parameter contains wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL (currently this is only supported under Windows).

And unless the flags parameter contains wxBROWSER_NOBUSYCURSOR flag, a busy cursor is shown while the browser is being launched (using wxBusyCursor (not implemented in wx)).

The parameter url is interpreted as follows:

if it has a valid scheme (e.g. "file:", "http:" or "mailto:") it is passed to the appropriate browser configured in the user system.

if it has no valid scheme (e.g. it's a local file path without the "file:" prefix), then ?wxFileExists and ?wxDirExists are used to test if it's a local file/directory; if it is, then the browser is called with the url parameter eventually prefixed by "file:".

if it has no valid scheme and it's not a local file/directory, then "http:" is prepended and the browser is called.

Returns true if the application was successfully launched.

Note: For some configurations of the running user, the application which is launched to open the given URL may be URL-dependent (e.g. a browser may be used for local URLs while another one may be used for remote URLs).

mSWSetEmulationLevel(Level)

-spec mSWSetEmulationLevel(Level) -> boolean() when Level :: wx:wx_enum().

mSWSetEmulationLevel(Level, Executable)

-spec mSWSetEmulationLevel(Level, Executable) -> boolean()
                              when Level :: wx:wx_enum(), Executable :: string().

newId()

-spec newId() -> integer().

Deprecated:

Ids generated by it can conflict with the Ids defined by the user code, use wxID_ANY to assign ids which are guaranteed to not conflict with the user-defined ids for the controls and menu items you create instead of using this function.

Generates an integer identifier unique to this run of the program.

registerId(Id)

-spec registerId(Id) -> ok when Id :: integer().

Ensures that Ids subsequently generated by wx_misc:newId/0 do not clash with the given id.

setCursor(Cursor)

-spec setCursor(Cursor) -> ok when Cursor :: wxCursor:wxCursor().

Globally sets the cursor; only has an effect on Windows, Mac and GTK+.

You should call this function with wxNullCursor to restore the system cursor.

See:

wxCursor

wxWindow:setCursor/2

setDetectableAutoRepeat(Flag)

-spec setDetectableAutoRepeat(Flag) -> boolean() when Flag :: boolean().

Don't synthesize KeyUp events holding down a key and producing KeyDown events with autorepeat.

On by default and always on in wxMSW.

shell()

-spec shell() -> boolean().

Equivalent to shell([]).

shell(Options)

-spec shell([Option]) -> boolean() when Option :: {command, unicode:chardata()}.

Executes a command in an interactive shell window.

If no command is specified, then just the shell is spawned.

See: Examples

shutdown()

-spec shutdown() -> boolean().

Equivalent to shutdown([]).

shutdown(Options)

-spec shutdown([Option]) -> boolean() when Option :: {flags, integer()}.

This function shuts down or reboots the computer depending on the value of the flags.

Note: Note that performing the shutdown requires the corresponding access rights (superuser under Unix, SE_SHUTDOWN privilege under Windows) and that this function is only implemented under Unix and MSW.

Return: true on success, false if an error occurred.

wx_object behaviour

wx_object - Generic wx object behaviour

This is a behaviour module that can be used for "sub classing" wx objects. It works like a regular gen_server module and creates a server per object.

NOTE: Currently no form of inheritance is implemented.

The user module should export:

init(Args) should return
{wxWindow, State} | {wxWindow, State, Timeout} | ignore | {stop, Reason}

Asynchronous window event handling:
handle_event(#wx{}, State) should return
{noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

The user module can export the following callback functions:

handle_call(Msg, {From, Tag}, State) should return
{reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State}

handle_cast(Msg, State) should return
{noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

If the above are not exported but called, the wx_object process will crash. The user module can also export:

Info is message e.g. {'EXIT', P, R}, {nodedown, N}, ...
handle_info(Info, State) should return , ...
{noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

If a message is sent to the wx_object process when handle_info is not exported, the message will be dropped and ignored.

When stop is returned in one of the functions above with Reason = normal | shutdown | Term, terminate(State) is called. It lets the user module clean up, it is always called when server terminates or when wx_object() in the driver is deleted. If the Parent process terminates the Module:terminate/2 function is called.
terminate(Reason, State)

Example:

  -module(myDialog).
  -export([new/2, show/1, destroy/1]).  %% API
  -export([init/1, handle_call/3, handle_event/2,
           handle_info/2, code_change/3, terminate/2]).
           new/2, showModal/1, destroy/1]).  %% Callbacks

  %% Client API
  new(Parent, Msg) ->
     wx_object:start(?MODULE, [Parent,Id], []).

  show(Dialog) ->
     wx_object:call(Dialog, show_modal).

  destroy(Dialog) ->
     wx_object:call(Dialog, destroy).

  %% Server Implementation ala gen_server
  init([Parent, Str]) ->
     Dialog = wxDialog:new(Parent, 42, "Testing", []),
     ...
     wxDialog:connect(Dialog, command_button_clicked),
     {Dialog, MyState}.

  handle_call(show, _From, State) ->
     wxDialog:show(State#state.win),
     {reply, ok, State};
  ...
  handle_event(#wx{}, State) ->
     io:format("Users clicked button~n",[]),
     {noreply, State};
  ...

DATA TYPES

request_id() = term()

server_ref() = wx:wx_object() | atom() | pid()

Summary

Types

event()

request_id()

server_ref()

Callbacks

code_change(OldVsn, State, Extra)

handle_call(Request, From, State)

handle_cast(Request, State)

handle_event(Request, State)

handle_info(Info, State)

handle_sync_event(Request, Ref, State)

init(Args)

terminate(Reason, State)

Functions

call(Obj, Request)

Make a call to a wx_object server. The call waits until it gets a result. Invokes handle_call(Request, From, State) in the server

call(Obj, Request, Timeout)

Make a call to a wx_object server with a timeout. Invokes handle_call(Request, From, State) in server

cast(Obj, Request)

Make a cast to a wx_object server. Invokes handle_cast(Request, State) in the server

check_response(Msg, Key)

Check if a received message was a reply to a RequestId

get_pid(Obj)

Get the pid of the object handle.

reply(PidTag, Reply)

Get the pid of the object handle.

send_request(Obj, Request)

Make an send_request to a generic server. and return a RequestId which can/should be used with wait_response/[1|2]. Invokes handle_call(Request, From, State) in server.

set_pid(Obj, Pid)

Sets the controlling process of the object handle.

start(Name, Mod, Args, Options)

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

start_link(Mod, Args, Options)

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

start_link(Name, Mod, Args, Options)

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

stop(Obj)

Stops a generic wx_object server with reason 'normal'. Invokes terminate(Reason,State) in the server. The call waits until the process is terminated. If the process does not exist, an exception is raised.

stop(Obj, Reason, Timeout)

Stops a generic wx_object server with the given Reason. Invokes terminate(Reason,State) in the server. The call waits until the process is terminated. If the call times out, or if the process does not exist, an exception is raised.

wait_response(RequestId)

Wait infinitely for a reply from a generic server.

wait_response(Key, Timeout)

Wait 'timeout' for a reply from a generic server.

Types

event()

(not exported)

-type event() ::
          wxActivateEvent:wxActivate() |
          wxAuiManagerEvent:wxAuiManager() |
          wxAuiNotebookEvent:wxAuiNotebook() |
          wxBookCtrlEvent:wxBookCtrl() |
          wxCalendarEvent:wxCalendar() |
          wxChildFocusEvent:wxChildFocus() |
          wxClipboardTextEvent:wxClipboardText() |
          wxCloseEvent:wxClose() |
          wxColourPickerEvent:wxColourPicker() |
          wxCommandEvent:wxCommand() |
          wxContextMenuEvent:wxContextMenu() |
          wxDateEvent:wxDate() |
          wxDisplayChangedEvent:wxDisplayChanged() |
          wxDropFilesEvent:wxDropFiles() |
          wxEraseEvent:wxErase() |
          wxFileDirPickerEvent:wxFileDirPicker() |
          wxFocusEvent:wxFocus() |
          wxFontPickerEvent:wxFontPicker() |
          wxGridEvent:wxGrid() |
          wxHelpEvent:wxHelp() |
          wxHtmlLinkEvent:wxHtmlLink() |
          wxIconizeEvent:wxIconize() |
          wxIdleEvent:wxIdle() |
          wxInitDialogEvent:wxInitDialog() |
          wxJoystickEvent:wxJoystick() |
          wxKeyEvent:wxKey() |
          wxListEvent:wxList() |
          wxMaximizeEvent:wxMaximize() |
          wxMenuEvent:wxMenu() |
          wxMouseCaptureChangedEvent:wxMouseCaptureChanged() |
          wxMouseCaptureLostEvent:wxMouseCaptureLost() |
          wxMouseEvent:wxMouse() |
          wxMoveEvent:wxMove() |
          wxNavigationKeyEvent:wxNavigationKey() |
          wxPaintEvent:wxPaint() |
          wxPaletteChangedEvent:wxPaletteChanged() |
          wxQueryNewPaletteEvent:wxQueryNewPalette() |
          wxSashEvent:wxSash() |
          wxScrollEvent:wxScroll() |
          wxScrollWinEvent:wxScrollWin() |
          wxSetCursorEvent:wxSetCursor() |
          wxShowEvent:wxShow() |
          wxSizeEvent:wxSize() |
          wxSpinEvent:wxSpin() |
          wxSplitterEvent:wxSplitter() |
          wxStyledTextEvent:wxStyledText() |
          wxSysColourChangedEvent:wxSysColourChanged() |
          wxTaskBarIconEvent:wxTaskBarIcon() |
          wxTreeEvent:wxTree() |
          wxUpdateUIEvent:wxUpdateUI() |
          wxWebViewEvent:wxWebView() |
          wxWindowCreateEvent:wxWindowCreate() |
          wxWindowDestroyEvent:wxWindowDestroy().

request_id()

(not exported)

-type request_id() :: term().

server_ref()

(not exported)

-type server_ref() :: Obj :: wx:wx_object() | atom() | pid().

Callbacks

code_change(OldVsn, State, Extra)

(optional)

-callback code_change(OldVsn :: term() | {down, term()}, State :: term(), Extra :: term()) ->
                         {ok, NewState :: term()} | {error, Reason :: term()}.

handle_call(Request, From, State)

(optional)

-callback handle_call(Request :: term(), From :: {pid(), Tag :: term()}, State :: term()) ->
                         {reply, Reply :: term(), NewState :: term()} |
                         {reply, Reply :: term(), NewState :: term(), timeout() | hibernate} |
                         {noreply, NewState :: term()} |
                         {noreply, NewState :: term(), timeout() | hibernate} |
                         {stop, Reason :: term(), Reply :: term(), NewState :: term()} |
                         {stop, Reason :: term(), NewState :: term()}.

handle_cast(Request, State)

(optional)

-callback handle_cast(Request :: term(), State :: term()) ->
                         {noreply, NewState :: term()} |
                         {noreply, NewState :: term(), timeout() | hibernate} |
                         {stop, Reason :: term(), NewState :: term()}.

handle_event(Request, State)

-callback handle_event(Request ::
                           #wx{id :: integer(), obj :: wx:wx_object(), userData :: term(), event :: event()},
                       State :: term()) ->
                          {noreply, NewState :: term()} |
                          {noreply, NewState :: term(), timeout() | hibernate} |
                          {stop, Reason :: term(), NewState :: term()}.

handle_info(Info, State)

(optional)

-callback handle_info(Info :: timeout() | term(), State :: term()) ->
                         {noreply, NewState :: term()} |
                         {noreply, NewState :: term(), timeout() | hibernate} |
                         {stop, Reason :: term(), NewState :: term()}.

handle_sync_event(Request, Ref, State)

(optional)

-callback handle_sync_event(Request ::
                                #wx{id :: integer(),
                                    obj :: wx:wx_object(),
                                    userData :: term(),
                                    event :: event()},
                            Ref :: #wx_ref{ref :: term(), type :: term(), state :: term()},
                            State :: term()) ->
                               ok.

init(Args)

-callback init(Args :: term()) ->
                  {#wx_ref{ref :: term(), type :: term(), state :: term()}, State :: term()} |
                  {#wx_ref{ref :: term(), type :: term(), state :: term()},
                   State :: term(),
                   timeout() | hibernate} |
                  {stop, Reason :: term()} |
                  ignore.

terminate(Reason, State)

(optional)

-callback terminate(Reason :: normal | shutdown | {shutdown, term()} | term(), State :: term()) -> term().

Functions

call(Obj, Request)

-spec call(Obj, Request) -> term() when Obj :: wx:wx_object() | atom() | pid(), Request :: term().

Make a call to a wx_object server. The call waits until it gets a result. Invokes handle_call(Request, From, State) in the server

call(Obj, Request, Timeout)

-spec call(Obj, Request, Timeout) -> term()
              when Obj :: wx:wx_object() | atom() | pid(), Request :: term(), Timeout :: integer().

Make a call to a wx_object server with a timeout. Invokes handle_call(Request, From, State) in server

cast(Obj, Request)

-spec cast(Obj, Request) -> ok when Obj :: wx:wx_object() | atom() | pid(), Request :: term().

Make a cast to a wx_object server. Invokes handle_cast(Request, State) in the server

check_response(Msg, Key)

-spec check_response(Msg :: term(), Key :: request_id()) ->
                        {reply, Reply :: term()} | false | {error, {term(), server_ref()}}.

Check if a received message was a reply to a RequestId

get_pid(Obj)

-spec get_pid(Obj) -> pid() when Obj :: wx:wx_object() | atom() | pid().

Get the pid of the object handle.

reply(PidTag, Reply)

-spec reply({pid(), Tag :: term()}, Reply :: term()) -> pid().

Get the pid of the object handle.

send_request(Obj, Request)

-spec send_request(Obj, Request :: term()) -> request_id() when Obj :: wx:wx_object() | atom() | pid().

Make an send_request to a generic server. and return a RequestId which can/should be used with wait_response/[1|2]. Invokes handle_call(Request, From, State) in server.

set_pid(Obj, Pid)

-spec set_pid(Obj, Pid :: pid()) -> wx:wx_object() when Obj :: wx:wx_object() | atom() | pid().

Sets the controlling process of the object handle.

start(Name, Mod, Args, Options)

-spec start(Name, Mod, Args, Options) -> wxWindow:wxWindow() | {error, term()}
               when
                   Name :: {local, atom()},
                   Mod :: atom(),
                   Args :: term(),
                   Flag :: trace | log | {logfile, string()} | statistics | debug,
                   Options :: [{timeout, timeout()} | {debug, [Flag]}].

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

start_link(Mod, Args, Options)

-spec start_link(Mod, Args, Options) -> wxWindow:wxWindow() | {error, term()}
                    when
                        Mod :: atom(),
                        Args :: term(),
                        Flag :: trace | log | {logfile, string()} | statistics | debug,
                        Options :: [{timeout, timeout()} | {debug, [Flag]}].

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

start_link(Name, Mod, Args, Options)

-spec start_link(Name, Mod, Args, Options) -> wxWindow:wxWindow() | {error, term()}
                    when
                        Name :: {local, atom()},
                        Mod :: atom(),
                        Args :: term(),
                        Flag :: trace | log | {logfile, string()} | statistics | debug,
                        Options :: [{timeout, timeout()} | {debug, [Flag]}].

Starts a generic wx_object server and invokes Mod:init(Args) in the new process.

stop(Obj)

-spec stop(Obj) -> ok when Obj :: wx:wx_object() | atom() | pid().

Stops a generic wx_object server with reason 'normal'. Invokes terminate(Reason,State) in the server. The call waits until the process is terminated. If the process does not exist, an exception is raised.

stop(Obj, Reason, Timeout)

-spec stop(Obj, Reason, Timeout) -> ok
              when Obj :: wx:wx_object() | atom() | pid(), Reason :: term(), Timeout :: timeout().

Stops a generic wx_object server with the given Reason. Invokes terminate(Reason,State) in the server. The call waits until the process is terminated. If the call times out, or if the process does not exist, an exception is raised.

wait_response(RequestId)

-spec wait_response(RequestId :: request_id()) ->
                       {reply, Reply :: term()} | {error, {term(), server_ref()}}.

Wait infinitely for a reply from a generic server.

wait_response(Key, Timeout)

-spec wait_response(Key :: request_id(), Timeout :: timeout()) ->
                       {reply, Reply :: term()} | timeout | {error, {term(), server_ref()}}.

Wait 'timeout' for a reply from a generic server.