bool
CMsWin32Editbox::EditboxCreate( CMsWin32Window& parent           ,
                                const CString& windowTitle       ,
                                const bool createAsMultilineEdit ,
                                const Int32 xPosition            ,
                                const Int32 yPosition            ,
                                const UInt32 width               ,
                                const UInt32 height              ,
                                const bool readOnly              )
{GUCEF_TRACE;

    if ( 0 != GetHwnd() )
    {
        DestroyWindow( GetHwnd() );
        SetHwnd( 0 );
    }

    DWORD dwStyle = 0;
    if ( readOnly )
    {
        dwStyle |= ES_READONLY;
    }
    
    if ( createAsMultilineEdit )
    {        
        dwStyle |= WS_VISIBLE|WS_CHILD|WS_BORDER|WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|ES_AUTOHSCROLL|ES_AUTOVSCROLL;
        
        SetHwnd( CreateWindow( "edit", 
                               windowTitle.C_String(),
                               dwStyle,
                               xPosition, yPosition, (int)width, (int)height, 
                               parent.GetHwnd(), (HMENU)this, GetCurrentModuleHandle(), (LPVOID)this ) );
    }
    else
    {        
        dwStyle |= WS_VISIBLE|WS_CHILD|WS_BORDER|ES_AUTOHSCROLL|ES_AUTOVSCROLL;
        
        SetHwnd( CreateWindow( "edit", 
                               windowTitle.C_String(),
                               dwStyle,
                               xPosition, yPosition, (int)width, (int)height, 
                               parent.GetHwnd(), (HMENU)this, GetCurrentModuleHandle(), (LPVOID)this ) );
    }

    if ( GetHwnd() != 0 )
    {
        HookWndProc();
        return true;
    }            
    return false;
}
Beispiel #2
0
HwndWrapper::HwndWrapper(HWND hwnd) :
    painter(NULL), evtMgr(NULL), layoutRequested(false), firstLayout(true), 
    sizeToFit(false), centerContent(false), repaintRequested(false)
{
    if (hwnd)
        SetHwnd(hwnd);
}
Beispiel #3
0
HwndWrapper::HwndWrapper(HWND hwnd)
    : painter(nullptr),
      evtMgr(nullptr),
      layoutRequested(false),
      firstLayout(true),
      sizeToFit(false),
      centerContent(false),
      markedForRepaint(false) {
    if (hwnd)
        SetHwnd(hwnd);
}