Back to index

nux  3.0.0
Functions
text_entry_focus.cpp File Reference
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextEntry.h"

Go to the source code of this file.

Functions

void ThreadWidgetInit (nux::NThread *thread, void *InitData)
int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file text_entry_focus.cpp.

{
    nux::NuxInitialize(0);
    nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Text Entry"), 400, 300, 0, &ThreadWidgetInit, 0);
    wt->Run(NULL);

    delete wt;
    return 0;
}

Here is the call graph for this function:

void ThreadWidgetInit ( nux::NThread thread,
void *  InitData 
)

Definition at line 27 of file text_entry_focus.cpp.

{
    nux::VLayout* MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);

    nux::TextEntry* text_entry_0 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);

    nux::TextEntry* text_entry_1 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);

    nux::TextEntry* text_entry_2 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);

    text_entry_0->SetMaximumWidth(300);
    text_entry_0->SetMinimumHeight (20);
    text_entry_0->SetCompletion("test completion");

    text_entry_1->SetMaximumWidth(300);
    text_entry_1->SetMinimumHeight (20);

    text_entry_2->SetMaximumWidth(300);
    text_entry_2->SetMinimumHeight (20);

    MainVLayout->AddView(text_entry_0, 0, nux::eCenter, nux::eFull);
    MainVLayout->AddView(text_entry_1, 0, nux::eCenter, nux::eFull);
    MainVLayout->AddView(text_entry_2, 0, nux::eCenter, nux::eFull, 1.0, nux::NUX_LAYOUT_BEGIN);

    MainVLayout->SetVerticalInternalMargin(10);

    MainVLayout->SetContentDistribution(nux::eStackCenter);
    nux::GetWindowThread ()->SetLayout(MainVLayout);
    nux::ColorLayer background(nux::Color(0xFF4D4D4D));
    static_cast<nux::WindowThread*>(thread)->SetWindowBackgroundPaintLayer(&background);
}

Here is the call graph for this function:

Here is the caller graph for this function: