Example #1
0
int qt_f_TabsHandler(sXformsNode *head,xmlNode *node,struct sCbData **CallBackData,xmlDoc * modelDocPtr, CallBackInterfaceFunction func)
{
  //fprintf(stdout,"\n[%s][%d][head = %s,%s]",__func__,__LINE__,head->type,head->name);
 	head -> meta_info = strdup("1"); 
 	sXformsNodeAttr xf_trigger_attr = {"type","tab_trigger",(char *)0,(char *)0,(sXformsNodeAttr *)0,(sXformsNodeAttr *)0}; 
 	int flag_t = 1; 
 	sXformsNode *xftrigger = SearchSubTreeForNodes(head,(char *)"xf:trigger",&xf_trigger_attr,0,1); 
 	if( xftrigger != 0){ 
     char *propname[] = {"currentIndex"};
     char *proptype[] = {"number"};
     char *propval[] = {"0"};
    xmlNode *lblitem = CreateItemNode(node,0,itoa(row),int2str[0]);
     xmlNode *MaintabWidget  = Create1WidgetNode(lblitem,"TabWidget","QTabWidget",propname,proptype,propval,1);
     
     int i = 0; 
 	while( xftrigger != 0){ 
 		 
 		flag_t = 0; 
 		// search for xf:toggle inside this 
 		sXformsNode * toggle = SearchSubTreeForNodes(xftrigger,(char *)"xf:toggle",(sXformsNodeAttr *)0,0,0); 
 		if(toggle != 0){ 
 			toggle->meta_info = strdup("1"); 
 			sXformsNodeAttr *attr; 
 			for(attr = toggle->attr; attr; attr=attr->next){ 
 				if(!strcmp(attr->attrName,"case")){ 
 					sXformsNodeAttr xf_case_attr = {"id",attr->attrValue,(char *)0,(char *)0,(sXformsNodeAttr *)0,(sXformsNodeAttr *)0}; 
 					sXformsNode *tab_content = SearchSubTreeForNodes(head->par,(char *)"xf:case",&xf_case_attr,1,1); 
 					if(tab_content != 0){ 
 				printf("\n ========================== %s",xftrigger->name);
      xmlNode *TabWidget = Create1WidgetNode(MaintabWidget, sAppendString("Tab_",xftrigger->name),"QWidget",0,0,0,0);
      CreateStringAttribute(TabWidget,xftrigger->name);
      xmlNode *TabVerticalLayout = CreateLayout(TabWidget,"QVBoxLayout",sAppendString("Tab_VerticalLayout_",xftrigger->name) );
      xmlNode *TabVerticalLayoutItem = CreateItemNode(TabVerticalLayout,0,0,0);
      xmlNode *TabScrollWidget = Create1WidgetNode(TabVerticalLayoutItem,sAppendString("Tab_QScrollArea_",xftrigger->name),"QScrollArea",0,0,0,0);
      Create1PropertyNode(TabScrollWidget,"widgetResizable","bool", "true");
      xmlNode *TabScrollWidgetContent = Create1WidgetNode(TabScrollWidget,sAppendString("Tab_QScrollAreaContent_",xftrigger->name),"QWidget",0,0,0,0);
      Create1GeometryProp(TabScrollWidgetContent,"0", "0", "639","342");
      xmlNode *ContentLayout = CreateLayout(TabScrollWidgetContent,"QVBoxLayout",sAppendString("verticalLayout",xftrigger->name) );
      sQtGenerateUIFromTree(tab_content,ContentLayout ,CallBackData,modelDocPtr,func);
      i++; 
 					} 
 				} 
 			} 
 		}else{ 
 			//fprintf(stdout,"\n[%s][%d]ERROR MAKING TABS",__FILE__,__LINE__); 
 			exit(1); 
 		} 
 		xftrigger->meta_info = strdup("1"); 
 		xftrigger  =  SearchSubTreeForNodes(head,(char *)"xf:trigger",&xf_trigger_attr,0,1); 
 	}} 
 	else 
 	{ 
 	    //fprintf(stdout,"\n[%s:%s] COULD NOT PARSE",head->name,head->type); 
 	} 
     return 0; 
}
Example #2
0
    BOOL InitControls()
    {
        /* Create image list */
        hImageTreeView = ImageList_Create(TREEVIEW_ICON_SIZE, TREEVIEW_ICON_SIZE,
            GetSystemColorDepth() | ILC_MASK,
            0, 1);

        if (CreateLayout())
        {
            WCHAR szBuffer1[MAX_STR_LEN], szBuffer2[MAX_STR_LEN];

            InitApplicationsList();

            InitCategoriesList();

            LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, _countof(szBuffer2));
            StringCbPrintfW(szBuffer1, sizeof(szBuffer1),
                szBuffer2,
                m_ListView->GetItemCount());
            m_StatusBar->SetText(szBuffer1);
            return TRUE;
        }

        return FALSE;
    }
ImageSaveDlg::ImageSaveDlg( QWidget* aParent, FilteringDlg *aFilteringDlg )
    : QDialog( aParent )
    , mDisplayThread( NULL )
    , mSaveThrottling( MAXRATE )
    , mOneOutOf( 1 )
    , mMaxRate( 100 )
    , mAverageThroughput( 1 )
    , mCapturedSince( 0 )
    , mSaveEnabled( false )
    , mFrames( 0 )
    , mFPS( 0 )
    , mMbps( 0 )
    , mTotalSize( 0 )
    , mFormat( FORMAT_BMP )
    , mFilteringDlg( aFilteringDlg )
    , mCount( 0 )
{
#ifdef WIN32
    char myPictures[MAX_PATH];
	SHGetSpecialFolderPath(NULL, myPictures,CSIDL_MYPICTURES,true);

    mSavePath = myPictures;
#endif //WIN32

#ifdef _LINUX_
    //TODO: Find API call to get the proper default folder
    mSavePath = "";
#endif //_LINUX_
    CreateLayout();

    mPrevious.start();
    mStartTime.start();

    mSavePath = QDir::homePath();
}
Example #4
0
EbookControls *CreateEbookControls(HWND hwnd)
{
    CreateEbookStyles();

    if (!gCursorHand)
        gCursorHand  = LoadCursor(NULL, IDC_HAND);

    EbookControls *ctrls = new EbookControls;

    ctrls->next = new ButtonVector(svg::GraphicsPathFromPathData("M0 0  L10 13 L0 ,26 Z"));
    ctrls->next->SetStyles(styleBtnNextPrevDefault, styleBtnNextPrevMouseOver);

    ctrls->prev = new ButtonVector(svg::GraphicsPathFromPathData("M10 0 L0,  13 L10 26 z"));
    ctrls->prev->SetStyles(styleBtnNextPrevDefault, styleBtnNextPrevMouseOver);

    ctrls->progress = new ScrollBar();
    ctrls->progress->hCursor = gCursorHand;
    ctrls->progress->SetStyle(styleProgress);

    ctrls->status = new Button(NULL, styleStatus, styleStatus);

    ctrls->page = new PageControl();
    ctrls->page->SetStyle(stylePage);

    ctrls->mainWnd = new HwndWrapper(hwnd);
    ctrls->mainWnd->SetMinSize(Size(320, 200));
    ctrls->mainWnd->SetStyle(styleMainWnd);

    ctrls->mainWnd->AddChild(ctrls->next, ctrls->prev, ctrls->page);
    ctrls->mainWnd->AddChild(ctrls->progress, ctrls->status);
    CreateLayout(ctrls);
    return ctrls;
}
Example #5
0
GCPadWiiU::GCPadWiiU(MappingWindow* window) : MappingWidget(window)
{
  CreateLayout();
  ConnectWidgets();

  LoadSettings();
}
Example #6
0
WiiPane::WiiPane(QWidget* parent) : QWidget(parent)
{
  CreateLayout();
  LoadConfig();
  ConnectLayout();
  ValidateSelectionState();
}
Example #7
0
GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent)
{
  CreateLayout();
  ConnectLayout();

  LoadConfig();
}
Example #8
0
DevicesView::DevicesView()
	:
	BView("DevicesView", B_WILL_DRAW | B_FRAME_EVENTS)
{
	CreateLayout();
	RescanDevices();
	RebuildDevicesOutline();
}
Example #9
0
void MyFrame::OnRecreate( wxCommandEvent& event )
{
    OnRemove( event ); // first destroy active layout

    CreateLayout( mActiveLayoutNo );

    mLayouts[mActiveLayoutNo]->Activate();
}
Example #10
0
AdvancedPane::AdvancedPane(QWidget* parent) : QWidget(parent)
{
  CreateLayout();
  ConnectLayout();

  connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &AdvancedPane::Update);
  Update();
}
Example #11
0
// ==========================================================================
WarningDlg::WarningDlg( QWidget *aParent, const QString &aMessage, const QString &aCheckBoxLabel )
	: QDialog( aParent )
	, mMessage( aMessage )
	, mDontShowAgain( false )
	, mCheckBoxLabel( aCheckBoxLabel )
{
	CreateLayout();
}
Example #12
0
TitleBar::TitleBar(QWidget *parent) :
    QWidget(parent)
{
    this->setFixedHeight(32);
    CreateWidget();
    CreateLayout();
    SetWidgetStyle();
    m_bLeftButtonPressed = false;
}
Example #13
0
// =============================================================================
ProgressDlg::ProgressDlg( Thread* aThread, QWidget* aParent )	
    : QDialog( aParent )
    , mThread( aThread )
{
    CreateLayout();
    mTimer = new QTimer( this );
    mTimer->setInterval( 100 );
    connect( mTimer, SIGNAL( timeout() ), this, SLOT( OnTimer() ) );
    mTimer->start();
}
GCPadWiiUConfigDialog::GCPadWiiUConfigDialog(int port, QWidget* parent)
    : QDialog(parent), m_port{port}
{
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

  CreateLayout();

  LoadSettings();
  ConnectWidgets();
}
Example #15
0
GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent)
{
  CreateLayout();
  LoadConfig();

  ConnectLayout();

  connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
          &GeneralPane::OnEmulationStateChanged);
}
Example #16
0
CustomColorsWidget::CustomColorsWidget(QWidget *parent) :
	QWidget(parent)
{
	includeTitleRow = true;
	buttonsWide = 8;
	buttonsHigh = 4;
	selectedRow = 0;
	selectedCol = 0;

	CreateLayout();
	CreateButtons();
}
void InputLayoutManager::Initialize( )
{
	CreateLayout("Assets/Shader Output/Vertex_Lighting.cso",
				 VertexLight::InputElements,
				 VertexLight::InputElementCount,
				 VertexFormat::eVERTEX_LIGHT);

	CreateLayout("Assets/Shader Output/Vertex_Pos.cso",
				 //"VertexPosition",
				 VertexPosition::InputElements,
				 VertexPosition::InputElementCount,
				 VertexFormat::eVERTEX_POS);

	CreateLayout("Assets/Shader Output/Vertex_PosTex.cso",
				//"VertexPositionTexture",
				VertexPositionTexture::InputElements,
				VertexPositionTexture::InputElementCount,
				VertexFormat::eVERTEX_POSTEX);

	CreateLayout("Assets/Shader Output/Vertex_PosTexColor.cso",
				//"VertexPositionTexture",
				VertexPositionTextureColor::InputElements,
				VertexPositionTextureColor::InputElementCount,
				VertexFormat::eVERTEX_POSTEXCOLOR);

	CreateLayout("Assets/Shader Output/Vertex_PosNormTex.cso",
				 //"VertexPositionNormalTexture",
				 VertexPositionNormalTexture::InputElements,
				 VertexPositionNormalTexture::InputElementCount,
				 VertexFormat::eVERTEX_POSNORMTEX);

	CreateLayout("Assets/Shader Output/Vertex_PosNormTexSkinned.cso",
				 //"VertexPositionNormalTextureSkinned",
				 VertexPositionNormalTextureSkinned::InputElements,
				 VertexPositionNormalTextureSkinned::InputElementCount,
				 VertexFormat::eVERTEX_POSNORMTEXSKINNED);

	CreateLayout("Assets/Shader Output/Vertex_PosNormTexTanBit.cso",
				 //"VertexPositionNormalTextureTangentBiNormal",
				 VertexPositionNormalTextureTangentBiNormal::InputElements,
				 VertexPositionNormalTextureTangentBiNormal::InputElementCount,
				 VertexFormat::eVERTEX_POSNORMTEXTANBIN);

	CreateLayout("Assets/Shader Output/Vertex_PosNormTexTanBitSkinned.cso",
				 //"VertexPositionNormalTextureTangentBiNormalSkinned",
				 VertexPositionNormalTextureTangentBiNormalSkinned::InputElements,
				 VertexPositionNormalTextureTangentBiNormalSkinned::InputElementCount,
				 VertexFormat::eVERTEX_POSNORMTEXTANBINSKINNED);
}
Example #18
0
struct sCbData * sQtGenerateDesignerFile(sXformsNode *head,xmlDoc *modelDocPtr,CallBackInterfaceFunction func )
{
    xmlDoc *doc = NULL;
    xmlNode *root_node = NULL;
    xmlNode *current_node = NULL;
    /* required for every window */
    doc = xmlNewDoc(BAD_CAST"1.0");  // create a new document
    root_node = xmlNewNode(NULL,BAD_CAST"ui");  // root node
    CreateNodeAttribute(root_node,"version","4.0");
    xmlDocSetRootElement(doc, root_node); // set root node
    xmlNode *classname = Create1ObjectNode(root_node,"class", "SimpleUiQt"); // create main window
    xmlNode * classwidget = Create1WidgetNodeWithStringProp(root_node,"classwidget","QWidget","windowTitle",sQT_MAIN_WINDOW_NAME);
    Create1GeometryProp(classwidget,"0","0",QT_WINDOW_WIDTH, QT_WINDOW_HEIGHT);
    xmlNode *main_layout = CreateLayout(classwidget,"QVBoxLayout","verticalLayout_2");
     xmlNode *ContentItem = CreateItemNode(main_layout,0,0,0);
      xmlNode *gridLayout = CreateLayout(ContentItem,"QGridLayout","gridLayout_1");
       xmlNode *lowerBarItem = CreateItemNode(main_layout,0,0,0);
       xmlNode *horizontalLayout2 = CreateLayout(lowerBarItem,"QHBoxLayout","horizontalLayout2");
       xmlNode *horizontalLayout2Item = CreateItemNode(horizontalLayout2,0,0,0);
       xmlNode *horizontalLayout = CreateLayout(horizontalLayout2Item,"QHBoxLayout","horizontalLayout");
       xmlNode *spacer = CreateSpacer(horizontalLayout,"horizontalSpacer","Qt::Horizontal","40","20", 0,0 );
       xmlNode *DoneBtnItem = CreateItemNode(horizontalLayout,0,0,0);
       xmlNode *DoneBtn = Create1WidgetNodeWithStringProp(DoneBtnItem,sQT_CLOSE_BUTTON,"QPushButton","text","Done");
    
    xmlNode *layoutdefault = CreateXmlNode(NULL,"layoutdefault");
    CreateNodeAttribute(layoutdefault,"spacing","6");
    CreateNodeAttribute(layoutdefault,"margin","11");
    xmlNode *resources = CreateXmlNode(NULL,"resources");

    struct sCbData *temp = (struct sCbData  *)0;
    sQtGenerateUIFromTree(head,gridLayout,&temp,modelDocPtr,func);
    // main content area
    xmlSaveFormatFileEnc(sQT_UI_FILE, doc, "UTF-8", 1); // save file
    xmlFreeDoc(doc);  // free document
    xmlCleanupParser();  //clean parse
    //AppendNode(&temp,"NULL-REFERENCE", "NULL-INITVAL","NULL-VAL",sQT_CLOSE_BUTTON,"QPushButton",modelDocPtr,func);
    return temp;
}
void CScalableLayout::ZoomIn( CScalableNode::Ptr pNode )
{
	if (!pNode)
	{
		return;
	}

	m_pCurrentNode = pNode;
	m_pContainer->RemoveAll();
	m_pContainer->Add(CreateLayout(pNode,pNode->Level + 1));

	m_pStatusBar->SetVisible(pNode->Level > 0);
	m_pProgress->SetValue(m_nMaxLevel - pNode->Level + 1);
}
Example #20
0
memwindow::memwindow(QWidget *parent) :
		QWidget(parent) {
	this->vbox = new QVBoxLayout(this);
	this->option_line = new QHBoxLayout(this);
	this->console_line = new QHBoxLayout(this);

	QtclConsole *console =
			QtclConsole::getInstance(parent,
					"Welcome to <b>Qt / Memory Compiler SOI018</b> !<br>"
							"For any remarks, please mail me at: <font color=blue>[email protected]</font><br><br>");

    this->mcs = ::mcs;
	CreateLayout(console);

}
Example #21
0
PvDualSourceSample::PvDualSourceSample( QWidget *parent, Qt::WFlags flags )
    : QMainWindow( parent, flags )
    , mSource1( NULL )
    , mSource2( NULL )
    , mCommunicationBrowser( NULL )
    , mDeviceBrowser( NULL )
    , Stream1Browser( NULL )
    , Stream2Browser( NULL )
{
    CreateLayout();

    Stream2Browser = new PvGenBrowserWnd;
    Stream1Browser = new PvGenBrowserWnd;
    mDeviceBrowser = new PvGenBrowserWnd;
    mCommunicationBrowser = new PvGenBrowserWnd;
}
Example #22
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
#ifdef ARM
    setWindowFlags(Qt::FramelessWindowHint);
#endif

    m_shangChun = new Shangchuan;

    //network Information
    QList<QNetworkInterface> NetInterfaceList;
    NetInterfaceList = QNetworkInterface::allInterfaces();
    foreach(QNetworkInterface net, NetInterfaceList)
    {
        if (net.name() == "eth0")
        {
            m_strDevID = net.hardwareAddress();
            break;
        }
    }
    Global::g_DevID = m_strDevID.toStdString();

    CreateLayout();

    QWidget* centralWidget = new QWidget;
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(layout);
    mainLayout->addLayout(gridlayout);
    centralWidget->setLayout(mainLayout);
    setCentralWidget(centralWidget);
    this->setFixedSize(800,480);

    CreateStatusbar();

    SetUnUpCount();

    m_fileUpLoad = FileUpload::getFileUpload();

    QTimer* netTimer = new QTimer;
    connect(netTimer, SIGNAL(timeout()), this, SLOT(onlineStateChange()));
    netTimer->start(10000);

    //if (!Global::s_netState)
    //    startUsbScan();
}
void SDistributionCurveEditor::Construct(const FArguments& InArgs)
{
	SharedData = MakeShareable(new FCurveEditorSharedData(InArgs._EdSetup));
	SharedData->NotifyObject = InArgs._NotifyObject;

	// Register our commands. This will only register them if not previously registered
	FCurveEditorCommands::Register();

	for (int32 TabIdx = 0; TabIdx < SharedData->EdSetup->Tabs.Num(); TabIdx++)
	{
		FCurveEdTab* Tab = &SharedData->EdSetup->Tabs[TabIdx];
		TabNames.Add(MakeShareable(new FString(Tab->TabName)));
	}

	BindCommands();

	CreateLayout(InArgs._CurveEdOptions);
}
GradientSliderWidget::GradientSliderWidget(QWidget *parent) :
	QWidget(parent),
	minLabel(0),
	maxLabel(0),
	gradientFrame(0)
{
	sliderWidth = TriangleSliderButton::sliderWidth;
	sliderHeight = TriangleSliderButton::sliderHeight;

	sliderTop = 0;
	sliderBottom = 0;
	sliderX = 0;
	pressedSlider = 0;

	minValue = 0.0;
	maxValue = 1.0;

	CreateLayout();
}
Example #25
0
void SaveLayout(char *name, Canvas *cv)
{
	Layout *lay;
	Canvas *fcv;
	for (lay = layouts; lay; lay = lay->lay_next)
		if (!strcmp(lay->lay_title, name))
			break;
	if (lay)
		FreeLayoutCv(&lay->lay_canvas);
	else
		lay = CreateLayout(name, 0);
	if (!lay)
		return;
	fcv = D_forecv;
	DupLayoutCv(cv, &lay->lay_canvas, true);
	lay->lay_forecv = D_forecv;
	D_forecv = fcv;
	D_layout = lay;
}
Example #26
0
void NewLayout(char *title, int startat)
{
	Layout *lay;
	Canvas *fcv;

	lay = CreateLayout(title, startat);
	if (!lay)
		return;

	if (display) {
		LoadLayout(0);
		fcv = D_forecv;
		DupLayoutCv(&D_canvas, &lay->lay_canvas, true);
		lay->lay_forecv = D_forecv;
		D_forecv = fcv;
		D_layout = lay;
	} else {
		layout_attach = lay;
	}
	lay->lay_autosave = 1;
}
void ImageBrowser5D::Setup()
{
	if(!img) return;

	for(int c=0; c<img->GetImageInfo()->numChannels; ++c)
		m_chflag.push_back(true);
	
	CreateObjects();
	CreateLayout();
	CreateLookupTable();
	CreateVolumeProperties();
	CreateInteractorStyle();

	UpdateVSlider();
	UpdateHSlider();
	UpdateRenderer();

	this->resize(img->GetImageInfo()->numColumns, img->GetImageInfo()->numRows);
	this->setAttribute ( Qt::WA_DeleteOnClose );
	this->setWindowTitle(tr("Image Browser"));
}
Example #28
0
void Base::SetUpBase(BaseData *currentbase)
{
	//dbout<<"Setting up base"<<endl;
	lasttick = timeGetTime();
	angle = 0;
	storeangle = ship[player].angle;
	DuplicatePlayer(&ship[player],&dummy);
	screen = HOME;
	buttonselector = 0;
	listselector = 0;
	selectbar = -1;
	frame = 0;
	data = currentbase;
	messageindex = 0;
	newmessagetime = thistick;

	CreateLayout(player);

	for(int i=0;i<3;i++)
	{
		meter[i].x = layout.meterposition[i].x;
		meter[i].y = layout.meterposition[i].y;
	}

	meter[0].maxvalue = MAXPOWERMETERVALUE;
	meter[0].value = dummy.maxpower;
	meter[0].type = MPOWER;
	meter[1].maxvalue = MAXENERGYMETERVALUE;
	meter[1].value = dummy.maxenergy;
	meter[1].type = MENERGY;
	meter[2].maxvalue = MAXSPEEDMETERVALUE;
	meter[2].value = dummy.forwardsspeed;
	meter[2].type = MSPEED;

	sprintf_s(messagestring,1024,"Landing charge %d",currentbase->landingcharge);
	soundeffect[SP_BASE_SYSTEMS_ACTIVATED].SetSoundEffect(0);
	//dbout<<"Base setup complete"<<endl;
}
CContainerUI * CScalableLayout::CreateLayout( CScalableNode::Ptr pNode,int nLevel )
{
	CContainerUI *pLayout = pNode->IsHor ?
		static_cast<CContainerUI*>(new CHorizontalLayoutUI) : 
		static_cast<CContainerUI*>(new CVerticalLayoutUI);

	pLayout->SetBkColor(pNode->BkColor);

	for (CScalableNode::Iter i = pNode->ChildBegin();
		i != pNode->ChildEnd();
		i++)
	{
		bool bLeaf = true;
		for (CScalableNode::Iter j = (*i)->ChildBegin();
			j != (*i)->ChildEnd();
			j++)
		{
			if ((*j)->Level == nLevel)
			{
				bLeaf = false;
				break;
			}
		}
		if (bLeaf)
		{
			CContainerUI *pItemContainer = new CContainerUI;
			CButtonUI *pItem = new CButtonUI;
			pItem->SetName((*i)->Name);
			pItem->SetBkColor((*i)->BkColor);

			pItem->SetShowHtml();
			pItem->SetTextStyle(DT_CENTER|DT_VCENTER);
			
			CDuiString sText;
			if ((*i)->Text.IsEmpty())
			{
				sText.Format(_T("{p}{c #FFCCCCCC}%s{/c}{/p}"),
					(LPCTSTR)(*i)->Description);
			}
			else
			{
				sText.Format(_T("{p}%s{n}{c #FFCCCCCC}%s{/c}{/p}"),
					(LPCTSTR)(*i)->Text,(LPCTSTR)(*i)->Description);
			}
			pItem->SetText(sText);
			
			pItemContainer->Add(pItem);

			pLayout->Add(pItemContainer);
		}
		else
		{
			pLayout->Add(CreateLayout(*i,nLevel));
		}
	}


	if (!pNode->Description.IsEmpty())
	{
		CVerticalLayoutUI *pWrapper = new CVerticalLayoutUI;
		pWrapper->Add(pLayout);

		pLayout->SetInset(CDuiRect(5,5,5,0));

		CLabelUI *pDescription = new CLabelUI;
		pDescription->SetFixedHeight(20);
		pDescription->SetTextStyle(DT_CENTER);
		pDescription->SetBkColor(pNode->BkColor);

		pDescription->SetText(pNode->Description);
		pWrapper->Add(pDescription);

		return pWrapper;
	}

	return pLayout;
}
Example #30
0
MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h)
    : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)),
    mpNestedLayout( NULL ),
    mpAboutBoxLayout( NULL ),

    mActiveLayoutNo( FIRST_LAYOUT ),
    mAutoSave( true ),
    mSavedAlready( false ),
    mpClntWindow( NULL ),

    mImageList( 16,16, false, 2 )
{
    int i;

    mpInternalFrm = (wxPanel*)this;

    mAboutBox.Create( this, wxID_ANY,  _T("About box in wxWidgets style..."),
                      wxDefaultPosition,
                      wxSize( 385,220),
                      wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );

    for( i = 0; i != MAX_LAYOUTS; ++i )
        mLayouts[i] = NULL;

    // image-list is one of the few objects which
    // currently cannot be serialized, create it first
    // and use it as initial reference (IR)

    wxBitmap bmp1,bmp2;

    if ( wxFileExists( wxString(wxT(BMP_DIR)) + wxT("folder_icon.bmp") ) )
        bmp1.LoadFile( wxString(wxT(BMP_DIR)) + wxT("folder_icon.bmp"), wxBITMAP_TYPE_BMP );

    if ( wxFileExists( wxString(wxT(BMP_DIR)) + wxT("class_icon1.bmp") ) )
        bmp2.LoadFile( wxString(wxT(BMP_DIR)) + wxT("class_icon1.bmp"), wxBITMAP_TYPE_BMP );

    mImageList.Add( bmp1 );
    mImageList.Add( bmp2 );

    InitAboutBox();

    // create multiple layouts

    mpNestedLayout = 0;

    mpClntWindow = CreateTxtCtrl(wxT("client window"));

    // Create all layouts
    for( i = 0; i != MAX_LAYOUTS; ++i )
    {
        CreateLayout( i );
    }
    // hide others
    for( i = SECOND_LAYOUT; i != MAX_LAYOUTS; ++i )
    {
        mLayouts[i]->HideBarWindows();
    }

    // activate first one
    mLayouts[FIRST_LAYOUT]->Activate();
    mActiveLayoutNo = FIRST_LAYOUT;
}