Initial release

This commit is contained in:
civ
2026-08-16 18:24:52 +07:00
commit 876886a39a
13244 changed files with 2353959 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
/**
@mainpage
Welcome to VSTGUI
- @ref intro @n
- @ref page_news_and_changes @n
- @ref page_uidescription_editor @n
- @ref page_license @n
@section intro Introduction
\par VSTGUI
VSTGUI is a User Interface Toolkit mainly for Audio Plug-Ins (VST, AudioUnit, etc).
\par History
First developed inhouse of Steinberg Media Technologies (around 1998) for their first VST Plug-Ins.
Later added as binary libraries to the official VST SDK.
Since May 2003 VSTGUI is open source, was hosted at sourceforge and now at [GitHub](https://github.com/steinbergmedia/vstgui).
Currently VSTGUI compiles on
\par Microsoft Windows (with Visual Studio 2015/2017/2019 and Windows 7 Platform SDK)
- 7 (32 and 64 bit)
- 8 (32 and 64 bit)
- 10 (32 and 64 bit)
\par Apple macOS (with Xcode 7.3 or newer)
- 10.9 - 10.15 (32 and 64 bit)
\par Apple iOS
- 8.0 - 13.0 (32 and 64 bit)
\par Linux (with gcc >= 5.4 or clang >= 3.8)
- Ubuntu 2016.04 or newer
\sa [VSTGUI @ GitHub](https://github.com/steinbergmedia/vstgui)
@page page_setup Setup
\par To include VSTGUI in your projects you only have to add
- vstgui_win32.cpp (for Windows)
- vstgui_linux.cpp (for Linux)
- vstgui_mac.mm (for macOS)
- vstgui_ios.mm (for iOS)
to your IDE project and add a search path to the parent of the root folder of vstgui.
\par On macOS, you need to link to the following Frameworks:
- Accelerate
- Cocoa
- QuartzCore
- OpenGL (Optional)
\par On iOS, you need to link to the following Frameworks:
- UIKit
- CoreGraphics
- ImageIO
- CoreText
- GLKit
- Accelerate
- QuartzCore
\par On Linux you have to install xcb, freetype, fontconfig and cairo
Debian/Ubuntu based distribution:
- libx11-dev
- libx11-xcb-dev
- libxcb-util-dev
- libxcb-cursor-dev
- libxcb-keysyms1-dev
- libxcb-xkb-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- libfontconfig1-dev
- libcairo2-dev
- libfreetype6-dev
- libpango1.0-dev
*/
@@ -0,0 +1,836 @@
/* The standard CSS for doxygen */
body, table, div, p, dl {
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 12px;
}
/* @group Heading Levels */
h1 {
font-size: 150%;
}
.title {
font-size: 150%;
font-weight: bold;
margin: 10px 2px;
}
h2 {
font-size: 120%;
}
h3 {
font-size: 100%;
}
dt {
font-weight: bold;
}
div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
}
p.startli, p.startdd, p.starttd {
margin-top: 2px;
}
p.endli {
margin-bottom: 0px;
}
p.enddd {
margin-bottom: 4px;
}
p.endtd {
margin-bottom: 2px;
}
/* @end */
caption {
font-weight: bold;
}
span.legend {
font-size: 70%;
text-align: center;
}
h3.version {
font-size: 90%;
text-align: center;
}
div.qindex, div.navtab{
background-color: #E7EEF4;
border: 1px solid #91B0CE;
text-align: center;
margin: 2px;
padding: 2px;
}
div.qindex, div.navpath {
width: 100%;
line-height: 140%;
}
div.navtab {
margin-right: 15px;
}
/* @group Link Styling */
a {
color: #30506F;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
color: #3A6085;
}
a:hover {
text-decoration: underline;
}
a.qindex {
font-weight: bold;
}
a.qindexHL {
font-weight: bold;
background-color: #88AACB;
color: #ffffff;
border: 1px double #6F98C0;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.el {
font-weight: bold;
}
a.elRef {
}
a.code {
color: #3A6085;
}
a.codeRef {
color: #3A6085;
}
/* @end */
dl.el {
margin-left: -1cm;
}
.fragment {
font-family: monospace, fixed;
font-size: 105%;
}
pre.fragment {
border: 1px solid #B8CCE0;
background-color: #FAFCFD;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 9pt;
line-height: 125%;
}
div.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
border: solid thin #333;
border-radius: 0.5em;
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
box-shadow: 2px 2px 3px #999;
-webkit-box-shadow: 2px 2px 3px #999;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
body {
background: white;
color: black;
margin: 0;
}
div.contents {
margin-top: 10px;
margin-left: 10px;
margin-right: 5px;
}
td.indexkey {
background-color: #E7EEF4;
font-weight: bold;
border: 1px solid #B8CCE0;
margin: 2px 0px 2px 0;
padding: 2px 10px;
}
td.indexvalue {
background-color: #E7EEF4;
border: 1px solid #B8CCE0;
padding: 2px 10px;
margin: 2px 0px;
}
tr.memlist {
background-color: #EAF0F5;
}
p.formulaDsp {
text-align: center;
}
img.formulaDsp {
}
img.formulaInl {
vertical-align: middle;
}
div.center {
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
padding: 0px;
}
div.center img {
border: 0px;
}
address.footer {
text-align: right;
padding-right: 12px;
}
img.footer {
border: 0px;
vertical-align: middle;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
/* @end */
/*
.search {
color: #003399;
font-weight: bold;
}
form.search {
margin-bottom: 0px;
margin-top: 0px;
}
input.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
*/
td.tiny {
font-size: 75%;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #91B0CE;
}
th.dirtab {
background: #E7EEF4;
font-weight: bold;
}
hr {
height: 0px;
border: none;
border-top: 1px solid #3E668E;
}
hr.footer {
height: 1px;
}
/* @group Member Descriptions */
table.memberdecls {
border-spacing: 0px;
padding: 0px;
}
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
background-color: #F8FAFB;
border: none;
margin: 4px;
padding: 1px 0 0 8px;
}
.mdescLeft, .mdescRight {
padding: 0px 8px 4px 8px;
color: #555;
}
.memItemLeft, .memItemRight, .memTemplParams {
border-top: 1px solid #B8CCE0;
}
.memItemLeft, .memTemplItemLeft {
white-space: nowrap;
}
.memItemRight {
width: 100%;
}
.memTemplParams {
color: #3A6085;
white-space: nowrap;
}
/* @end */
/* @group Member Details */
/* Styles for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #3A6085;
font-weight: normal;
margin-left: 9px;
}
.memnav {
background-color: #E7EEF4;
border: 1px solid #91B0CE;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.mempage {
width: 100%;
}
.memitem {
padding: 0;
margin-bottom: 10px;
margin-right: 5px;
}
.memname {
white-space: nowrap;
font-weight: bold;
margin-left: 6px;
}
.memproto {
border-top: 1px solid #96B4D1;
border-left: 1px solid #96B4D1;
border-right: 1px solid #96B4D1;
padding: 6px 0px 6px 0px;
color: #1A2B3B;
font-weight: bold;
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
/* opera specific markup */
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
border-top-right-radius: 8px;
border-top-left-radius: 8px;
/* firefox specific markup */
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
-moz-border-radius-topright: 8px;
-moz-border-radius-topleft: 8px;
/* webkit specific markup */
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-webkit-border-top-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
background-image:url('nav_f.png');
background-repeat:repeat-x;
background-color: #DCE6EF;
}
.memdoc {
border-bottom: 1px solid #96B4D1;
border-left: 1px solid #96B4D1;
border-right: 1px solid #96B4D1;
padding: 2px 5px;
background-color: #FAFCFD;
border-top-width: 0;
/* opera specific markup */
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
/* firefox specific markup */
-moz-border-radius-bottomleft: 8px;
-moz-border-radius-bottomright: 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F5F8FA 95%, #EAF0F5);
/* webkit specific markup */
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F5F8FA), to(#EAF0F5));
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
white-space: nowrap;
}
.paramname em {
font-style: normal;
}
.params, .retval, .exception, .tparams {
border-spacing: 6px 2px;
}
.params .paramname, .retval .paramname {
font-weight: bold;
vertical-align: top;
}
.params .paramtype {
font-style: italic;
vertical-align: top;
}
.params .paramdir {
font-family: "courier new",courier,monospace;
vertical-align: top;
}
/* @end */
/* @group Directory (tree) */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin: 0px;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
margin: 5px;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/*
The following two styles can be used to replace the root node title
with an image of your choice. Simply uncomment the next two styles,
specify the name of your image and be sure to set 'height' to the
proper pixel height of your image.
*/
/*
.directory h3.swap {
height: 61px;
background-repeat: no-repeat;
background-image: url("yourimage.gif");
}
.directory h3.swap span {
display: none;
}
*/
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}
/* @end */
div.dynheader {
margin-top: 8px;
}
address {
font-style: normal;
color: #1F3347;
}
table.doxtable {
border-collapse:collapse;
}
table.doxtable td, table.doxtable th {
border: 1px solid #21374C;
padding: 3px 7px 2px;
}
table.doxtable th {
background-color: #2B4762;
color: #FFFFFF;
font-size: 110%;
padding-bottom: 4px;
padding-top: 5px;
text-align:left;
}
.tabsearch {
top: 0px;
left: 10px;
height: 36px;
background-image: url('tab_b.png');
z-index: 101;
overflow: hidden;
font-size: 13px;
}
.navpath ul
{
font-size: 11px;
background-image:url('tab_b.png');
background-repeat:repeat-x;
height:30px;
line-height:30px;
color:#739BC2;
border:solid 1px #B5CADE;
overflow:hidden;
margin:0px;
padding:0px;
}
.navpath li
{
list-style-type:none;
float:left;
padding-left:10px;
padding-right:15px;
background-image:url('bc_s.png');
background-repeat:no-repeat;
background-position:right;
color:#294560;
}
.navpath li.navelem a
{
height:32px;
display:block;
text-decoration: none;
outline: none;
}
.navpath li.navelem a:hover
{
color:#4E80B1;
}
.navpath li.footer
{
list-style-type:none;
float:right;
padding-left:10px;
padding-right:15px;
background-image:none;
background-repeat:no-repeat;
background-position:right;
color:#294560;
font-size: 8pt;
}
div.summary
{
float: right;
font-size: 8pt;
padding-right: 5px;
width: 50%;
text-align: right;
}
div.summary a
{
white-space: nowrap;
}
div.ingroups
{
font-size: 8pt;
padding-left: 5px;
width: 50%;
text-align: left;
}
div.ingroups a
{
white-space: nowrap;
}
div.header
{
background-image:url('nav_h.png');
background-repeat:repeat-x;
background-color: #F8FAFB;
margin: 0px;
border-bottom: 1px solid #B8CCE0;
}
div.headertitle
{
padding: 5px 5px 5px 10px;
}
dl
{
padding: 0 0 0 10px;
}
dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
{
border-left:4px solid;
padding: 0 0 0 6px;
}
dl.note
{
border-color: #D0C000;
}
dl.warning, dl.attention
{
border-color: #FF0000;
}
dl.pre, dl.post, dl.invariant
{
border-color: #00D000;
}
dl.deprecated
{
border-color: #505050;
}
dl.todo
{
border-color: #00C0E0;
}
dl.test
{
border-color: #3030E0;
}
dl.bug
{
border-color: #C08050;
}
#projectlogo
{
text-align: center;
vertical-align: bottom;
border-collapse: separate;
}
#projectlogo img
{
border: 0px none;
}
#projectname
{
font: 250% Tahoma, Arial,sans-serif;
margin: 0px;
padding: 0px;
}
#projectbrief
{
font: 80% Tahoma, Arial,sans-serif;
margin: 0px;
margin-bottom: 3px;
padding: 0px;
}
#projectnumber
{
font: 50% Tahoma, Arial,sans-serif;
margin: 0px;
padding: 0px;
}
#titlearea
{
padding: 0px;
margin: 0px;
width: 100%;
border-bottom: 1px solid #44709B;
}
.image
{
text-align: center;
}
.dotgraph
{
text-align: center;
}
.mscgraph
{
text-align: center;
}
.caption
{
font-weight: bold;
}
@@ -0,0 +1,12 @@
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
/**
@page page_changelog Changelog
For newer changes please see the git log.
@include Changelog
*/
@@ -0,0 +1,457 @@
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
/**
@page page_news_and_changes New stuff in VSTGUI 4
@tableofcontents
- @ref version4_introduction @n
- @ref new_stuff @n
- @ref code_changes @n
- @ref hidpi_support @n
- @ref ios_support @n
- @subpage page_previous_new_stuff
@section version4_introduction Introduction
Version 4 of VSTGUI is a new milestone release with a restructured code base with the focus of code conformity and easier future enhancements.
The result is that code written for any earlier version of VSTGUI is not always compatible.
It's recommended to start new projects with version 4 while old projects should stay with version 3.6.
@section new_stuff New Stuff
@subsection version4_15 Version 4.15
- add support for custom view layouts (see IViewLayouter and CViewContainer::setViewLayouter).
- add a grid view layouter that is similar to CSS Grid (see GridLayouter).
- add Scripting for UIDescription (see uidescription-scripting/uiscripting.md)
- add new text editor view (see lib/ctexteditor.h)
- a scroll view can now have a top and a left edge view (see CScrollView::setEdgeView)
- preliminary Wayland support
@subsection version4_14 Version 4.14
- add crosshair mouse cursor (kCursorCrosshair)
- customizable knob range (see CKnob::setKnobRange)
- new layouts for CRowColumnView
@subsection version4_13 Version 4.13
- support embedding platform views (HWND & NSView) as sub views (see CExternalView and ExternalView::IView) and examples in the contrib folder.
@subsection version4_12_2 Version 4.12.2
- make it possible to draw only frames in a range for views using multi frame bitmaps.
@subsection version4_12_1 Version 4.12.1
- make it possible to use the new multi frame bitmap feature with custom value to frame index mappings by subclassing.
@subsection version4_12 Version 4.12
- new multi frame bitmap representation that allows to support more frames per bitmap on current
hardware by supporting to layout the frames in the bitmap by rows and multiple columns instead of
one column as before. See VSTGUI::CMultiFrameBitmap. All included controls are updated to support
it, while the old method is deprecated but still supported for now.
- the image stitcher tool was updated to support the creation of multi row/column frames bitmap
@subsection version4_11 Version 4.11
- Using DirectComposition on Windows now with support for CLayeredViewContainer
- Removed 32-bit Carbon support
- Reworked event handling, please see @ref code_changes_4_10_to_4_11
- Reworked unit test framework to be able to debug the tests
@subsection version4_10 Version 4.10
- VSTGUI now needs to be initialized and terminated explicitly. See VSTGUI::init() and VSTGUI::exit().
- UIDescription files are now written in JSON format and the old XML format is deprecated
- It's now possible to conditionally remove the XML parser and the expat library from building (set VSTGUI_ENABLE_XML_PARSER to 0)
- This is the last version not depending on c++17 compiler support.
@subsection version4_9 Version 4.9
- new control: VSTGUI::CListControl in play with VSTGUI::CStringList
- custom font support: VSTGUI now supports using fonts embedded in its Bundle/Package at Resources/Fonts. Note that this works on Windows only when building with the Windows 10 SDK and it does also only work on Windows 10. There's no such restriction on macOS or Linux.
@subsection version4_8 Version 4.8
- new VSTGUI::CSegmentButton selection mode \link VSTGUI::CSegmentButton::SelectionMode::kSingleToggle kSingleToggle\endlink and styles \link VSTGUI::CSegmentButton::Style::kHorizontalInverse kHorizontalInverse\endlink and \link VSTGUI::CSegmentButton::Style::kVerticalInverse kVerticalInverse\endlink.
@subsection version4_7 Version 4.7
- redesigned drag'n drop
- drags with bitmaps are now supported on Windows
- standalone library support for Windows 7
- new ImageStitcher tool
- the GDI+ draw backend was removed, the Direct2D backend is the replacement
@subsection version4_6 Version 4.6
- new Control: VSTGUI::KeyboardView
- cmake cleanup
- fix static object initialization order
- fix build warnings/errors depending on macOS SDK use
- remove warnings
@subsection version4_5 Version 4.5
- cmake build system
- preview of @ref standalone_library @n
- new Controls: VSTGUI::CMultiLineTextLabel, VSTGUI::CSearchTextEdit
- adopt many c++11 language features
@subsection version4_4 Version 4.4
- preview Linux version
- support for Windows XP, Mac OS X 10.6 and non c++11 mode will be removed with version 4.5
@subsection version4_3 Version 4.3
- last version to support Windows XP, Mac OS X 10.6 and non c++11 mode
- HiDPI support (aka Retina support) for Quartz2D and Direct2D backends
- support for creating a graphics path from a string
- new Control : VSTGUI::CSegmentButton
- add support for adding a custom view to the split view separator
- transformation matrix support in VSTGUI::CDrawContext
- alternative c++11 callback functions for VSTGUI::CFileSelector::run(), VSTGUI::CVSTGUITimer, VSTGUI::CParamDisplay::setValueToStringFunction, VSTGUI::CTextEdit::setStringToValueFunction and VSTGUI::CCommandMenuItem::setActions
Note: All current deprecated methods will be removed in the next version. So make sure that your code compiles with VSTGUI_ENABLE_DEPRECATED_METHODS=0
@subsection version4_2 Version 4.2
- iOS Support with Multi Touch handling. See @ref ios_support
- support drawing an icon on a VSTGUI::CTextButton
- VSTGUI::CGradientView
- VSTGUI::CDataBrowser now supports multi row selections
- support compiling in c++11 mode with clang and visual studio
- VSTGUI_OVERRIDE_VMETHOD is now used throughout the vstgui sources to indicate methods which are expecting to override a virtual method of its base classes. (c++11 only)
@subsection version4_1 Version 4.1
- @ref page_uidescription_editor @n
- VSTGUI::COpenGLView (only Windows & Mac Cocoa)
- VSTGUI::CRowColumnView
- VSTGUI::CShadowViewContainer
- VSTGUI::BitmapFilter
- More @link VSTGUI::CScrollView::CScrollViewStyle VSTGUI::CScrollView styles @endlink
@subsection version4_0 Version 4.0
- VST3 Support : Complete inline VST3 Editor support. See @ref page_uidescription_editor @n
- UIDescription : Building user interfaces via XML description files. See @ref uidescription @n
- Animation Support : Simple to use animations. See @ref page_animation
- Amalgamation : Easy integration in your projects via one or two source files
- Cleaned Code : Removed all deprecated methods and classes, splittet individual classes into different files
- Platform Abstraction : Platform dependent code was refactored and moved into its own files
- New notable classes : VSTGUI::CCheckBox, VSTGUI::CGraphicsPath, VSTGUI::CNinePartTiledBitmap, VSTGUI::IFocusDrawing
- Direct2D drawing on Windows (Windows Vista or Windows 7)
@section code_changes Changes for existing VSTGUI code
@subsection code_changes_4_13_to_4_14 VSTGUI 4.13 -> VSTGUI 4.14
- In CParamDisplay::drawPlatformText(..) the string argument changed from IPlatformString to UTF8Text
@subsection code_changes_4_12_to_4_13 VSTGUI 4.12 -> VSTGUI 4.13
- the context argument of IFontPainter has changed to use the new platform graphics device context
@subsection code_changes_4_11_to_4_12 VSTGUI 4.11 -> VSTGUI 4.12
- The CMultiFrameBitmap change deprecated the VSTGUI::IMultiBitmapControl class. If you use it,
update your uses and use a VSTGUI::CMultiFrameBitmap instead.
- If you compile with VSTGUI_ENABLE_DEPRECATED_METHODS=0 you need to update your multi frame bitmaps
to use VSTGUI::CMultiFrameBitmap.
- In 4.12.2 the following constructors have lost their offset parameter:
- CKickButton
- CAnimKnob
- CMovieBitmap
- CMovieButton
- CSwitchBase
- CVerticalSwitch
- CHorizontalSwitch
- CRockerSwitch
@subsection code_changes_4_10_to_4_11 VSTGUI 4.10 -> VSTGUI 4.11
Changes due to event handling rework:
- IKeyboardHook changed its methods. If you inherit from it, you need to adopt to the new methods or use OldKeyboardHookAdapter
- IMouseObserver changed a few of its methods. If you inherit from it, you need to adopt to the new methods or use OldMouseObserverAdapter
- CViewContainer::onWheel is now marked final, you cannot inherit this method, please override the new CView::onMouseWheelEvent instead if you need to handle mouse wheel events in a custom view container
- DragEventData has changed it's modifiers type from CButtonState to Modifiers
- CView::hitTest uses an Event now instead of a CButtonState (the method with a CButtonState still works but is deprecated)
- CControl::checkDefaultValue(CButtonState) was removed and replaced by a generic method which uses
the static function CControl::CheckDefaultValueEventFunc to reset a control to its default value
CView has the following new methods:
- dispatchEvent
- onMouseDownEvent
- onMouseMoveEvent
- onMouseUpEvent
- onMouseCancelEvent
- onMouseEnterEvent
- onMouseExitEvent
- onMouseWheelEvent
- onZoomGestureEvent
- onKeyboardEvent
Which replaces the following old methods:
- onKeyDown
- onKeyUp
- onWheel
The old mouse methods (onMouseDown, onMouseUp, onMouseMoved, etc) are still supported but should be replaced with the new methods in the long run.
@subsection code_changes_4_9_to_4_10 VSTGUI 4.9 -> VSTGUI 4.10
- one has to use VSTGUI::init() before using VSTGUI and VSTGUI::exit() after use
@subsection code_changes_4_8_to_4_9 VSTGUI 4.8 -> VSTGUI 4.9
- removed method CView::onWheel (..) where the axis of the event was not included. You have to use the other onWheel method for your custom classes now.
- new IViewMouseListener interface method IViewMouseListener::viewOnMouseEnabled
- changed ModalViewSession type name to ModalViewSessionID and its type to an integer type
- changed the CFrame::beginModalViewSession return value to be an Optional<ModalViewSessionID> for safer use.
@subsection code_changes_4_7_to_4_8 VSTGUI 4.7 -> VSTGUI 4.8
- CCommandMenuItem constructor takes a CCommandMenuItem::Desc argument now. You will get compiler errors when not adopting to this change.
- removed Message sending for:
- kMsgMenuItemValidate, kMsgMenuItemSelected -> use ICommandMenuItemTarget
- kMessageValueChanged, kMessageBeginEdit, kMessageEndEdit -> use IControlListener
- kMsgTruncatedTextChanged -> use ITextLabelListener
- kMsgBeforePopup -> use IOptionMenuListener
- IDependency is deprecated. Please use explicit interfaces for communicating changes.
- removed "using namespace VSTGUI" from vstgui.h
@subsection code_changes_4_6_to_4_7 VSTGUI 4.6 -> VSTGUI 4.7
- CView::doDrag is deprecated, instead use the asynchronous variant of it : CView::doDrag ;-)
- CView don't has drop target methods (onDragEnter, onDragLeave, onDragMove and onDrop) anymore. Instead it has a method to return a drop target. See the documentation for IDropTarget on how to use it.
- the CControlEnum is gone and is moved into the classes where they are used: CParamDisplay/COptionMenu/CTextEdit/CSlider
- CControl::kMessageTagWillChange and CControl::kMessageTagDidChange is gone, use IControlListener instead
- COptionMenu::popup has changed behaviour and got a callback function that will be called when the popup is closed. The return of COptionMenu::popup now only indicates if the popup was shown.
- IDataBrowserDelegate is now a real virtual interface class, use DataBrowserDelegateAdapter instead if you get compile/linker errors.
- renamed the following interface adapter classes :
- IViewListenerAdapter -> ViewListenerAdapter
- IViewContainerListenerAdapter -> ViewContainerListenerAdapter
- IViewMouseListenerAdapter -> ViewMouseListenerAdapter
- IGenericStringListDataBrowserSourceSelectionChanged -> GenericStringListDataBrowserSourceSelectionChanged
@subsection code_changes_4_3_to_4_5 VSTGUI 4.3 -> VSTGUI 4.5
- COffscreenContext::create returns a SharedPointer<COffscreenContext> now, not a naked pointer.
@subsection code_changes_4_2_to_4_3 VSTGUI 4.2 -> VSTGUI 4.3
- CControlListener was renamed to IControlListener and moved into the VSTGUI namespace and its own header file. A typedef for CControlListener is available but marked as deprecated.
- the VSTGUI::CDrawContext::drawString methods don't set the clip to rect by itself anymore. If you call this method in your code, you need to set the clip yourself now.
- the interfaces for VSTGUI::IController and VSTGUI::IViewCreator have changed and if you have inherited from them you need to change your implementations accordingly.
- the enum DragResult was moved out of CView into VSTGUI namespace
- VSTGUI::CGradient can now be created without a VSTGUI::CDrawContext object
- VSTGUI::CGradientView takes now a VSTGUI::CGradient. Setting the gradient colors and start offsets are removed.
- VSTGUI::CTextButton takes now VSTGUI::CGradient objects instead of colors and start offsets.
- method signature change for: VSTGUI::CViewContainer::getViewAt, VSTGUI::CViewContainer::getViewsAt, VSTGUI::CViewContainer::getContainerAt
- Some methods changed its arguments or return types from a signed type to an unsigned type, check your overrides !
@subsection code_changes_4_1_to_4_2 VSTGUI 4.1 -> VSTGUI 4.2
- the class CDragContainer is replaced by IDataPackage. The class CDragContainerHelper is a helper class you can use to quickly get your code up and running again.
- the class IDataBrowser is renamed to IDataBrowserDelegate and the drag and drop methods have changed
- CView::getVisibleSize () was renamed to CView::getVisibleViewSize ()
@subsection code_changes_4_0_to_4_1 VSTGUI 4.0 -> VSTGUI 4.1
- the pBackground member of CView is now private. You must replace all read access with getDrawBackground () or getBackground () and all write access with setBackground ()
@subsection code_changes_3_6_to_4_0 VSTGUI 3.6 -> VSTGUI 4.0
- the variable types were changed to use C99 style types (int32_t, etc), you must do this for all your derivated VSTGUI classes too
- the buttons parameter has changed from long to CButtonState
- your custom views need to use the new mouse methods
- COptionMenuScheme is not available anymore
- VSTGUI::CFileSelector is gone, you have to use VSTGUI::CNewFileSelector
- VST extensions previously enabled via ENABLE_VST_EXTENSION_IN_VSTGUI is gone without replacement
- VSTGUI::CBitmap was completely changed and does not use a transparency color anymore, you need to use the alpha channel of a bitmap to get the same results
- VSTGUI::COffscreenContext is handled completely different. But in most cases you can simply remove all offscreens where you needed them to reduce flicker.
- On Windows graphics are entirely drawn with GDI+ or Direct2D (when available), GDI is not used anymore
- The internal string encoding is now always UTF-8
- The VSTGUI::CCoord type is now always a double
- on Mac OS X, embedding a CFrame into a non composited carbon window is not supported anymore
- on Mac OS X, when targeting Mac OS X 10.4 some of the graphics path methods are not implemented.
- Method signature changes which don't lead to compile errors:
- CView::setViewSize (CRect& rect, bool invalid = true)
- CView::hitTest (const CPoint& where, CButtonState& buttons = -1)
- CView::invalidRect (CRect& rect)
- CViewContainer::drawBackgroundRect (CDrawContext* pContext, CRect& _updateRect)
- CViewContainer::addView (CView* pView, CRect& mouseableArea, bool mouseEnabled = true)
@section hidpi_support HiDPI notes
- HiDPI is supported on OSX, iOS and Windows (with Direct2D backend)
- Due to platform differences one need to call frame->setZoom (scaleFactor) on Windows, while on OSX and iOS this is not needed.
@section ios_support iOS support notes
- VSTGUI supports iOS 7 and later
- Currently COptionMenu, CScrollView and COpenGLView are not supported
- Support for a single MultiTouch View is not yet tested and the API may change in the future
@page page_previous_new_stuff New Stuff in VSTGUI 3.6 and earlier
@section new_mouse_methods New mouse methods
In earlier versions there were only one method in CView for handling mouse events (VSTGUI::CView::mouse).
In this version there are five new methods :
- VSTGUI::CView::onMouseDown (new in 3.5)
- VSTGUI::CView::onMouseUp (new in 3.5)
- VSTGUI::CView::onMouseMoved (new in 3.5)
- VSTGUI::CView::onMouseEntered (new in 3.5)
- VSTGUI::CView::onMouseExited (new in 3.5)
For convenience the old method is still working, but should be replaced with the ones above.
@section other_new_things Other new things
- VSTGUI::CDataBrowser (new in 3.5)
- VSTGUI::CScrollView (new in 3.0)
- VSTGUI::CTabView (new in 3.0)
- Mac OS X 64 bit support via Cocoa. (new in 3.6)
- New Fileselector class : VSTGUI::CNewFileSelector (new in 3.6)
- VSTGUI::COptionMenu refactored. Supports icons for menu items. (new in 3.6)
- View autoresizing support. (new in 3.6)
- Bitmaps can be loaded either by number or by name (see VSTGUI::CBitmap) (new in 3.5)
- VSTGUI::CTooltipSupport (new in 3.5)
- VSTGUI::CVSTGUITimer (new in 3.5)
- System event driven drawing (new in 3.5)
- Unicode support via UTF-8 (new in 3.5)
- New font implementation (new in 3.5)
- Windows GDI+ support (new in 3.5)
- Mac OS X Composited Window support (new in 3.0)
@section about_deprecation About deprecation in version 3.6
With VSTGUI 3.6 the VSTGUI_ENABLE_DEPRECATED_METHODS macro has changed to be zero per default. You should change your code so that
it compiles without changing the macro. All methods marked this way will be unavailable in the next version.
@section code_changes_for_3_5 Code changes for existing VSTGUI 3.5 code
- COptionMenu was refactored and uses the CMenuItem class for menu items. Item flags are not encoded in the item title anymore.
- CParamDisplay::setTxtFace () and CParamDisplay::getTxtFace () is gone. The text face is already in CFontRef.
- You need to use the new CNewFileSelector class instead of CFileSelector if you want to use it on Mac 64 bit.
@section code_changes_for_3_0 Code changes for existing VSTGUI 3.0 code
- Per default CBitmaps don't get a transparent color on creation. You must call bitmap->setTransparency (color) explicitly. And this may only works once depending on the internal implementation.
- CViewContainer addView and removeView returns a bool value now.
- Mouse methods moved from CDrawContext to CFrame.
- Custom views which override attached and removed must propagate the call to the parent.
- VST specific code is enclosed with the macro ENABLE_VST_EXTENSION_IN_VSTGUI, which per default is set to zero. If you need them you must enable it (best practice is to set it in the prefix header or the preprocessor panel in your compiler).
- Removed all CDrawContext parameters from CView methods except for draw and drawRect. You need to change this in your custom views and controls.
- Every usage of CFont must be changed to CFontRef.
- When using GDI+ or libpng on Windows there is no need in using any offscreen context for flicker reduction as VSTGUI uses a backbuffer for drawing.
- Custom controls must implement the CLASS_METHODS macro if it directly inherits from CControl. Otherwise you will get a compile error.
- Custom controls which don't implement the new mouse methods must override onMouseDown and return kMouseEventNotHandled so that the old mouse method is called.
@subsection cviewchanges CView method changes
For custom views you need to change the following methods because their parameters changed:
- onWheel
- onDrop
- onDragEnter
- onDragLeave
- onDragMove
- takeFocus
- looseFocus
- setViewSize
@subsection aeffguieditorchanges AEffGUIEditor method changes
- valueChanged
@section code_changes_for_2_3 Code changes for existing VSTGUI 2.3 code
please see the "Migrating from 2.3.rtf" file in the Documentation folder.
*/
//------------------------------------------------------------------------
// Doxygen Group Definitions
//------------------------------------------------------------------------
/*! @defgroup new_in New classes
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_0 Version 4.0
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_1 Version 4.1
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_2 Version 4.2
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_3 Version 4.3
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_5 Version 4.5
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_7 Version 4.7
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_9 Version 4.9
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_10 Version 4.10
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_11 Version 4.11
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_12 Version 4.12
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_12_1 Version 4.12.1
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_12_2 Version 4.12.2
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup new_in_4_15 Version 4.15
* @ingroup new_in
*/
//------------------------------------------------------------------------
/*! @defgroup views Views
* @ingroup viewsandcontrols
*/
//------------------------------------------------------------------------
/*! @defgroup controls Controls
* @ingroup views
* @brief Controls are views the user can interact with
*/
//------------------------------------------------------------------------
/*! @defgroup containerviews Container Views
* @ingroup views
*/
//------------------------------------------------------------------------
/*! @defgroup uses_multi_frame_bitmaps Views using Multi-Frame Bitmaps
* \see CMultiFrameBitmap
*/
//------------------------------------------------------------------------
@@ -0,0 +1,179 @@
/**
@page create_your_own_view Create your own view for the WYSIWYG editor in VSTGUI
@section create_your_own_view_intro Introduction
When you want to edit your own VST3 plugin. You can find the need to create your own View.
You can edit your plugin by doing "Right click > Open UIDescription Editor"
![Edit VST3 plugin](screenshots/editVST3.png)
You can find more information about this interface in the documentation : "VSTGUI 4 > VSTGUI > New Inline UI Editor for VST3 (WYSIWYG) > The Editor".
During this tutorial we will make a new view that will appear in the "Views Tab" at the bottom right of the editor and it allow us to drag and drop it inside our VST3 plugin.
@section create_your_own_view_createView Create the new view class
To create a new graphical view you need to create a class that inherites from *CView* or *CControl*. We recommend that you start with the *CControl* class when you plan to have an interactive view, otherwise if it only should display data use *CView*.
Your header file should look like this :
~~~~~~~~~~~~~{.cpp}
#pragma once
#include "vstgui/vstgui.h"
namespace VSTGUI {
class MyControl : public CControl
{
public:
MyControl (const CRect& size );
void draw (CDrawContext *pContext) override;
CLASS_METHODS (MyControl, CControl)
};
} // namespace VSTGUI
~~~~~~~~~~~~~
And your cpp file :
~~~~~~~~~~~~~{.cpp}
#include "MyControl.h"
namespace VSTGUI {
MyControl::MyControl (const CRect& size) : CControl (size) {}
void MyControl::draw (CDrawContext* pContext)
{
// --- setup the background rectangle
pContext->setLineWidth (1);
pContext->setFillColor (CColor (255, 255, 255, 255)); // white background
pContext->setFrameColor (CColor (0, 0, 0, 255)); // black borders
// --- draw the rect filled (with white) and stroked (line around rectangle)
pContext->drawRect (getViewSize (), kDrawFilledAndStroked);
setDirty (false);
}
} // namespace VSTGUI
~~~~~~~~~~~~~
We have two functions, the constructor which only calls the parent constructor and the *draw* function which will define the design of the view. In this example we draw a white rectangle with black borders.
@section create_your_own_view_registerView Register your view
So now you have a basic graphical view. But it will not appear in the list when you edit your plugin.
You need to create a new class, a "factory", that will register your view and create it. This class only needs a cpp file (if you strip dead code in your linker settings, then you need to make sure that this class is not stripped).
Let us begin by creating an empty class that inherites from *'ViewCreatorAdapter'* :
~~~~~~~~~~~~~{.cpp}
#pragma once
#include "vstgui/vstgui.h"
#include "vstgui/vstgui_uidescription.h"
#include "vstgui/uidescription/detail/uiviewcreatorattributes.h"
// Replace this include by the header file of your new view.
#include "MyControl.h"
namespace VSTGUI {
class MyControlFactory : public ViewCreatorAdapter
{
public:
};
} // namespace VSTGUI
~~~~~~~~~~~~~
In the constructor we need to register our view to the UIViewFactory. If we don't do that it will not appear in the list that will allow us to add the view to our VST3 plugin.
~~~~~~~~~~~~~{.cpp}
MyControlFactory () { UIViewFactory::registerViewCreator (*this); }
~~~~~~~~~~~~~
The main factory needs 3 others functions :
* The name of the view (as shown in the WYSIWYS editor)
~~~~~~~~~~~~~{.cpp}
IdStringPtr getViewName () const { return "Name of my UI component"; }
~~~~~~~~~~~~~
* The parent class of the view (In this tutorial we're using *CControl*)
~~~~~~~~~~~~~{.cpp}
IdStringPtr getBaseViewName () const { return UIViewCreator::kCControl; }
~~~~~~~~~~~~~
* and a creator method which returns a new view with a default size
~~~~~~~~~~~~~{.cpp}
CView* create (const UIAttributes& attributes, const IUIDescription* description) const
{
return new MyControl (CRect (0, 0, 100, 100));
}
~~~~~~~~~~~~~
You also need to create a static variable having the same type as our factory. This variable will call the constructor of your factory. Thus, your view will be registered automatically.
~~~~~~~~~~~~~{.cpp}
MyControlFactory __gMyControlFactory;
~~~~~~~~~~~~~
So at the end you should have something like this :
~~~~~~~~~~~~~{.cpp}
#pragma once
#include "vstgui/vstgui.h"
#include "vstgui/vstgui_uidescription.h"
#include "vstgui/uidescription/detail/uiviewcreatorattributes.h"
#include "MyControl.h"
namespace VSTGUI {
class MyControlFactory : public ViewCreatorAdapter
{
public:
// register this class with the view factory
MyControlFactory () { UIViewFactory::registerViewCreator (*this); }
// return an unique name here
IdStringPtr getViewName () const override { return "Name of my UI component"; }
// return the name here from where your custom view inherites.
// Your view automatically supports the attributes from it.
IdStringPtr getBaseViewName () const override { return UIViewCreator::kCControl; }
// create your view here.
// Note you don't need to apply attributes here as
// the apply method will be called with this new view
CView* create (const UIAttributes& attributes, const IUIDescription* description) const override
{
CRect size (CPoint (45, 45), CPoint (400, 150) );
return new MyControl (size);
}
};
// create a static instance so that it registers itself with the view factory
MyControlFactory __gMyControlFactory;
} // namespace VSTGUI
~~~~~~~~~~~~~
@section create_your_own_view_result Result
Now if you come back to the VST 3 plugin Editor you can find your new view in the list.
![Edit VST3 plugin](screenshots/newuicompname.png)
*/
@@ -0,0 +1,25 @@
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
/**
@page key_event_flow Keyboard Event Flow
@section short_story Short Story
Keyboard events are dispatched from CFrame in this order :
- IKeyboardHook
- focus view
- parents of focus view
- modal view
@section long_story Long Story
If a keyboard event is coming to CFrame::onKeyDown or CFrame::onKeyUp, CFrame will first sent the event to the keyboard hook if
it is set. If the keyboard hook has not handled the event, the next candidate is the focus view. If there is a focus view and
the focus view does not handle the event, the event is dispatched to the parent of the focus view. If the parent also does not
handle the event the event is propagated to the parent of the parent and so on until the parent is the frame.
If the event is still not handled the event will be passed on to the modal view if it exists.
*/
@@ -0,0 +1,38 @@
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
/**
@page page_license License
\code
//-----------------------------------------------------------------------------
// VSTGUI LICENSE
// Copyright 2010, Steinberg Media Technologies, All Rights Reserved
//-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of the Steinberg Media Technologies nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
\endcode
*/
@@ -0,0 +1,8 @@
/**
@page page_misc Miscellaneous
- @subpage page_animation
- @subpage key_event_flow
*/
@@ -0,0 +1,114 @@
/**
@page the_view_system The view system overview
A view is a rectangular section which is contained in a window.
It is responsible for handling user events and drawing to the screen.
In VSTGUI this is the CView class.
Another aspect of a view is that it can be part of a parent view.
The main parent view is always a CFrame object. It is itself a view and it is a
view container which can contain one or more child views.
If you need to group multiple views you can use the CViewContainer class.
It is also a view but it can have child views.
@section inherit_from_cview Inherit from CView
If you want to draw custom data which cannot be presented via the included
CView subclasses you need to create a new subclass of CView:
~~~~~~~~~~~~~{.cpp}
class MyView : public CView
{
public:
MyView (const CRect& size) : CView (size) {}
};
~~~~~~~~~~~~~
If you want to draw some custom stuff, you need to override the draw method:
~~~~~~~~~~~~~{.cpp}
class MyView : public CView
{
public:
MyView (const CRect& size) : CView (size) {}
void draw (CDrawContext* context) override
{}
};
~~~~~~~~~~~~~
As you see, the draw method has a CDrawContext argument. The draw context has all the methods to
draw stuff into the view. Below I just show you a very simple thing, drawing a green line.
~~~~~~~~~~~~~{.cpp}
void MyView::draw (CDrawContext* context) override
{
context->setFrameColor (kGreenColor);
context->drawLine (CPoint (0,0), CPoint (10, 10));
}
~~~~~~~~~~~~~
Now a little strange concept of VSTGUI is that the draw context is not automatically adjusted to the
position of the view, so that if the position of the view is at x=50 and y=50, you will not see the line
(because it is drawn from 0,0 to 10,10 and that is outside the views boundaries).
So you need to offset your drawing by the position of the view.
~~~~~~~~~~~~~{.cpp}
void MyView::draw (CDrawContext* context) override
{
auto viewPos = getViewSize ().getTopLeft ();
CDrawContext::Transform t (*context, CGraphicsTransform ().translate (viewPos));
context->setFrameColor (kGreenColor);
context->drawLine (CPoint (0,0), CPoint (10, 10));
}
~~~~~~~~~~~~~
If CDrawContext::Transform is not defined in your VSTGUI version you have a version older than 4.2
and you need to offset the points yourself.
If you have a complex view which takes a long time to draw, you can also override the CView::drawRect (CDrawContext*, const CRect&) method
and only draw the region which needs to be drawn.
@section handling_mouse_events Handling mouse events
Next you may want to add user interactions via mouse events.
For this you have to override two or three methods depending on if you want to track mouse movement or just want to get a mouse click.
For a simple mouse click you have to do this :
~~~~~~~~~~~~~{.cpp}
class MyView : public CView
{
public:
CMouseEventResult onMouseDown (CPoint& where, const CButtonState& buttons) override
{
return kMouseEventHandled; // needed to get the onMouseUp call
}
CMouseEventResult onMouseUp (CPoint& where, const CButtonState& buttons) override
{
if (buttons.isLeftButton () && getViewSize ().pointInside (where))
doMouseClick ();
return kMouseEventHandled;
}
void doMouseClick () {}
};
~~~~~~~~~~~~~
If a user clicks inside MyView the doMouseClick() method is called.
If you need to track mouse movement in your view you have to additionally override the onMouseMoved method:
~~~~~~~~~~~~~{.cpp}
class MyView : public CView
{
public:
CMouseEventResult onMouseMove (CPoint& where, const CButtonState& buttons) override
{
return kMouseEventHandled;
}
};
~~~~~~~~~~~~~
This method is always called if the mouse moves inside your view, even if no buttons are down.
So if you want to track the mouse only if the left button is down you have to check for it with buttons.isLeftButton () inside that method.
*/
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB