PButton

This class implements all button-like controls. These are: Controls of these types send a PCmdEvt via PFormHandler::command() when selected.
Note: For repeating buttons, the command() handler function should return false to pretend it did not handle the event, otherwise the button won't repeat.

Synopsis

#include <PLButton.h>

Derivation

  • PControl
  • PButton
  • Constructors

        PButton(Pform* parent, Word id);
    
    Creates a list in a parent form from a resource id.

    Public functions

      PString text();
    
    Returns the label of the button. Don't rely on this function when using pop-up triggers!


      PButton text(const PString& label);
    
    Sets the label displayed in the control.


      PButton& click();
    
    Simulates a user click on the control.


      int val();
    
    Returns the current value (checked, non-checked, highlited (pushbuttons),...). Accurding to the PalmOS docs, this value is undefined for any controls other than checkboxes and pushbuttons.


      PButton val(int i);
    
    Sets the value of the button.


        ButtonPtr buttonPtr();
    
    Returns the ButtonPtr if the parent form is already shown, otherwise it returns 0. This can be used to access PalmOS APIs that are not implemented yet.


    See PControl for inherited public functions.

    Protected functions

    See PControl for inherited protected functions.