AUI_ERRCODE ChatWindow::InitCommonLdl(MBCHAR *ldlBlock) { MBCHAR controlBlock[k_AUI_LDL_MAXBLOCK + 1]; AUI_ERRCODE errcode = AUI_ERRCODE_OK; sprintf(controlBlock, "%s.%s", ldlBlock, "ChatTextBox"); m_textBox = new c3_HyperTextBox(&errcode, aui_UniqueId(), controlBlock, NULL, NULL); Assert( AUI_NEWOK(m_textBox, errcode) ); if ( !AUI_NEWOK(m_textBox, errcode) ) return AUI_ERRCODE_MEMALLOCFAILED; AddControl(m_textBox); sprintf(controlBlock, "%s.%s", ldlBlock, "ChatTextField"); m_textField = new C3TextField(&errcode, aui_UniqueId(), controlBlock, ChatWindow::ChatCallback, (void *)this); Assert( AUI_NEWOK(m_textField, errcode) ); if ( !AUI_NEWOK(m_textField, errcode) ) return AUI_ERRCODE_MEMALLOCFAILED; m_textField->SetMaxFieldLen(k_CHATBOX_LINE_LENGTH); AddControl(m_textField); SetDraggable(TRUE); m_grabRegion->Move(0, 0); m_grabRegion->Resize(m_width, m_height); Move(0, g_radarWindow->Y() - m_height); return AUI_ERRCODE_OK; }
UI_Camera::UI_Camera(Base_Camera* camera) : cWidgetBase(0), Camera(0){ Self_Counter+=1; assert(Self_Counter==1); Set_Camera(camera); SetControlBounds(MY_UI::Utilities::Rect(0, 0, MAX_WINDOWSIZE, MAX_WINDOWSIZE)); SetClientBounds(MY_UI::Utilities::Rect(0, 0, MAX_WINDOWSIZE, MAX_WINDOWSIZE)); SetDraggable(true); SetName("UI_Camera"); MY_UI::GetApplicationLayer()->SetCamera(this); }
JLocator::JLocator() { m_Pos = Vec3::null; m_bScreenSpace = true; m_Rotation = 0.0f; m_Dir = Vec3::oZ; // FIXME: Locator should be derived from JObject, not JWidget SetXAlign( XAlign_Parent ); SetYAlign( YAlign_Parent ); SetDraggable( true ); } // JLocator::JLocator
AUI_ERRCODE UITestWindow::InitCommon( void ) { AUI_ERRCODE errcode = AUI_ERRCODE_OK; SetDraggable(TRUE); m_button1 = new IconButton( &errcode, aui_UniqueId(), 20, 37, 32, 32, "upba0104.tif", k_MESSAGE_ICON_EVENT, 0 ); Assert( AUI_NEWOK( m_button1, errcode )); if ( !AUI_NEWOK( m_button1, errcode )) return AUI_ERRCODE_MEMALLOCFAILED; errcode = AddControl( m_button1 ); Assert( errcode == AUI_ERRCODE_OK ); if ( errcode != AUI_ERRCODE_OK ) return errcode; m_button1Action = new Button1Action( ); Assert( m_button1Action != NULL ); if ( m_button1Action == NULL ) return AUI_ERRCODE_MEMALLOCFAILED; m_button1->SetAction( m_button1Action ); m_button2 = new IconButton( &errcode, aui_UniqueId(), 54, 37, 32, 32, "upba0104.tif", k_MESSAGE_ICON_DIPLOMATIC, 0 ); Assert( AUI_NEWOK( m_button2, errcode )); if ( !AUI_NEWOK( m_button2, errcode )) return AUI_ERRCODE_MEMALLOCFAILED; errcode = AddControl( m_button2 ); Assert( errcode == AUI_ERRCODE_OK ); if ( errcode != AUI_ERRCODE_OK ) return errcode; m_button2Action = new Button2Action( ); Assert( m_button2Action != NULL ); if ( m_button2Action == NULL ) return AUI_ERRCODE_MEMALLOCFAILED; m_button2->SetAction( m_button2Action ); return AUI_ERRCODE_OK; }
//---------------------------------------------------------------------------- DragDropLink::DragDropLink(DragDropPort* pFrom, DragDropPort* pTo) : inherited(1){ //---------------------------------------------------------------------------- PROC_TRACE; assert(pFrom != NULL); assert(pTo != NULL); m_pFrom = pFrom; m_pTo = pTo; pFrom->AddLink(this); pTo->AddLink(this); SetDraggable(FALSE); }
void Window::ReadProperties(tinyxml2::XMLElement* element) { cchar* cstring = element->Attribute("draggable"); if (cstring != 0) SetDraggable(xaih::StrToBool(cstring)); cstring = element->Attribute("dragAreaX"); // if (cstring != 0) cstring = element->Attribute("dragAreaY"); // if (cstring != 0) cstring = element->Attribute("dragAreaW"); // if (cstring != 0) cstring = element->Attribute("dragAreaH"); // if (cstring != 0) }
MY_UI::Controls::Simple_Window::Simple_Window(cWidgetBase* parent) : cWidgetBase(parent) { SetName("Simple Window"); SetControlBounds(Utilities::Rect(0, 0, 100, 100)); SetClientBounds(Utilities::Rect(0, 0, 100, 100)); auto skin = MY_UI::Internal::WidgetSkin; // setting the controls to NULL means that they will not be inserted in the children array Background = new Image(this); Background->Add_Texture(skin->Window_Without_Focus);// take a copy of the UI skin for the texture Background->Add_Texture(skin->Window_With_Focus);// take a copy of the UI skin for the texture Background->Set_ShownImage(0); Background->SetName("Background"); Background->SetImageBorderSize(1,1); Background->SetBorderDrawn(true); DeCouple(Background); SetDraggable(true); OnLeftDrag.Add(std::bind( &MY_UI::Controls::Simple_Window::Dragging, this)); SetSize(100, 100); }