Back to index

nux  3.0.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
ProgramTemplate Class Reference

#include <ProgramTemplate.h>

Inheritance diagram for ProgramTemplate:
Inheritance graph
[legend]
Collaboration diagram for ProgramTemplate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ProgramTemplate (const char *program_name, int window_width, int window_height, int program_life_span)
virtual ~ProgramTemplate ()
virtual void Startup ()
virtual void UserInterfaceSetup ()
virtual void Run ()
bool ReadyToGo ()
nux::WindowThreadGetWindowThread ()

Public Attributes

std::string program_name_
int program_life_span_
 The program will auto-terminate after a delay in milliseconds.
nux::TimeOutSignaltimeout_signal_
nux::WindowThreadwindow_thread_
int window_width_
int window_height_

Private Member Functions

void ProgramExitCall (void *data)
void WaitForConfigureEvent (int x, int y, int width, int height)

Private Attributes

bool ready_to_go_

Detailed Description

Definition at line 30 of file ProgramTemplate.h.


Constructor & Destructor Documentation

ProgramTemplate::ProgramTemplate ( const char *  program_name,
int  window_width,
int  window_height,
int  program_life_span 
)

Definition at line 29 of file ProgramTemplate.cpp.

{
  ready_to_go_ = false;
  window_width_ = window_width;
  window_height_ = window_height;

  if (window_width_ < 100)
    window_width_ = 100;

  if (window_height_ < 100)
    window_height_ = 100;

  timeout_signal_ = NULL;
  window_thread_ = NULL;
  program_name_ = program_name;
  program_life_span_ = program_life_span;

  if (program_life_span_ > 0 && program_life_span_ < 1000)
  {
    // Minimum life span is 1 second.
    program_life_span_ = 1000;
  }
}

Definition at line 56 of file ProgramTemplate.cpp.

{
  if (window_thread_)
    delete window_thread_;
}

Member Function Documentation

Definition at line 104 of file ProgramTemplate.cpp.

{
  return window_thread_;
}

Here is the caller graph for this function:

void ProgramTemplate::ProgramExitCall ( void *  data) [private]

Definition at line 109 of file ProgramTemplate.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 99 of file ProgramTemplate.cpp.

{
  return window_thread_;
}

Here is the caller graph for this function:

void ProgramTemplate::Run ( ) [virtual]

Definition at line 84 of file ProgramTemplate.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ProgramTemplate::Startup ( ) [virtual]

Definition at line 62 of file ProgramTemplate.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in HGridKeyNavigationTest, HLayoutKeyNavigationTest, TestTextEntry, VLayoutKeyNavigationTest, EventsTest, TextTextEntry, TextTextEntry, TextTextEntry, ButtonEventsTest, ScrollBarTest, TestButton, FocusOnMouseDownTest, FocusOnMouseEnterTest, and KeyNavDirectionTest.

Definition at line 70 of file ProgramTemplate.cpp.

{
  // nux::VLayout *MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);
  // nux::TextEntry *text_entry_0 = new nux::TextEntry(TEXT("0123456789abcdefghij"), NUX_TRACKER_LOCATION);

  // MainVLayout->AddView(text_entry_0, 0, nux::eCenter, nux::eFull);
  // MainVLayout->SetVerticalInternalMargin(10);
  // MainVLayout->SetContentDistribution(nux::eStackCenter);

  // nux::GetWindowThread()->SetLayout(MainVLayout);
  // nux::ColorLayer background(nux::Color(0xFF4D4D4D));
  // window_thread_->SetWindowBackgroundPaintLayer(&background);
}
void ProgramTemplate::WaitForConfigureEvent ( int  x,
int  y,
int  width,
int  height 
) [private]

Definition at line 115 of file ProgramTemplate.cpp.

{
  ready_to_go_ = true;
}

Here is the caller graph for this function:


Member Data Documentation

The program will auto-terminate after a delay in milliseconds.

Definition at line 46 of file ProgramTemplate.h.

Definition at line 45 of file ProgramTemplate.h.

Definition at line 56 of file ProgramTemplate.h.

Definition at line 47 of file ProgramTemplate.h.

Definition at line 51 of file ProgramTemplate.h.

Definition at line 48 of file ProgramTemplate.h.

Definition at line 50 of file ProgramTemplate.h.


The documentation for this class was generated from the following files: