Reference for package 'nvidia-widgets'

NVIDIA widget library

Units

GLFreeType | Free Type support for OpenGL
nvGlutWidgets | GLut adaptor class
nvGLWidgets | User Interface library specialized for OpenGL
nvShaderUtils | Utility functions for compiling shaders and programs
nvWidgets | User Interface library

Description

This library is originally based on the NVIDIA widget library. NVIDIA Widgets is the immediate mode graphical user interface toolkit used by the NVIDIA SDK samples.

Originally ported to FPC by Darius Blaszyk in June 2011.

This library is distributed under the MIT license, as the original library was.

The original code can be found here: http://code.google.com/p/nvidia-widgets/

nvidia-widgets class chart
nvidia-widgets class chart

For more information see the Lazarus wiki.


Index of all identifiers in package 'nvidia-widgets'

B C E G K L M N P R S T U

B

ButtonFlags_Alt | ButtonFlags_End | ButtonFlags_Shift
ButtonFlags_Begin | ButtonFlags_Off | ButtonState
ButtonFlags_Ctrl | ButtonFlags_On |

C

cBase | CompileASMShader | cTexViewWidgetFSSource
cBool | CompileASMShaderFromFile | cTranslucent
cFont | CompileGLSLShader | cWidgetFSSource
cFontBack | CompileGLSLShaderFromFile | cWidgetVSSource
cNbColors | cOutline |

E

EvalBool

G

GLFreeType | GroupFlags_GrowLeftFromBottom | GroupFlags_LayoutNone
GLUIPainter | GroupFlags_GrowLeftFromTop | GroupFlags_LayoutNoSpace
GlutUIContext | GroupFlags_GrowRightFromBottom | GroupFlags_LayoutVertical
Group | GroupFlags_GrowRightFromTop | GroupFlags_LayoutXMask
GroupFlags_AlignBottom | GroupFlags_GrowUpFromLeft | GroupFlags_StartBottom
GroupFlags_AlignLeft | GroupFlags_GrowUpFromRight | GroupFlags_StartLeft
GroupFlags_AlignMask | GroupFlags_LayoutDefault | GroupFlags_StartMask
GroupFlags_AlignRight | GroupFlags_LayoutDefaultFallback | GroupFlags_StartRight
GroupFlags_AlignTop | GroupFlags_LayoutForce | GroupFlags_StartTop
GroupFlags_AlignXMask | GroupFlags_LayoutHorizontal | GroupFlags_StartXMask
GroupFlags_GrowDownFromLeft | GroupFlags_LayoutMask |
GroupFlags_GrowDownFromRight | GroupFlags_LayoutNoMargin |

K

Key_Down | Key_F3 | Key_Home
Key_End | Key_F4 | Key_Insert
Key_F1 | Key_F5 | Key_Left
Key_F10 | Key_F6 | Key_PageDown
Key_F11 | Key_F7 | Key_PageUp
Key_F12 | Key_F8 | Key_Right
Key_F2 | Key_F9 | Key_Up

L

LinkGLSLProgram

M

MouseButton_Left MouseButton_Middle MouseButton_Right

N

nvGlutWidgets | nvShaderUtils
nvGLWidgets | nvWidgets

P

PGroup Point

R

Rect

S

s_colors SetPoint SetRect

T

TGLFreeTypeFont

U

UIContext UIPainter


Reference for unit 'GLFreeType'

Free Type support for OpenGL

uses

  System,

  SysUtils,

  freetypeh,

  GL,

  GLu;


[Overview][Classes][Index] Reference for unit 'GLFreeType' (#nvidia-widgets)

Reference for unit 'GLFreeType': Classes

TGLFreeTypeFont


[Overview][Classes][Index] Reference for unit 'GLFreeType' (#nvidia-widgets)

Index of all identifiers in unit 'GLFreeType'

T

T

TGLFreeTypeFont


TGLFreeTypeFont

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: glfreetype.pas line 18

type TGLFreeTypeFont = object

  Height: Cardinal;

  textures: pGLuint;

  list_base: GLuint;

  procedure Init();

  procedure Clean;

  procedure Print();

end;

Inheritance

TGLFreeTypeFont


TGLFreeTypeFont


TGLFreeTypeFont
 | Init
 | Clean
 | Print


Clean (TGLFreeTypeFont)

Init (TGLFreeTypeFont)

Print (TGLFreeTypeFont)


TGLFreeTypeFont.Clean

Declaration

Source position: glfreetype.pas line 28

procedure TGLFreeTypeFont.Clean;


TGLFreeTypeFont.Height

Declaration

Source position: glfreetype.pas line 19

TGLFreeTypeFont.Height: Cardinal;


TGLFreeTypeFont.Init

Declaration

Source position: glfreetype.pas line 25

procedure TGLFreeTypeFont.Init(

  const fname: ;

  AHeight: Cardinal

);


TGLFreeTypeFont.list_base

Declaration

Source position: glfreetype.pas line 21

TGLFreeTypeFont.list_base: GLuint;


TGLFreeTypeFont.Print

Declaration

Source position: glfreetype.pas line 33

procedure TGLFreeTypeFont.Print(

  x: Double;

  y: Double;

  Text:

);


TGLFreeTypeFont.textures

Declaration

Source position: glfreetype.pas line 20

TGLFreeTypeFont.textures: pGLuint;


GlutUIContext

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

GLut specific UI context

Declaration

Source position: nvglutwidgets.pas line 27

type GlutUIContext = class(UIContext)
procedure Create(); | UI constructor
public
destructor Destroy; override; | UI destructor
function init(); | One time initialization
public
procedure mouse(); | UI method for processing GLUT mouse button events
public
procedure specialKeyboard(); | UI method for processing key events
end;

Inheritance

GlutUIContext | GLut specific UI context
|
UIContext | Basic UI context
|
TObject


GlutUIContext

UIContext


GlutUIContext
 | Create
 | Destroy
 | init
 | mouse
 | specialKeyboard
UIContext
 | Create
 | reshape
 | isOnFocus
 | mouse
 | mouseMotion
 | keyboard
 | _begin
 | _end
 | doLabel
 | doButton
 | doCheckButton
 | doRadioButton
 | doHorizontalSlider
 | doListItem
 | doListBox
 | doComboBox
 | doLineEdit
 | beginGroup
 | endGroup
 | beginFrame
 | endFrame
 | beginPanel
 | endPanel
 | getGroupWidth
 | getGroupHeight
 | getCursorX
 | getCursorY
 | getMouseState
 | doTextureView
pt | getPainter
pt | window
pt | placeRect


 | beginFrame (UIContext)
 | beginGroup (UIContext)
 | beginPanel (UIContext)
 | Create (UIContext)
 | Create (GlutUIContext)
 | Destroy (GlutUIContext)
 | doButton (UIContext)
 | doCheckButton (UIContext)
 | doComboBox (UIContext)
 | doHorizontalSlider (UIContext)
 | doLabel (UIContext)
 | doLineEdit (UIContext)
 | doListBox (UIContext)
 | doListItem (UIContext)
 | doRadioButton (UIContext)
 | doTextureView (UIContext)
 | endFrame (UIContext)
 | endGroup (UIContext)
 | endPanel (UIContext)
 | getCursorX (UIContext)
 | getCursorY (UIContext)
 | getGroupHeight (UIContext)
 | getGroupWidth (UIContext)
 | getMouseState (UIContext)
pt | getPainter (UIContext)
 | init (GlutUIContext)
 | isOnFocus (UIContext)
 | keyboard (UIContext)
 | mouse (UIContext)
 | mouse (GlutUIContext)
 | mouseMotion (UIContext)
pt | placeRect (UIContext)
 | reshape (UIContext)
 | specialKeyboard (GlutUIContext)
pt |


GlutUIContext.Create

UI constructor

Declaration

Source position: line 0

constructor GlutUIContext.Create;

constructor GlutUIContext.Create(

  painter: UIPainter

);

Description

Allows for overriding the standard painter


GlutUIContext.Destroy

UI destructor

Declaration

Source position: nvglutwidgets.pas line 50

public destructor GlutUIContext.Destroy; override;


GlutUIContext.init

One time initialization

Declaration

Source position: nvglutwidgets.pas line 56

public function GlutUIContext.init(

  w: Integer;

  h: Integer

):Boolean;


GlutUIContext.mouse

UI method for processing GLUT mouse button events

Declaration

Source position: line 0

procedure GlutUIContext.mouse(

  button: Integer;

  state: Integer;

  modifier: Integer;

  x: Integer;

  y: Integer

);

procedure GlutUIContext.mouse(

  button: Integer;

  state: Integer;

  x: Integer;

  y: Integer

);

Description

Call this method from the glutMouseFunc callback, the modifier parameter maps to glutGetModifiers.


GlutUIContext.specialKeyboard

UI method for processing key events

Declaration

Source position: nvglutwidgets.pas line 72

public procedure GlutUIContext.specialKeyboard(

  k: Integer;

  x: Integer;

  y: Integer

);

Description

Call this method from the glutReshapeFunc callback


Reference for unit 'nvGlutWidgets'

GLut adaptor class

uses

  System,

  SysUtils,

  nvWidgets;

User Interface library

Overview

Adaptor classes to integrate the nvWidgets UI library with the GLUT windowing toolkit. The adaptors convert native GLUT UI data to native nvWidgets data. All adaptor classes are implemented as in-line code in this header. The adaptor defaults to using the standard OpenGL painter implementation.


Reference for unit 'nvGlutWidgets': Classes

GlutUIContext

GLut specific UI context


[Overview][Classes][Index] Reference for unit 'nvGlutWidgets' (#nvidia-widgets)

Index of all identifiers in unit 'nvGlutWidgets'

G

G

GlutUIContext


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cBase

Declaration

Source position: nvglwidgets.pas line 19

const cBase = 0;


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cBool

Declaration

Source position: nvglwidgets.pas line 20

const cBool = 4;


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cFont

Declaration

Source position: nvglwidgets.pas line 22

const cFont = 12;


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cFontBack

Declaration

Source position: nvglwidgets.pas line 23

const cFontBack = 16;


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cNbColors

Declaration

Source position: nvglwidgets.pas line 25

const cNbColors = 24;


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cOutline

Declaration

Source position: nvglwidgets.pas line 21

const cOutline = 8;


cTexViewWidgetFSSource

Declaration

Source position: nvglwidgets.pas line 96

const cTexViewWidgetFSSource = '#version 120' + LineEnding + 'uniform float mipLevel /*= 0*/;' + LineEnding + 'uniform float texelScale /*= 1.0*/;' + LineEnding + 'uniform float texelOffset /*= 0.0*/;' + LineEnding + 'uniform ivec4 texelSwizzling /*= ivec4( 0, 1, 2, 3)*/;' + LineEnding + 'uniform sampler2D samp;' + LineEnding + LineEnding + 'void main()' + LineEnding + '{' + LineEnding + ' vec4 texel;' + LineEnding + ' if (mipLevel > 0)' + LineEnding + ' texel = texture2DLod( samp, gl_TexCoord[0].xy, mipLevel);' + LineEnding + ' else' + LineEnding + ' texel = texture2D( samp, gl_TexCoord[0].xy);' + LineEnding + ' texel = texel * texelScale + texelOffset;' + LineEnding + ' gl_FragColor = texel.x * vec4( texelSwizzling.x == 0, texelSwizzling.y == 0, texelSwizzling.z == 0, texelSwizzling.w == 0 );' + LineEnding + ' gl_FragColor += texel.y * vec4( texelSwizzling.x == 1, texelSwizzling.y == 1, texelSwizzling.z == 1, texelSwizzling.w == 1 );' + LineEnding + ' gl_FragColor += texel.z * vec4( texelSwizzling.x == 2, texelSwizzling.y == 2, texelSwizzling.z == 2, texelSwizzling.w == 2 );' + LineEnding + ' gl_FragColor += texel.w * vec4( texelSwizzling.x == 3, texelSwizzling.y == 3, texelSwizzling.z == 3, texelSwizzling.w == 3 );' + LineEnding + '}';


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

cTranslucent

Declaration

Source position: nvglwidgets.pas line 24

const cTranslucent = 20;


cWidgetFSSource

Declaration

Source position: nvglwidgets.pas line 76

const cWidgetFSSource = '#version 120' + LineEnding + 'uniform vec4 fillColor /*= vec4( 1.0, 0.0,0.0,1.0)*/;' + LineEnding + 'uniform vec4 borderColor /*= vec4( 1.0, 1.0,1.0,1.0)*/;' + LineEnding + 'uniform vec2 zones;' + LineEnding + LineEnding + 'void main()' + LineEnding + '{' + LineEnding + ' float doTurn = float(gl_TexCoord[0].y > 0);' + LineEnding + ' float radiusOffset = doTurn * abs( gl_TexCoord[0].z );' + LineEnding + ' float turnDir = sign( gl_TexCoord[0].z );' + LineEnding + ' vec2 uv = vec2(gl_TexCoord[0].x + turnDir*radiusOffset, gl_TexCoord[0].y);' + LineEnding + ' float l = abs( length(uv) - radiusOffset );' + LineEnding + ' float a = clamp( l - zones.x, 0.0, 2.0);' + LineEnding + ' float b = clamp( l - zones.y, 0.0, 2.0);' + LineEnding + ' b = exp2(-2.0*b*b);' + LineEnding + ' gl_FragColor = ( fillColor * b + (1.0-b)*borderColor );' + LineEnding + ' gl_FragColor.a *= exp2(-2.0*a*a);' + LineEnding + '}';


cWidgetVSSource

Declaration

Source position: nvglwidgets.pas line 66

const cWidgetVSSource = '#version 120' + LineEnding + LineEnding + 'void main()' + LineEnding + '{' + LineEnding + ' gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;' + LineEnding + ' gl_TexCoord[0] = gl_MultiTexCoord0;' + LineEnding + '}';


GLUIPainter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

OpenGL painter class

Declaration

Source position: nvglwidgets.pas line 123

type GLUIPainter = class(UIPainter)
public
constructor Create;
destructor Destroy;
procedure _begin(); override;
procedure _end; override;
public
procedure drawFrame(); | Draw frame primitive
public
function getLabelRect(); override;
procedure drawLabel(); override;
function getButtonRect(); override;
procedure drawButton(); override;
function getCheckRect(); override;
procedure drawCheckButton(); override;
function getRadioRect(); override;
procedure drawRadioButton(); override;
function getHorizontalSliderRect(); override;
procedure drawHorizontalSlider(); override;
function getItemRect(); override;
procedure drawListItem(); override;
function getListRect(); override;
procedure drawListBox(); override;
function getComboRect(); override;
function getComboOptionsRect(); override;
procedure drawComboBox(); override;
procedure drawComboOptions(); override;
function getLineEditRect(); override;
procedure drawLineEdit(); override;
function getPanelRect(); override;
procedure drawPanel(); override;
function getTextureViewRect(); override;
procedure drawTextureView(); override;
function getCanvasMargin; override; | Evaluate canvas margin
function getCanvasSpace; override; | Evaluate canvas space
function getFontHeight; override; | Evaluate font height
function getTextLineWidth(); override; | Evaluate text width
function getTextSize(); override; | Evaluate text size
function getTextLineWidthAt();
function getPickedCharNb(); override;
procedure drawDebugRect(); override; | Draw a rectangle for debugging purposes
procedure drawText(); | Draw text with rectangle primitive
procedure drawBoolFrame(); | Draw bool frame primitive
procedure drawString(); | Draw multi-line text primitive
procedure drawRect(); | Draw rectangle primitive
procedure drawRoundedRect(); | Draw rouded rectangle primitive
procedure drawRoundedRectOutline(); | Draw rouded rectangle outline primitive
procedure drawCircle(); | Draw circle primitive
procedure drawMinus(); | Draw minus primitive
procedure drawPlus(); | Draw plus primitive
procedure drawDownArrow(); | Draw down arrow primitive
procedure drawUpArrow(); | Draw up arrow primitive
procedure init; override; | Initialization method of the painter class
end;

Inheritance

GLUIPainter | OpenGL painter class
|
UIPainter | Basic painter class
|
TObject


GLUIPainter

UIPainter


GLUIPainter
 | Create
 | Destroy
 | _begin
 | _end
 | drawFrame
 | getLabelRect
 | drawLabel
 | getButtonRect
 | drawButton
 | getCheckRect
 | drawCheckButton
 | getRadioRect
 | drawRadioButton
 | getHorizontalSliderRect
 | drawHorizontalSlider
 | getItemRect
 | drawListItem
 | getListRect
 | drawListBox
 | getComboRect
 | getComboOptionsRect
 | drawComboBox
 | drawComboOptions
 | getLineEditRect
 | drawLineEdit
 | getPanelRect
 | drawPanel
 | getTextureViewRect
 | drawTextureView
 | getCanvasMargin
 | getCanvasSpace
 | getFontHeight
 | getTextLineWidth
 | getTextSize
 | getTextLineWidthAt
 | getPickedCharNb
 | drawDebugRect
 | drawText
 | drawBoolFrame
 | drawString
 | drawRect
 | drawRoundedRect
 | drawRoundedRectOutline
 | drawCircle
 | drawMinus
 | drawPlus
 | drawDownArrow
 | drawUpArrow
 | init
UIPainter
 | Create
 | _begin
 | _end
 | drawFrame
 | getLabelRect
 | drawLabel
 | getButtonRect
 | drawButton
 | getCheckRect
 | drawCheckButton
 | getRadioRect
 | drawRadioButton
 | getHorizontalSliderRect
 | drawHorizontalSlider
 | getItemRect
 | drawListItem
 | getListRect
 | drawListBox
 | getComboRect
 | getComboOptionsRect
 | drawComboBox
 | drawComboOptions
 | getLineEditRect
 | drawLineEdit
 | getPanelRect
 | drawPanel
 | getTextureViewRect
 | drawTextureView
 | getCanvasMargin
 | getCanvasSpace
 | getFontHeight
 | getTextLineWidth
 | getTextSize
 | getPickedCharNb
 | drawDebugRect
 | init


Create (UIPainter)

Create (GLUIPainter)

Destroy (GLUIPainter)

drawBoolFrame (GLUIPainter)

drawButton (UIPainter)

drawButton (GLUIPainter)

drawCheckButton (UIPainter)

drawCheckButton (GLUIPainter)

drawCircle (GLUIPainter)

drawComboBox (UIPainter)

drawComboBox (GLUIPainter)

drawComboOptions (UIPainter)

drawComboOptions (GLUIPainter)

drawDebugRect (UIPainter)

drawDebugRect (GLUIPainter)

drawDownArrow (GLUIPainter)

drawFrame (UIPainter)

drawFrame (GLUIPainter)

drawHorizontalSlider (UIPainter)

drawHorizontalSlider (GLUIPainter)

drawLabel (UIPainter)

drawLabel (GLUIPainter)

drawLineEdit (UIPainter)

drawLineEdit (GLUIPainter)

drawListBox (UIPainter)

drawListBox (GLUIPainter)

drawListItem (UIPainter)

drawListItem (GLUIPainter)

drawMinus (GLUIPainter)

drawPanel (UIPainter)

drawPanel (GLUIPainter)

drawPlus (GLUIPainter)

drawRadioButton (UIPainter)

drawRadioButton (GLUIPainter)

drawRect (GLUIPainter)

drawRoundedRect (GLUIPainter)

drawRoundedRectOutline (GLUIPainter)

drawString (GLUIPainter)

drawText (GLUIPainter)

drawTextureView (UIPainter)

drawTextureView (GLUIPainter)

drawUpArrow (GLUIPainter)

getButtonRect (UIPainter)

getButtonRect (GLUIPainter)

getCanvasMargin (UIPainter)

getCanvasMargin (GLUIPainter)

getCanvasSpace (UIPainter)

getCanvasSpace (GLUIPainter)

getCheckRect (UIPainter)

getCheckRect (GLUIPainter)

getComboOptionsRect (UIPainter)

getComboOptionsRect (GLUIPainter)

getComboRect (UIPainter)

getComboRect (GLUIPainter)

getFontHeight (UIPainter)

getFontHeight (GLUIPainter)

getHorizontalSliderRect (UIPainter)

getHorizontalSliderRect (GLUIPainter)

getItemRect (UIPainter)

getItemRect (GLUIPainter)

getLabelRect (UIPainter)

getLabelRect (GLUIPainter)

getLineEditRect (UIPainter)

getLineEditRect (GLUIPainter)

getListRect (UIPainter)

getListRect (GLUIPainter)

getPanelRect (UIPainter)

getPanelRect (GLUIPainter)

getPickedCharNb (UIPainter)

getPickedCharNb (GLUIPainter)

getRadioRect (UIPainter)

getRadioRect (GLUIPainter)

getTextLineWidth (UIPainter)

getTextLineWidth (GLUIPainter)

getTextLineWidthAt (GLUIPainter)

getTextSize (UIPainter)

getTextSize (GLUIPainter)

getTextureViewRect (UIPainter)

getTextureViewRect (GLUIPainter)

init (UIPainter)

init (GLUIPainter)

_begin (UIPainter)

_begin (GLUIPainter)

_end (UIPainter)

_end (GLUIPainter)


GLUIPainter._begin

Declaration

Source position: nvglwidgets.pas line 129

public procedure GLUIPainter._begin(

  const window: Rect

); override;


GLUIPainter._end

Declaration

Source position: nvglwidgets.pas line 130

public procedure GLUIPainter._end; override;


GLUIPainter.Create

Declaration

Source position: nvglwidgets.pas line 126

public constructor GLUIPainter.Create;


GLUIPainter.Destroy

Declaration

Source position: nvglwidgets.pas line 127

public destructor GLUIPainter.Destroy;


GLUIPainter.drawBoolFrame

Draw bool frame primitive

Declaration

Source position: nvglwidgets.pas line 184

public procedure GLUIPainter.drawBoolFrame(

  aRect: Rect;

  corner: Point;

  isHover: Boolean = false;

  isOn: Boolean = false;

  isFocus: Boolean = false

);

Arguments

aRect | Rectangle to draw in
corner | Radius of the corner
isHover | Boolean indicating if the mouse is hovering over it
isOn | Boolean indicating if the widget is on
isFocus | Boolean indicating if the widget has focus


GLUIPainter.drawButton

Declaration

Source position: nvglwidgets.pas line 139

public procedure GLUIPainter.drawButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  isDown: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawCheckButton

Declaration

Source position: nvglwidgets.pas line 142

public procedure GLUIPainter.drawCheckButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const rr: Rect;

  isChecked: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawCircle

Draw circle primitive

Declaration

Source position: nvglwidgets.pas line 189

public procedure GLUIPainter.drawCircle(

  aRect: Rect;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawComboBox

Declaration

Source position: nvglwidgets.pas line 158

public procedure GLUIPainter.drawComboBox(

  const aRect: Rect;

  numOptions: Integer;

  const options: array of ;

  const rt: Rect;

  const ra: Rect;

  selected: Integer;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawComboOptions

Declaration

Source position: nvglwidgets.pas line 159

public procedure GLUIPainter.drawComboOptions(

  const aRect: Rect;

  numOptions: Integer;

  const options: array of ;

  const ri: Rect;

  const rit: Rect;

  selected: Integer;

  hovered: Integer;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawDebugRect

Draw a rectangle for debugging purposes

Declaration

Source position: nvglwidgets.pas line 179

public procedure GLUIPainter.drawDebugRect(

  const r: Rect

); override;

Arguments

r

Rectangle size to draw

Description

drawDebugRect draws a simple rectangle usefull for debugging purposes.


GLUIPainter.drawDownArrow

Draw down arrow primitive

Declaration

Source position: nvglwidgets.pas line 192

public procedure GLUIPainter.drawDownArrow(

  aRect: Rect;

  Width: Integer;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
Width | Width of the arrow
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawFrame

Draw frame primitive

Declaration

Source position: line 0

procedure GLUIPainter.drawFrame(

  const r: Rect;

  margin: Integer;

  style: Integer

); override;

procedure GLUIPainter.drawFrame(

  aRect: Rect;

  corner: Point;

  isHover: Boolean = false;

  isOn: Boolean = false;

  isFocus: Boolean = false

);

Arguments

aRect | Rectangle to draw in
corner | Radius of the corner
isHover | Boolean indicating if the mouse is hovering over it
isOn | Boolean indicating if the widget is on
isFocus | Boolean indicating if the widget has focus


GLUIPainter.drawHorizontalSlider

Declaration

Source position: nvglwidgets.pas line 148

public procedure GLUIPainter.drawHorizontalSlider(

  const r: Rect;

  rs: Rect;

  v: Double;

  rc: Rect;

  isHover: Boolean;

  style: Integer

); override;


GLUIPainter.drawLabel

Declaration

Source position: nvglwidgets.pas line 136

public procedure GLUIPainter.drawLabel(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const nbLines: Integer;

  isHover: Boolean;

  style: Integer

); override;


GLUIPainter.drawLineEdit

Declaration

Source position: nvglwidgets.pas line 162

public procedure GLUIPainter.drawLineEdit(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  caretPos: Integer;

  isSelected: Boolean;

  isHover: Boolean;

  style: Integer

); override;


GLUIPainter.drawListBox

Declaration

Source position: nvglwidgets.pas line 154

public procedure GLUIPainter.drawListBox(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  const ri: Rect;

  const rt: Rect;

  selected: Integer;

  hovered: Integer;

  style: Integer

); override;


GLUIPainter.drawListItem

Declaration

Source position: nvglwidgets.pas line 151

public procedure GLUIPainter.drawListItem(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  isSelected: Boolean;

  isHover: Boolean;

  style: Integer

); override;


GLUIPainter.drawMinus

Draw minus primitive

Declaration

Source position: nvglwidgets.pas line 190

public procedure GLUIPainter.drawMinus(

  aRect: Rect;

  Width: Integer;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
Width | Width of the minus
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawPanel

Declaration

Source position: nvglwidgets.pas line 165

public procedure GLUIPainter.drawPanel(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const ra: Rect;

  isUnfold: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawPlus

Draw plus primitive

Declaration

Source position: nvglwidgets.pas line 191

public procedure GLUIPainter.drawPlus(

  aRect: Rect;

  Width: Integer;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
Width | Width of the plus
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawRadioButton

Declaration

Source position: nvglwidgets.pas line 145

public procedure GLUIPainter.drawRadioButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const rr: Rect;

  isOn: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); override;


GLUIPainter.drawRect

Draw rectangle primitive

Declaration

Source position: nvglwidgets.pas line 186

public procedure GLUIPainter.drawRect(

  aRect: Rect;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawRoundedRect

Draw rouded rectangle primitive

Declaration

Source position: nvglwidgets.pas line 187

public procedure GLUIPainter.drawRoundedRect(

  aRect: Rect;

  const corner: Point;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
corner | Radius of the corner
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.drawRoundedRectOutline

Draw rouded rectangle outline primitive

Declaration

Source position: nvglwidgets.pas line 188

public procedure GLUIPainter.drawRoundedRectOutline(

  aRect: Rect;

  corner: Point;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
corner | Radius of the corner
borderColorId | Border color


GLUIPainter.drawString

Draw multi-line text primitive

Declaration

Source position: nvglwidgets.pas line 185

public procedure GLUIPainter.drawString(

  x: Integer;

  y: Integer;

  Text: ;

  nbLines: Integer

);

Arguments

nbLines

Number of lines in text


GLUIPainter.drawText

Draw text with rectangle primitive

Declaration

Source position: nvglwidgets.pas line 182

public procedure GLUIPainter.drawText(

  r: Rect;

  Text: ;

  nbLines: Integer = 1;

  caretPos: Integer = -1;

  isHover: Boolean = false;

  isOn: Boolean = false;

  isFocus: Boolean = false

);

Arguments

r | Rectangle to draw in
nbLines | Number of lines in text
caretPos | Caret position
isHover | Boolean indicating if the mouse is hovering over it
isOn | Boolean indicating if the widget is on
isFocus | Boolean indicating if the widget has focus


GLUIPainter.drawTextureView

Declaration

Source position: nvglwidgets.pas line 168

public procedure GLUIPainter.drawTextureView(

  const aRect: Rect;

  const texID: Integer;

  const rt: Rect;

  const rz: Rect;

  mipLevel: Integer;

  texelScale: Double;

  texelOffset: Double;

  r: Integer;

  g: Integer;

  b: Integer;

  a: Integer;

  style: Integer

); override;


GLUIPainter.drawUpArrow

Draw up arrow primitive

Declaration

Source position: nvglwidgets.pas line 193

public procedure GLUIPainter.drawUpArrow(

  aRect: Rect;

  Width: Integer;

  fillColorId: Integer;

  borderColorId: Integer

);

Arguments

aRect | Rectangle to draw in
Width | Width of the arrow
fillColorId | Fill color
borderColorId | Border color


GLUIPainter.getButtonRect

Declaration

Source position: nvglwidgets.pas line 138

public function GLUIPainter.getButtonRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; override;


GLUIPainter.getCanvasMargin

Evaluate canvas margin

Declaration

Source position: nvglwidgets.pas line 171

public function GLUIPainter.getCanvasMargin: Integer; override;

Function result

Exterior margin


GLUIPainter.getCanvasSpace

Evaluate canvas space

Declaration

Source position: nvglwidgets.pas line 172

public function GLUIPainter.getCanvasSpace: Integer; override;

Function result

Interior margin


GLUIPainter.getCheckRect

Declaration

Source position: nvglwidgets.pas line 141

public function GLUIPainter.getCheckRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out rc: Rect

):Rect; override;


GLUIPainter.getComboOptionsRect

Declaration

Source position: nvglwidgets.pas line 157

public function GLUIPainter.getComboOptionsRect(

  const rCombo: Rect;

  numOptions: Integer;

  const options: array of ;

  out ri: Rect;

  out rit: Rect

):Rect; override;


GLUIPainter.getComboRect

Declaration

Source position: nvglwidgets.pas line 156

public function GLUIPainter.getComboRect(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  selected: Integer;

  out rt: Rect;

  out ra: Rect

):Rect; override;


GLUIPainter.getFontHeight

Evaluate font height

Declaration

Source position: nvglwidgets.pas line 173

public function GLUIPainter.getFontHeight: Integer; override;

Function result

Font height in pixels


GLUIPainter.getHorizontalSliderRect

Declaration

Source position: nvglwidgets.pas line 147

public function GLUIPainter.getHorizontalSliderRect(

  const r: Rect;

  out rs: Rect;

  v: Double;

  out rc: Rect

):Rect; override;


GLUIPainter.getItemRect

Declaration

Source position: nvglwidgets.pas line 150

public function GLUIPainter.getItemRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; override;


GLUIPainter.getLabelRect

Declaration

Source position: nvglwidgets.pas line 135

public function GLUIPainter.getLabelRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out nbLines: Integer

):Rect; override;


GLUIPainter.getLineEditRect

Declaration

Source position: nvglwidgets.pas line 161

public function GLUIPainter.getLineEditRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; override;


GLUIPainter.getListRect

Declaration

Source position: nvglwidgets.pas line 153

public function GLUIPainter.getListRect(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  out ri: Rect;

  out rt: Rect

):Rect; override;


GLUIPainter.getPanelRect

Declaration

Source position: nvglwidgets.pas line 164

public function GLUIPainter.getPanelRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out ra: Rect

):Rect; override;


GLUIPainter.getPickedCharNb

Declaration

Source position: nvglwidgets.pas line 177

public function GLUIPainter.getPickedCharNb(

  const Text: ;

  const at: Point

):Integer; override;


GLUIPainter.getRadioRect

Declaration

Source position: nvglwidgets.pas line 144

public function GLUIPainter.getRadioRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out rr: Rect

):Rect; override;


GLUIPainter.getTextLineWidth

Evaluate text width

Declaration

Source position: nvglwidgets.pas line 174

public function GLUIPainter.getTextLineWidth(

  const Text:

):Integer; override;

Function result

Text width


GLUIPainter.getTextLineWidthAt

Declaration

Source position: nvglwidgets.pas line 176

public function GLUIPainter.getTextLineWidthAt(

  const Text: ;

  charNb: Integer

):Integer;


GLUIPainter.getTextSize

Evaluate text size

Declaration

Source position: nvglwidgets.pas line 175

public function GLUIPainter.getTextSize(

  const Text: ;

  out nbLines: Integer

):Integer; override;

Function result

Text width of widest line

Description

getTextSize evaluates a string, it will calculate the number of lines it consists of and will return the length in pixels of the longest line.


GLUIPainter.getTextureViewRect

Declaration

Source position: nvglwidgets.pas line 167

public function GLUIPainter.getTextureViewRect(

  const r: Rect;

  out rt: Rect

):Rect; override;


GLUIPainter.init

Initialization method of the painter class

Declaration

Source position: nvglwidgets.pas line 195

public procedure GLUIPainter.init; override;


Reference for unit 'nvGLWidgets'

User Interface library specialized for OpenGL

uses
System,
Classes,
nvWidgets, | User Interface library
GL,
ftFont,
FPCanvas,
GLFreeType; | Free Type support for OpenGL


Reference for unit 'nvGLWidgets': Constants

cBase

cBool

cFont

cFontBack

cNbColors

cOutline

cTexViewWidgetFSSource

cTranslucent

cWidgetFSSource

cWidgetVSSource

s_colors


[Overview][Constants][Classes][Index] Reference for unit 'nvGLWidgets' (#nvidia-widgets)

Reference for unit 'nvGLWidgets': Classes

GLUIPainter

OpenGL painter class


Index of all identifiers in unit 'nvGLWidgets'

C G S

C

cBase | cNbColors | cWidgetFSSource
cBool | cOutline | cWidgetVSSource
cFont | cTexViewWidgetFSSource |
cFontBack | cTranslucent |

G

GLUIPainter

S

s_colors


s_colors

Declaration

Source position: nvglwidgets.pas line 27

const s_colors: array [0..23,0..3] of GLfloat = ((89 / 255, 89 / 255, 89 / 255, 0.7), (166 / 255, 166 / 255, 166 / 255, 0.8), (212 / 255, 228 / 255, 60 / 255, 0.5), (227 / 255, 237 / 255, 127 / 255, 0.5), (99 / 255, 37 / 255, 35 / 255, 1.0), (149 / 255, 55 / 255, 53 / 255, 1.0), (212 / 255, 228 / 255, 60 / 255, 1.0), (227 / 255, 237 / 255, 127 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (255 / 255, 255 / 255, 255 / 255, 1.0), (79 / 255, 129 / 255, 189 / 255, 1.0), (79 / 255, 129 / 255, 189 / 255, 1.0), (128 / 255, 100 / 255, 162 / 255, 1.0), (128 / 255, 100 / 255, 162 / 255, 1.0), (0 / 255, 0 / 255, 0 / 255, 0.0), (0 / 255, 0 / 255, 0 / 255, 0.0), (0 / 255, 0 / 255, 0 / 255, 0.0), (0 / 255, 0 / 255, 0 / 255, 0.0));


CompileASMShader

Declaration

Source position: nvshaderutils.pas line 20

function CompileASMShader(

  program_type: GLenum;

  code:

):GLuint;


CompileASMShaderFromFile

Declaration

Source position: nvshaderutils.pas line 21

function CompileASMShaderFromFile(

  target: GLenum;

  filename:

):GLuint;


CompileGLSLShader

Declaration

Source position: nvshaderutils.pas line 16

function CompileGLSLShader(

  target: GLenum;

  shader:

):GLuint;


CompileGLSLShaderFromFile

Declaration

Source position: nvshaderutils.pas line 17

function CompileGLSLShaderFromFile(

  target: GLenum;

  filename:

):GLuint;


Reference for unit 'nvShaderUtils'

Utility functions for compiling shaders and programs

uses

  System,

  Classes,

  SysUtils,

  GL,

  GLext;


Reference for unit 'nvShaderUtils': Procedures and functions

CompileASMShader

CompileASMShaderFromFile

CompileGLSLShader

CompileGLSLShaderFromFile

LinkGLSLProgram

Create a program composed of vertex, geometry and fragment shaders.


Index of all identifiers in unit 'nvShaderUtils'

C L

C

CompileASMShader | CompileGLSLShader
CompileASMShaderFromFile | CompileGLSLShaderFromFile

L

LinkGLSLProgram


LinkGLSLProgram

Create a program composed of vertex, geometry and fragment shaders.

Declaration

Source position: line 0

function LinkGLSLProgram(

  vertexShader: GLuint;

  fragmentShader: GLuint

):GLuint;

function LinkGLSLProgram(

  vertexShader: GLuint;

  geometryShader: GLuint;

  inputType: GLint;

  vertexOut: GLint;

  outputType: GLint;

  fragmentShader: GLuint

):GLuint;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_Alt

Declaration

Source position: nvWidgets.pas line 54

const ButtonFlags_Alt = $10;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_Begin

Declaration

Source position: nvWidgets.pas line 51

const ButtonFlags_Begin = $2;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_Ctrl

Declaration

Source position: nvWidgets.pas line 55

const ButtonFlags_Ctrl = $20;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_End

Declaration

Source position: nvWidgets.pas line 52

const ButtonFlags_End = $4;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_Off

Declaration

Source position: nvWidgets.pas line 49

const ButtonFlags_Off = $0;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_On

Declaration

Source position: nvWidgets.pas line 50

const ButtonFlags_On = $1;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

ButtonFlags_Shift

Declaration

Source position: nvWidgets.pas line 53

const ButtonFlags_Shift = $8;


ButtonState

Declaration

Source position: nvWidgets.pas line 58

type ButtonState = record

  state: Integer;

  time: TDateTime;

  cursor: Point;

end;


EvalBool

Boolean evaluation function

Declaration

Source position: nvWidgets.pas line 407

function EvalBool(

  b: Boolean

):Byte;

Description

This function evaluates a boolean to a numerical value.

True equals 1 False equals 0


Group

Group record

Declaration

Source position: nvWidgets.pas line 137

type Group = record
bounds: Rect; | anchor point + width and height of the region
flags: Integer; | group behavior
margin: Integer; | border
space: Integer; | interior
end;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_AlignBottom

Declaration

Source position: nvWidgets.pas line 107

const GroupFlags_AlignBottom = $80;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_AlignLeft

Declaration

Source position: nvWidgets.pas line 104

const GroupFlags_AlignLeft = $10;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_AlignMask

Declaration

Source position: nvWidgets.pas line 108

const GroupFlags_AlignMask = $f0;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_AlignRight

Declaration

Source position: nvWidgets.pas line 105

const GroupFlags_AlignRight = $20;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_AlignTop

Declaration

Source position: nvWidgets.pas line 106

const GroupFlags_AlignTop = $40;


GroupFlags_AlignXMask

Declaration

Source position: nvWidgets.pas line 109

const GroupFlags_AlignXMask = $ffff xor GroupFlags_AlignMask;


GroupFlags_GrowDownFromLeft

Declaration

Source position: nvWidgets.pas line 132

const GroupFlags_GrowDownFromLeft = GroupFlags_LayoutVertical or GroupFlags_StartTop or GroupFlags_AlignTop or GroupFlags_StartLeft or GroupFlags_AlignLeft;


GroupFlags_GrowDownFromRight

Declaration

Source position: nvWidgets.pas line 133

const GroupFlags_GrowDownFromRight = GroupFlags_LayoutVertical or GroupFlags_StartTop or GroupFlags_AlignTop or GroupFlags_StartRight or GroupFlags_AlignRight;


GroupFlags_GrowLeftFromBottom

Declaration

Source position: nvWidgets.pas line 128

const GroupFlags_GrowLeftFromBottom = GroupFlags_LayoutHorizontal or GroupFlags_StartRight or GroupFlags_AlignRight or GroupFlags_StartBottom or GroupFlags_AlignBottom;


GroupFlags_GrowLeftFromTop

Declaration

Source position: nvWidgets.pas line 129

const GroupFlags_GrowLeftFromTop = GroupFlags_LayoutHorizontal or GroupFlags_StartRight or GroupFlags_AlignRight or GroupFlags_StartTop or GroupFlags_AlignTop;


GroupFlags_GrowRightFromBottom

Declaration

Source position: nvWidgets.pas line 124

const GroupFlags_GrowRightFromBottom = GroupFlags_LayoutHorizontal or GroupFlags_StartLeft or GroupFlags_AlignLeft or GroupFlags_StartBottom or GroupFlags_AlignBottom;


GroupFlags_GrowRightFromTop

Declaration

Source position: nvWidgets.pas line 127

const GroupFlags_GrowRightFromTop = GroupFlags_LayoutHorizontal or GroupFlags_StartLeft or GroupFlags_AlignLeft or GroupFlags_StartTop or GroupFlags_AlignTop;


GroupFlags_GrowUpFromLeft

Declaration

Source position: nvWidgets.pas line 130

const GroupFlags_GrowUpFromLeft = GroupFlags_LayoutVertical or GroupFlags_StartBottom or GroupFlags_AlignBottom or GroupFlags_StartLeft or GroupFlags_AlignLeft;


GroupFlags_GrowUpFromRight

Declaration

Source position: nvWidgets.pas line 131

const GroupFlags_GrowUpFromRight = GroupFlags_LayoutVertical or GroupFlags_StartBottom or GroupFlags_AlignBottom or GroupFlags_StartRight or GroupFlags_AlignRight;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutDefault

Declaration

Source position: nvWidgets.pas line 121

const GroupFlags_LayoutDefault = $4000;


GroupFlags_LayoutDefaultFallback

Declaration

Source position: nvWidgets.pas line 134

const GroupFlags_LayoutDefaultFallback = GroupFlags_GrowDownFromLeft;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutForce

Declaration

Source position: nvWidgets.pas line 120

const GroupFlags_LayoutForce = $8000;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutHorizontal

Declaration

Source position: nvWidgets.pas line 99

const GroupFlags_LayoutHorizontal = $04;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutMask

Declaration

Source position: nvWidgets.pas line 100

const GroupFlags_LayoutMask = $07;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutNoMargin

Declaration

Source position: nvWidgets.pas line 122

const GroupFlags_LayoutNoMargin = $2000;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutNone

Declaration

Source position: nvWidgets.pas line 97

const GroupFlags_LayoutNone = $01;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutNoSpace

Declaration

Source position: nvWidgets.pas line 123

const GroupFlags_LayoutNoSpace = $1000;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_LayoutVertical

Declaration

Source position: nvWidgets.pas line 98

const GroupFlags_LayoutVertical = $02;


GroupFlags_LayoutXMask

Declaration

Source position: nvWidgets.pas line 101

const GroupFlags_LayoutXMask = $ffff xor GroupFlags_LayoutMask;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_StartBottom

Declaration

Source position: nvWidgets.pas line 115

const GroupFlags_StartBottom = $800;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_StartLeft

Declaration

Source position: nvWidgets.pas line 112

const GroupFlags_StartLeft = $100;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_StartMask

Declaration

Source position: nvWidgets.pas line 116

const GroupFlags_StartMask = $f00;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_StartRight

Declaration

Source position: nvWidgets.pas line 113

const GroupFlags_StartRight = $200;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

GroupFlags_StartTop

Declaration

Source position: nvWidgets.pas line 114

const GroupFlags_StartTop = $400;


GroupFlags_StartXMask

Declaration

Source position: nvWidgets.pas line 117

const GroupFlags_StartXMask = $ffff xor GroupFlags_StartMask;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Reference for unit 'nvWidgets'

User Interface library

uses

  System,

  Classes,

  SysUtils;


Reference for unit 'nvWidgets': Constants

ButtonFlags_Alt
ButtonFlags_Begin
ButtonFlags_Ctrl
ButtonFlags_End
ButtonFlags_Off
ButtonFlags_On
ButtonFlags_Shift
GroupFlags_AlignBottom
GroupFlags_AlignLeft
GroupFlags_AlignMask
GroupFlags_AlignRight
GroupFlags_AlignTop
GroupFlags_AlignXMask
GroupFlags_GrowDownFromLeft
GroupFlags_GrowDownFromRight
GroupFlags_GrowLeftFromBottom
GroupFlags_GrowLeftFromTop
GroupFlags_GrowRightFromBottom
GroupFlags_GrowRightFromTop
GroupFlags_GrowUpFromLeft
GroupFlags_GrowUpFromRight
GroupFlags_LayoutDefault
GroupFlags_LayoutDefaultFallback
GroupFlags_LayoutForce
GroupFlags_LayoutHorizontal
GroupFlags_LayoutMask
GroupFlags_LayoutNoMargin
GroupFlags_LayoutNone
GroupFlags_LayoutNoSpace
GroupFlags_LayoutVertical
GroupFlags_LayoutXMask
GroupFlags_StartBottom
GroupFlags_StartLeft
GroupFlags_StartMask
GroupFlags_StartRight
GroupFlags_StartTop
GroupFlags_StartXMask
Key_Down
Key_End
Key_F1
Key_F10
Key_F11
Key_F12
Key_F2
Key_F3
Key_F4
Key_F5
Key_F6
Key_F7
Key_F8
Key_F9
Key_Home
Key_Insert
Key_Left
Key_PageDown
Key_PageUp
Key_Right
Key_Up
MouseButton_Left | An enum to identify the left mouse button
MouseButton_Middle | An enum to identify the middle mouse button
MouseButton_Right | An enum to identify the right mouse button


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Reference for unit 'nvWidgets': Types

ButtonState

Group

Group record

PGroup


Reference for unit 'nvWidgets': Classes

Point | 2D point object
Rect | Rectangle object
UIContext | Basic UI context
UIPainter | Basic painter class


Reference for unit 'nvWidgets': Procedures and functions

EvalBool | Boolean evaluation function
SetPoint | Helper function to initialize the point object
SetRect | Helper function to initialize the Rect object


Index of all identifiers in unit 'nvWidgets'

B E G K M P R S U

B

ButtonFlags_Alt | ButtonFlags_End | ButtonFlags_Shift
ButtonFlags_Begin | ButtonFlags_Off | ButtonState
ButtonFlags_Ctrl | ButtonFlags_On |

E

EvalBool

G

Group | GroupFlags_GrowRightFromBottom | GroupFlags_LayoutNoSpace
GroupFlags_AlignBottom | GroupFlags_GrowRightFromTop | GroupFlags_LayoutVertical
GroupFlags_AlignLeft | GroupFlags_GrowUpFromLeft | GroupFlags_LayoutXMask
GroupFlags_AlignMask | GroupFlags_GrowUpFromRight | GroupFlags_StartBottom
GroupFlags_AlignRight | GroupFlags_LayoutDefault | GroupFlags_StartLeft
GroupFlags_AlignTop | GroupFlags_LayoutDefaultFallback | GroupFlags_StartMask
GroupFlags_AlignXMask | GroupFlags_LayoutForce | GroupFlags_StartRight
GroupFlags_GrowDownFromLeft | GroupFlags_LayoutHorizontal | GroupFlags_StartTop
GroupFlags_GrowDownFromRight | GroupFlags_LayoutMask | GroupFlags_StartXMask
GroupFlags_GrowLeftFromBottom | GroupFlags_LayoutNoMargin |
GroupFlags_GrowLeftFromTop | GroupFlags_LayoutNone |

K

Key_Down | Key_F3 | Key_Home
Key_End | Key_F4 | Key_Insert
Key_F1 | Key_F5 | Key_Left
Key_F10 | Key_F6 | Key_PageDown
Key_F11 | Key_F7 | Key_PageUp
Key_F12 | Key_F8 | Key_Right
Key_F2 | Key_F9 | Key_Up

M

MouseButton_Left MouseButton_Middle MouseButton_Right

P

PGroup Point

R

Rect

S

SetPoint SetRect

U

UIContext UIPainter


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Down

Declaration

Source position: nvWidgets.pas line 87

const Key_Down = 143;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_End

Declaration

Source position: nvWidgets.pas line 91

const Key_End = 147;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F1

Declaration

Source position: nvWidgets.pas line 71

const Key_F1 = 128;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F2

Declaration

Source position: nvWidgets.pas line 72

const Key_F2 = 129;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F3

Declaration

Source position: nvWidgets.pas line 73

const Key_F3 = 130;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F4

Declaration

Source position: nvWidgets.pas line 74

const Key_F4 = 131;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F5

Declaration

Source position: nvWidgets.pas line 75

const Key_F5 = 132;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F6

Declaration

Source position: nvWidgets.pas line 76

const Key_F6 = 133;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F7

Declaration

Source position: nvWidgets.pas line 77

const Key_F7 = 134;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F8

Declaration

Source position: nvWidgets.pas line 78

const Key_F8 = 135;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F9

Declaration

Source position: nvWidgets.pas line 79

const Key_F9 = 136;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F10

Declaration

Source position: nvWidgets.pas line 80

const Key_F10 = 137;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F11

Declaration

Source position: nvWidgets.pas line 81

const Key_F11 = 138;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_F12

Declaration

Source position: nvWidgets.pas line 82

const Key_F12 = 139;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Home

Declaration

Source position: nvWidgets.pas line 90

const Key_Home = 146;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Insert

Declaration

Source position: nvWidgets.pas line 92

const Key_Insert = 148;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Left

Declaration

Source position: nvWidgets.pas line 84

const Key_Left = 140;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_PageDown

Declaration

Source position: nvWidgets.pas line 89

const Key_PageDown = 145;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_PageUp

Declaration

Source position: nvWidgets.pas line 88

const Key_PageUp = 144;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Right

Declaration

Source position: nvWidgets.pas line 86

const Key_Right = 142;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Key_Up

Declaration

Source position: nvWidgets.pas line 85

const Key_Up = 141;


MouseButton_Left

An enum to identify the left mouse button

Declaration

Source position: nvWidgets.pas line 66

const MouseButton_Left = 1;


MouseButton_Middle

An enum to identify the middle mouse button

Declaration

Source position: nvWidgets.pas line 67

const MouseButton_Middle = 2;


MouseButton_Right

An enum to identify the right mouse button

Declaration

Source position: nvWidgets.pas line 68

const MouseButton_Right = 3;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

PGroup

Declaration

Source position: nvWidgets.pas line 143

type PGroup = ^Group;


Point

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

2D point object

Declaration

Source position: nvWidgets.pas line 23

type Point = object
x: Integer; | X location
y: Integer; | Y location
procedure Point(); | Constructor for the Point object
end;

Inheritance

Point

2D point object


Point


Point

Point


Point (Point)


Point.Point

Constructor for the Point object

Declaration

Source position: line 0

constructor Point.Point;

constructor Point.Point(

  ix: Integer;

  iy: Integer

);

constructor Point.Point(

  const p: Point

);


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Point.x

X location

Declaration

Source position: nvWidgets.pas line 24

Point.x: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Point.y

Y location

Declaration

Source position: nvWidgets.pas line 24

Point.y: Integer;


Rect

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Rectangle object

Declaration

Source position: nvWidgets.pas line 36

type Rect = object
x: Integer; | X position of top left point
y: Integer; | Y position of top left point
w: Integer; | Width of rectangle
h: Integer; | Height of rectangle
procedure Rect(); | Constructor for the Rect object
end;

Inheritance

Rect

Rectangle object


Rect


Rect

Rect


Rect (Rect)


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Rect.h

Height of rectangle

Declaration

Source position: nvWidgets.pas line 37

Rect.h: Integer;


Rect.Rect

Constructor for the Rect object

Declaration

Source position: line 0

constructor Rect.Rect;

constructor Rect.Rect(

  const p: TPoint

);

constructor Rect.Rect(

  ix: Integer;

  iy: Integer;

  iw: Integer = 0;

  ih: Integer = 0

);

constructor Rect.Rect(

  const r: Rect

);


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Rect.w

Width of rectangle

Declaration

Source position: nvWidgets.pas line 37

Rect.w: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Rect.x

X position of top left point

Declaration

Source position: nvWidgets.pas line 37

Rect.x: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

Rect.y

Y position of top left point

Declaration

Source position: nvWidgets.pas line 37

Rect.y: Integer;


SetPoint

Helper function to initialize the point object

Declaration

Source position: nvWidgets.pas line 31

function SetPoint(

  x: Integer;

  y: Integer

):Point;

Function result

Initialize the point object


SetRect

Helper function to initialize the Rect object

Declaration

Source position: line 0

function SetRect(

  x: Integer;

  y: Integer

):Rect;

function SetRect(

  x: Integer;

  y: Integer;

  w: Integer;

  h: Integer

):Rect;


UIContext

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic UI context

Declaration

Source position: nvWidgets.pas line 209

type UIContext = class(TObject)
public
constructor Create();
procedure reshape(); | UI method for processing window size events
function isOnFocus; | Check if the UI is currently on Focus
public
procedure mouse(); | UI method for processing mouse events
public
procedure mouseMotion(); | UI method for processing mouse motion events
procedure keyboard(); | UI method for processing key events
procedure _begin; | UI method for entering UI processing mode
procedure _end; virtual; | UI method for leaving UI processing mode
procedure doLabel(); | UI method for drawing a static text label
public
function doButton(); | UI method for rendering and processing a push button
public
function doCheckButton(); | UI method for rendering and processing a check button
function doRadioButton(); | UI method for rendering and processing a radio button
function doHorizontalSlider(); | UI method for rendering and processing a horizontal slider
function doListItem(); | List item widget
function doListBox(); | Listbox widget
function doComboBox(); | Combobox widget
function doLineEdit(); | Line edit widget
public
procedure beginGroup(); | Begin grouping section of UI objects
public
procedure endGroup;
procedure beginFrame(); | Frame positioning section
procedure endFrame; | Frame positioning widget
function beginPanel(); | Panel positioning widget
procedure endPanel; | Panel positioning widget
function getGroupWidth;
function getGroupHeight;
function getCursorX;
function getCursorY;
function getMouseState();
procedure doTextureView(); | UI method for drawing a texture view
protected
function getPainter; | Active widget painter
function window;
protected
function placeRect();
m_painter: UIPainter;
m_groupIndex: Integer;
m_groupStack: ;
m_window: Rect;
m_currentCursor: Point;
m_mouseButton: ;
m_keyBuffer: ;
m_nbKeys: Integer;
m_focusCaretPos: Integer;
m_focusPoint: Point;
m_twoStepFocus: Boolean;
m_uiOnFocus: Boolean;
end;

Inheritance

UIContext

Basic UI context
|

TObject


UIContext


UIContext
 | Create
 | reshape
 | isOnFocus
 | mouse
 | mouseMotion
 | keyboard
 | _begin
 | _end
 | doLabel
 | doButton
 | doCheckButton
 | doRadioButton
 | doHorizontalSlider
 | doListItem
 | doListBox
 | doComboBox
 | doLineEdit
 | beginGroup
 | endGroup
 | beginFrame
 | endFrame
 | beginPanel
 | endPanel
 | getGroupWidth
 | getGroupHeight
 | getCursorX
 | getCursorY
 | getMouseState
 | doTextureView
pt | getPainter
pt | window
pt | placeRect


 | beginFrame (UIContext)
 | beginGroup (UIContext)
 | beginPanel (UIContext)
 | Create (UIContext)
 | doButton (UIContext)
 | doCheckButton (UIContext)
 | doComboBox (UIContext)
 | doHorizontalSlider (UIContext)
 | doLabel (UIContext)
 | doLineEdit (UIContext)
 | doListBox (UIContext)
 | doListItem (UIContext)
 | doRadioButton (UIContext)
 | doTextureView (UIContext)
 | endFrame (UIContext)
 | endGroup (UIContext)
 | endPanel (UIContext)
 | getCursorX (UIContext)
 | getCursorY (UIContext)
 | getGroupHeight (UIContext)
 | getGroupWidth (UIContext)
 | getMouseState (UIContext)
pt | getPainter (UIContext)
 | isOnFocus (UIContext)
 | keyboard (UIContext)
 | mouse (UIContext)
 | mouseMotion (UIContext)
pt | placeRect (UIContext)
 | reshape (UIContext)
pt |


UIContext._begin

UI method for entering UI processing mode

Declaration

Source position: nvWidgets.pas line 243

public procedure UIContext._begin;

Description

This function must be used to begin the UI processing


UIContext._end

UI method for leaving UI processing mode

Declaration

Source position: nvWidgets.pas line 249

public procedure UIContext._end; virtual;

Description

This function must be used to end the UI processing


UIContext.beginFrame

Frame positioning section

Declaration

Source position: nvWidgets.pas line 342

public procedure UIContext.beginFrame(

  groupFlags: Integer = GroupFlags_LayoutDefault;

  const rect: Rect = 0;

  style: Integer = 0

);

Description


UIContext.beginGroup

Begin grouping section of UI objects

Declaration

Source position: line 0

procedure UIContext.beginGroup(

  groupFlags: Integer;

  const r: Rect

); overload;

procedure UIContext.beginGroup(

  groupFlags: Integer = GroupFlags_LayoutDefault

); overload;


UIContext.beginPanel

Panel positioning widget

Declaration

Source position: nvWidgets.pas line 345

public function UIContext.beginPanel(

  r: Rect;

  const Text: ;

  isUnfold: Boolean;

  groupFlags: Integer = GroupFlags_LayoutDefault;

  style: Integer = 0

):Boolean;

Description


UIContext.Create

Declaration

Source position: nvWidgets.pas line 211

public constructor UIContext.Create(

  painter: UIPainter

);


UIContext.doButton

UI method for rendering and processing a push button

Declaration

Source position: line 0

function UIContext.doButton(

  const r: Rect;

  const Text: ;

  var state: Boolean;

  style: Integer = 0

):Boolean;

function UIContext.doButton(

  const r: Rect;

  const Text:

):Boolean;

Arguments

r | optionally provides a location and size for the button
Text | text to display on the button
state | whether the button is depressed
style | optional style flag to modify the look

Arguments

r | optionally provides a location and size for the button
Text | text to display on the button

Description

The button method does only take a text and state variable. This variable is modified if the button is pressed or depressed. When a state change occurs the method function returns True.


UIContext.doCheckButton

UI method for rendering and processing a check button

Declaration

Source position: nvWidgets.pas line 296

public function UIContext.doCheckButton(

  const r: Rect;

  const Text: ;

  var state: Boolean;

  style: Integer = 0

):Boolean;

Arguments

r | optionally provides a location and size for the button
Text | text to display on the button
state | whether the check button is checked or not
style | optional style flag to modify the look

Function result

True if the check button state changed

Description

Check button behaves similarly as a toggle button used to display and edit a boolean property.


UIContext.doComboBox

Combobox widget

Declaration

Source position: nvWidgets.pas line 334

public function UIContext.doComboBox(

  const aRect: Rect;

  numOptions: Integer;

  const options: array of ;

  var selected: Integer;

  style: Integer = 0

):Boolean;

Description


UIContext.doHorizontalSlider

UI method for rendering and processing a horizontal slider

Declaration

Source position: nvWidgets.pas line 330

public function UIContext.doHorizontalSlider(

  const aRect: Rect;

  min: Double;

  max: Double;

  var Value: Double;

  style: Integer = 0

):Boolean;

Arguments

aRect | optionally provides a location and size for the widget
min | min bound of the varying range of the value
max | max bound of the varying range of the value
Value | the value edited by the widget
style | optional style flag to modify the look

Function result

True if the slider value changed

Description

Horizontal slider is used to edit and display a scalar value in the specified range [min; max].


UIContext.doLabel

UI method for drawing a static text label

Declaration

Source position: nvWidgets.pas line 267

public procedure UIContext.doLabel(

  const r: Rect;

  const Text: ;

  style: Integer = 0

);

Arguments

r | optionally provides a location and size for the label
Text | Text to display for the label (can have several lines)
style | optional style flag to modify the look

Description

The label displays a non interactive text.

The style flag enables to draw the label in two distinct styles. The first one is default (style = 0) and displays the label simply as text. The alternative (style = 1) displays the label with a frame around it. An example is shown in the following figure.

The Text variable can have multiple lines.


UIContext.doLineEdit

Line edit widget

Declaration

Source position: nvWidgets.pas line 336

public function UIContext.doLineEdit(

  const aRect: Rect;

  var Text: ;

  maxTextLength: Integer;

  out nbCharsReturned: Integer;

  style: Integer = 0

):Boolean;

Description


UIContext.doListBox

Listbox widget

Declaration

Source position: nvWidgets.pas line 333

public function UIContext.doListBox(

  const aRect: Rect;

  numOptions: Integer;

  const options: array of ;

  var selected: Integer;

  style: Integer = 0

):Boolean;

Description


UIContext.doListItem

List item widget

Declaration

Source position: nvWidgets.pas line 332

public function UIContext.doListItem(

  index: Integer;

  const aRect: Rect;

  const Text: ;

  selected: Integer;

  style: Integer = 0

):Boolean;

Description


UIContext.doRadioButton

UI method for rendering and processing a radio button

Declaration

Source position: nvWidgets.pas line 315

public function UIContext.doRadioButton(

  reference: Integer;

  const r: Rect;

  const Text: ;

  var Value: Integer;

  style: Integer = 0

):Boolean;

Arguments

reference | The reference int value represented by this radio button.
r | optionally provides a location and size for the button
Text | text to display on the button
Value | The value parameter compared to the reference value parameter.
style | optional style flag to modify the look

Function result

True if the radio button value changed

Description

Radio buttons are typically used in groups to display and edit the possible reference values taken by an integer value.

One radio button is representing a possible reference value taken by the current value. It is displaying a boolean state true if the current value is equal to the reference value.


UIContext.doTextureView

UI method for drawing a texture view

Declaration

Source position: nvWidgets.pas line 371

public procedure UIContext.doTextureView(

  const aRect: Rect;

  const texID: Integer;

  zoomRect: Rect;

  mipLevel: Integer = -1;

  texelScale: Double = 1;

  texelOffset: Double = 0;

  red: Integer = 0;

  green: Integer = 1;

  blue: Integer = 2;

  alpha: Integer = 3;

  style: Integer = 0

);

Arguments

aRect | provides a location and size for the texture view
texID | texture identifier (Graphics API specific)
zoomRect | rectangle area of the texture displayed
mipLevel | mip Level of the texture displayed
texelScale | scale applyed to the texel fetch
texelOffset | offset applyed to the texel after scale
style | optional style flag to modify the look

Description

Several parameters control the equation used to display the texel

texel = texture2DFetch(...);
pixel = texelSwizzling( texel * texelScale + texelOffset );


UIContext.endFrame

Frame positioning widget

Declaration

Source position: nvWidgets.pas line 343

public procedure UIContext.endFrame;

Description


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.endGroup

Declaration

Source position: nvWidgets.pas line 340

public procedure UIContext.endGroup;


UIContext.endPanel

Panel positioning widget

Declaration

Source position: nvWidgets.pas line 346

public procedure UIContext.endPanel;

Description


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.getCursorX

Declaration

Source position: nvWidgets.pas line 351

public function UIContext.getCursorX: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.getCursorY

Declaration

Source position: nvWidgets.pas line 352

public function UIContext.getCursorY: Integer;


UIContext.getGroupHeight

Declaration

Source position: nvWidgets.pas line 349

public function UIContext.getGroupHeight: Integer;


UIContext.getGroupWidth

Declaration

Source position: nvWidgets.pas line 348

public function UIContext.getGroupWidth: Integer;


UIContext.getMouseState

Declaration

Source position: nvWidgets.pas line 354

public function UIContext.getMouseState(

  button: Integer

):ButtonState;


UIContext.getPainter

Active widget painter

Declaration

Source position: nvWidgets.pas line 374

protected function UIContext.getPainter: UIPainter;


UIContext.isOnFocus

Check if the UI is currently on Focus

Declaration

Source position: nvWidgets.pas line 220

public function UIContext.isOnFocus: Boolean;


UIContext.keyboard

UI method for processing key events

Declaration

Source position: nvWidgets.pas line 236

public procedure UIContext.keyboard(

  k: Byte;

  x: Integer;

  y: Integer

);


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_currentCursor

Declaration

Source position: nvWidgets.pas line 396

protected UIContext.m_currentCursor: Point;


UIContext.m_focusCaretPos

Declaration

Source position: nvWidgets.pas line 401

protected UIContext.m_focusCaretPos: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_focusPoint

Declaration

Source position: nvWidgets.pas line 402

protected UIContext.m_focusPoint: Point;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_groupIndex

Declaration

Source position: nvWidgets.pas line 391

protected UIContext.m_groupIndex: Integer;


UIContext.m_groupStack

Declaration

Source position: nvWidgets.pas line 392

protected UIContext.m_groupStack: array [0..63] of Group;


UIContext.m_keyBuffer

Declaration

Source position: nvWidgets.pas line 398

protected UIContext.m_keyBuffer: array [0..31] of Byte;


UIContext.m_mouseButton

Declaration

Source position: nvWidgets.pas line 397

protected UIContext.m_mouseButton: array [0..2] of ButtonState;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_nbKeys

Declaration

Source position: nvWidgets.pas line 399

protected UIContext.m_nbKeys: Integer;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_painter

Declaration

Source position: nvWidgets.pas line 389

protected UIContext.m_painter: UIPainter;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_twoStepFocus

Declaration

Source position: nvWidgets.pas line 403

protected UIContext.m_twoStepFocus: Boolean;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_uiOnFocus

Declaration

Source position: nvWidgets.pas line 404

protected UIContext.m_uiOnFocus: Boolean;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.m_window

Declaration

Source position: nvWidgets.pas line 394

protected UIContext.m_window: Rect;


UIContext.mouse

UI method for processing mouse events

Declaration

Source position: line 0

procedure UIContext.mouse(

  button: Integer;

  state: Integer;

  modifier: Integer;

  x: Integer;

  y: Integer

);

procedure UIContext.mouse(

  button: Integer;

  state: Integer;

  x: Integer;

  y: Integer

);


UIContext.mouseMotion

UI method for processing mouse motion events

Declaration

Source position: nvWidgets.pas line 231

public procedure UIContext.mouseMotion(

  x: Integer;

  y: Integer

);


UIContext.placeRect

Declaration

Source position: nvWidgets.pas line 386

protected function UIContext.placeRect(

  const r: Rect

):Rect;


UIContext.reshape

UI method for processing window size events

Declaration

Source position: nvWidgets.pas line 215

public procedure UIContext.reshape(

  w: Integer;

  h: Integer

);


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.window

Declaration

Source position: nvWidgets.pas line 376

protected function UIContext.window: Rect;


UIPainter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Basic painter class

Declaration

Source position: nvWidgets.pas line 148

type UIPainter = class(TObject)

public

  constructor Create;

  procedure _begin(); virtual;

  procedure _end; virtual;

  procedure drawFrame(); virtual; abstract;

  function getLabelRect(); virtual; abstract;

  procedure drawLabel(); virtual; abstract;

  function getButtonRect(); virtual; abstract;

  procedure drawButton(); virtual; abstract;

  function getCheckRect(); virtual; abstract;

  procedure drawCheckButton(); virtual; abstract;

  function getRadioRect(); virtual; abstract;

  procedure drawRadioButton(); virtual; abstract;

  function getHorizontalSliderRect(); virtual; abstract;

  procedure drawHorizontalSlider(); virtual; abstract;

  function getItemRect(); virtual; abstract;

  procedure drawListItem(); virtual; abstract;

  function getListRect(); virtual; abstract;

  procedure drawListBox(); virtual; abstract;

  function getComboRect(); virtual; abstract;

  function getComboOptionsRect(); virtual; abstract;

  procedure drawComboBox(); virtual; abstract;

  procedure drawComboOptions(); virtual; abstract;

  function getLineEditRect(); virtual; abstract;

  procedure drawLineEdit(); virtual; abstract;

  function getPanelRect(); virtual; abstract;

  procedure drawPanel(); virtual; abstract;

  function getTextureViewRect(); virtual; abstract;

  procedure drawTextureView(); virtual; abstract;

  function getCanvasMargin; virtual;

  function getCanvasSpace; virtual;

  function getFontHeight; virtual;

  function getTextLineWidth(); virtual;

  function getTextSize(); virtual;

  function getPickedCharNb(); virtual;

  procedure drawDebugRect(); virtual; abstract;

  procedure init; virtual; abstract;

end;

Inheritance

UIPainter

Basic painter class
|

TObject


UIPainter


UIPainter
 | Create
 | _begin
 | _end
 | drawFrame
 | getLabelRect
 | drawLabel
 | getButtonRect
 | drawButton
 | getCheckRect
 | drawCheckButton
 | getRadioRect
 | drawRadioButton
 | getHorizontalSliderRect
 | drawHorizontalSlider
 | getItemRect
 | drawListItem
 | getListRect
 | drawListBox
 | getComboRect
 | getComboOptionsRect
 | drawComboBox
 | drawComboOptions
 | getLineEditRect
 | drawLineEdit
 | getPanelRect
 | drawPanel
 | getTextureViewRect
 | drawTextureView
 | getCanvasMargin
 | getCanvasSpace
 | getFontHeight
 | getTextLineWidth
 | getTextSize
 | getPickedCharNb
 | drawDebugRect
 | init


Create (UIPainter)

drawButton (UIPainter)

drawCheckButton (UIPainter)

drawComboBox (UIPainter)

drawComboOptions (UIPainter)

drawDebugRect (UIPainter)

drawFrame (UIPainter)

drawHorizontalSlider (UIPainter)

drawLabel (UIPainter)

drawLineEdit (UIPainter)

drawListBox (UIPainter)

drawListItem (UIPainter)

drawPanel (UIPainter)

drawRadioButton (UIPainter)

drawTextureView (UIPainter)

getButtonRect (UIPainter)

getCanvasMargin (UIPainter)

getCanvasSpace (UIPainter)

getCheckRect (UIPainter)

getComboOptionsRect (UIPainter)

getComboRect (UIPainter)

getFontHeight (UIPainter)

getHorizontalSliderRect (UIPainter)

getItemRect (UIPainter)

getLabelRect (UIPainter)

getLineEditRect (UIPainter)

getListRect (UIPainter)

getPanelRect (UIPainter)

getPickedCharNb (UIPainter)

getRadioRect (UIPainter)

getTextLineWidth (UIPainter)

getTextSize (UIPainter)

getTextureViewRect (UIPainter)

init (UIPainter)

_begin (UIPainter)

_end (UIPainter)


UIPainter._begin

Declaration

Source position: nvWidgets.pas line 152

public procedure UIPainter._begin(

  const window: Rect

); virtual;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIPainter._end

Declaration

Source position: nvWidgets.pas line 153

public procedure UIPainter._end; virtual;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIPainter.Create

Declaration

Source position: nvWidgets.pas line 150

public constructor UIPainter.Create;


UIPainter.drawButton

Declaration

Source position: nvWidgets.pas line 163

public procedure UIPainter.drawButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  isDown: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawCheckButton

Declaration

Source position: nvWidgets.pas line 166

public procedure UIPainter.drawCheckButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const rr: Rect;

  isChecked: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawComboBox

Declaration

Source position: nvWidgets.pas line 182

public procedure UIPainter.drawComboBox(

  const rect: Rect;

  numOptions: Integer;

  const options: array of ;

  const rt: Rect;

  const ra: Rect;

  selected: Integer;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawComboOptions

Declaration

Source position: nvWidgets.pas line 183

public procedure UIPainter.drawComboOptions(

  const rect: Rect;

  numOptions: Integer;

  const options: array of ;

  const ri: Rect;

  const rit: Rect;

  selected: Integer;

  hovered: Integer;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawDebugRect

Declaration

Source position: nvWidgets.pas line 202

public procedure UIPainter.drawDebugRect(

  const r: Rect

); virtual; abstract;


UIPainter.drawFrame

Declaration

Source position: nvWidgets.pas line 157

public procedure UIPainter.drawFrame(

  const r: Rect;

  margin: Integer;

  style: Integer

); virtual; abstract;


UIPainter.drawHorizontalSlider

Declaration

Source position: nvWidgets.pas line 172

public procedure UIPainter.drawHorizontalSlider(

  const r: Rect;

  rs: Rect;

  v: Double;

  rc: Rect;

  isHover: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawLabel

Declaration

Source position: nvWidgets.pas line 160

public procedure UIPainter.drawLabel(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const nbLines: Integer;

  isHover: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawLineEdit

Declaration

Source position: nvWidgets.pas line 186

public procedure UIPainter.drawLineEdit(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  caretPos: Integer;

  isSelected: Boolean;

  isHover: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawListBox

Declaration

Source position: nvWidgets.pas line 178

public procedure UIPainter.drawListBox(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  const ri: Rect;

  const rt: Rect;

  selected: Integer;

  hovered: Integer;

  style: Integer

); virtual; abstract;


UIPainter.drawListItem

Declaration

Source position: nvWidgets.pas line 175

public procedure UIPainter.drawListItem(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  isSelected: Boolean;

  isHover: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawPanel

Declaration

Source position: nvWidgets.pas line 189

public procedure UIPainter.drawPanel(

  const rect: Rect;

  const Text: ;

  const rt: Rect;

  const ra: Rect;

  isUnfold: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawRadioButton

Declaration

Source position: nvWidgets.pas line 169

public procedure UIPainter.drawRadioButton(

  const r: Rect;

  const Text: ;

  const rt: Rect;

  const rr: Rect;

  isOn: Boolean;

  isHover: Boolean;

  isFocus: Boolean;

  style: Integer

); virtual; abstract;


UIPainter.drawTextureView

Declaration

Source position: nvWidgets.pas line 192

public procedure UIPainter.drawTextureView(

  const rect: Rect;

  const texID: Integer;

  const rt: Rect;

  const rz: Rect;

  mipLevel: Integer;

  texelScale: Double;

  texelOffset: Double;

  r: Integer;

  g: Integer;

  b: Integer;

  a: Integer;

  style: Integer

); virtual; abstract;


UIPainter.getButtonRect

Declaration

Source position: nvWidgets.pas line 162

public function UIPainter.getButtonRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; virtual; abstract;


UIPainter.getCanvasMargin

Declaration

Source position: nvWidgets.pas line 195

public function UIPainter.getCanvasMargin: Integer; virtual;


UIPainter.getCanvasSpace

Declaration

Source position: nvWidgets.pas line 196

public function UIPainter.getCanvasSpace: Integer; virtual;


UIPainter.getCheckRect

Declaration

Source position: nvWidgets.pas line 165

public function UIPainter.getCheckRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out rc: Rect

):Rect; virtual; abstract;


UIPainter.getComboOptionsRect

Declaration

Source position: nvWidgets.pas line 181

public function UIPainter.getComboOptionsRect(

  const rCombo: Rect;

  numOptions: Integer;

  const options: array of ;

  out ri: Rect;

  out rit: Rect

):Rect; virtual; abstract;


UIPainter.getComboRect

Declaration

Source position: nvWidgets.pas line 180

public function UIPainter.getComboRect(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  selected: Integer;

  out rt: Rect;

  out ra: Rect

):Rect; virtual; abstract;


UIPainter.getFontHeight

Declaration

Source position: nvWidgets.pas line 197

public function UIPainter.getFontHeight: Integer; virtual;


UIPainter.getHorizontalSliderRect

Declaration

Source position: nvWidgets.pas line 171

public function UIPainter.getHorizontalSliderRect(

  const r: Rect;

  out rs: Rect;

  v: Double;

  out rc: Rect

):Rect; virtual; abstract;


UIPainter.getItemRect

Declaration

Source position: nvWidgets.pas line 174

public function UIPainter.getItemRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; virtual; abstract;


UIPainter.getLabelRect

Declaration

Source position: nvWidgets.pas line 159

public function UIPainter.getLabelRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out nbLines: Integer

):Rect; virtual; abstract;


UIPainter.getLineEditRect

Declaration

Source position: nvWidgets.pas line 185

public function UIPainter.getLineEditRect(

  const r: Rect;

  const Text: ;

  out rt: Rect

):Rect; virtual; abstract;


UIPainter.getListRect

Declaration

Source position: nvWidgets.pas line 177

public function UIPainter.getListRect(

  const r: Rect;

  numOptions: Integer;

  const options: array of ;

  out ri: Rect;

  out rt: Rect

):Rect; virtual; abstract;


UIPainter.getPanelRect

Declaration

Source position: nvWidgets.pas line 188

public function UIPainter.getPanelRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out ra: Rect

):Rect; virtual; abstract;


UIPainter.getPickedCharNb

Declaration

Source position: nvWidgets.pas line 200

public function UIPainter.getPickedCharNb(

  const Text: ;

  const at: Point

):Integer; virtual;


UIPainter.getRadioRect

Declaration

Source position: nvWidgets.pas line 168

public function UIPainter.getRadioRect(

  const r: Rect;

  const Text: ;

  out rt: Rect;

  out rr: Rect

):Rect; virtual; abstract;


UIPainter.getTextLineWidth

Declaration

Source position: nvWidgets.pas line 198

public function UIPainter.getTextLineWidth(

  const Text:

):Integer; virtual;


UIPainter.getTextSize

Declaration

Source position: nvWidgets.pas line 199

public function UIPainter.getTextSize(

  const Text: ;

  out nbLines: Integer

):Integer; virtual;


UIPainter.getTextureViewRect

Declaration

Source position: nvWidgets.pas line 191

public function UIPainter.getTextureViewRect(

  const rect: Rect;

  out rt: Rect

):Rect; virtual; abstract;


[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIPainter.init

Declaration

Source position: nvWidgets.pas line 204

public procedure UIPainter.init; virtual; abstract;