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

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.

Example code how to implement a button

none.Rect(0, 0);
ui.beginGroup(GroupFlags_GrowDownFromRight);
  if ui.doButton(none, 'Apply') then
  begin
    //code to apply your changes
  end;
ui.endGroup;