コード例 #1
0
MenuPanel::MenuPanel(MenuElements& elements,
                     const sf::Vector2f& position) :
    m_position(position)
{
    for(auto button = begin(elements.buttons); button != end(elements.buttons); ++button)
        createButton(*button);

    for(auto checkbox = begin(elements.checkboxes); checkbox != end(elements.checkboxes); ++checkbox)
        createCheckBox(*checkbox);

    for(auto slider = begin(elements.slider); slider != end(elements.slider); ++slider)
        createSlider(*slider);

    for(auto label = begin(elements.labels); label != end(elements.labels); ++label)
        createLabel(*label);

    for(auto sprite = begin(elements.sprites); sprite != end(elements.sprites); ++sprite)
        createSprite(*sprite);
    
    for(auto inputbox = begin(elements.infobox); inputbox != end(elements.infobox); ++inputbox)
        createInputBox(*inputbox);

    for(auto it = begin(elements.animationContainer); it != end(elements.animationContainer); ++it)
        createAnimationContainer(std::move(*it));

    setCorrelation();
    std::sort(m_elements.begin(), m_elements.end(), 
        [](const std::unique_ptr<MenuElement>& a, const std::unique_ptr<MenuElement>& b) -> bool
    { 
        return a->getId() < b->getId(); 
    });
}
コード例 #2
0
void ControllerWindow::createTypeGroupBox()
{
    widgetTypeGroupBox = new QGroupBox(tr("Widget Type"));
    previewWidgetButton = createRadioButton(tr("QWidget"));
    previewWidgetButton->setChecked(true);
    previewDialogButton = createRadioButton(tr("QDialog"));
    QHBoxLayout *l = new QHBoxLayout;
    l->addWidget(previewWidgetButton);
    l->addWidget(previewDialogButton);
    widgetTypeGroupBox->setLayout(l);

    additionalOptionsGroupBox = new QGroupBox(tr("Additional options"));
    l = new QHBoxLayout;
    modalWindowCheckBox = createCheckBox(tr("Modal window"));
    fixedSizeWindowCheckBox = createCheckBox(tr("Fixed size window"));
    l->addWidget(modalWindowCheckBox);
    l->addWidget(fixedSizeWindowCheckBox);
    additionalOptionsGroupBox->setLayout(l);

    typeGroupBox = new QGroupBox(tr("Type"));

    windowRadioButton = createRadioButton(tr("Window"));
    dialogRadioButton = createRadioButton(tr("Dialog"));
    sheetRadioButton = createRadioButton(tr("Sheet"));
    drawerRadioButton = createRadioButton(tr("Drawer"));
    popupRadioButton = createRadioButton(tr("Popup"));
    toolRadioButton = createRadioButton(tr("Tool"));
    toolTipRadioButton = createRadioButton(tr("Tooltip"));
    splashScreenRadioButton = createRadioButton(tr("Splash screen"));
    windowRadioButton->setChecked(true);

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(windowRadioButton, 0, 0);
    layout->addWidget(dialogRadioButton, 1, 0);
    layout->addWidget(sheetRadioButton, 2, 0);
    layout->addWidget(drawerRadioButton, 3, 0);
    layout->addWidget(popupRadioButton, 0, 1);
    layout->addWidget(toolRadioButton, 1, 1);
    layout->addWidget(toolTipRadioButton, 2, 1);
    layout->addWidget(splashScreenRadioButton, 3, 1);
    typeGroupBox->setLayout(layout);
}
コード例 #3
0
ファイル: DevSettings.cpp プロジェクト: gitter-badger/vpaint
DevSettings::DevSettings()
{
    s = this;
    layout_ = new QGridLayout();
    numWidgets_ = 0;

    addSection("Cutting");

    createCheckBox("reverse cut", false);
    createCheckBox("mobius cut", false);

    addSection("Inbetweening");

    createCheckBox("inverse direction", false);

    addSection("Rendering");

    createCheckBox("draw edge orientation", false);

    createSpinBox("num sub", 0, 10, 2);
    createDoubleSpinBox("ds", 0, 10, 2);

    setLayout(layout_);
}
コード例 #4
0
NewAccountDialog::NewAccountDialog( GuiFactory* factory )
    : GeneralDialogBox(factory,factory->getLanguageManager(),factory->getGuiColorManager(),factory->getFontManager())
{
    setTitle("account.create");
    setOkText("account.create");
    addLabel("fields.required");
    m_txtUsername = createTextField("username");
    m_txtPassword = createTextField("password");
    m_txtConfirmPassword = createTextField("confirm.password");
    m_txtEmail = createTextField("email",DIALOG_TEXT_LONG);
    //	m_txtConfirmEmail = createTextField("email.confirm",DIALOG_TEXT_LONG);
    //std::vector<std::string> items;
    //items.push_back("gender.male");
    //items.push_back("gender.female");
    //m_gender = createDropdown("gender.gender","gender.gender",items);
    //m_birthday = createDate("birthday");
    //m_txtPassphrase = createTextField("security.phrase");
    m_cbAge = createCheckBox("");
    m_cbAge->setText(getFactory()->getLanguageManager()->getElementWithArg("over.age","13"));

    addLabel("fields.optional");
    m_txtFirstName = createTextField("first.name");
    m_txtLastName = createTextField("last.name");

    DataValidator dv;

    m_txtFirstName->setMaxLength(25);
    m_txtLastName->setMaxLength(25);
    m_txtUsername->setMaxLength(dv.getMaxUsernameLength());
    m_txtPassword->setIsPassword(true);
    m_txtPassword->setMaxLength(20);
    m_txtConfirmPassword->setIsPassword(true);
    m_txtConfirmPassword->setMaxLength(20);
    m_txtEmail->setMaxLength(35);
    //m_txtConfirmEmail->setMaxLength(35);

}
コード例 #5
0
ファイル: kggeneral.cpp プロジェクト: KDE/krusader
void KgGeneral::createViewerTab()
{
    QWidget *tab = createTab(i18n("Viewer/Editor"));
    QGridLayout *tabLayout = new QGridLayout(tab);
    tabLayout->setSpacing(6);
    tabLayout->setContentsMargins(11, 11, 11, 11);

    tabLayout->addWidget(createCheckBox("General", "View In Separate Window", _ViewInSeparateWindow,
                                   i18n("Internal editor and viewer opens each file in a separate window"), tab, false,
                                   i18n("If checked, each file will open in a separate window, otherwise, the viewer will work in a single, tabbed mode"), PAGE_VIEWER));

    // ------------------------- viewer ----------------------------------

    QGroupBox *viewerGrp = createFrame(i18n("Viewer"), tab);
    tabLayout->addWidget(viewerGrp, 1, 0);

    QGridLayout *viewerGrid = createGridLayout(viewerGrp);

    QWidget * hboxWidget2 = new QWidget(viewerGrp);
    QHBoxLayout * hbox2 = new QHBoxLayout(hboxWidget2);

    QWidget * vboxWidget = new QWidget(hboxWidget2);
    QVBoxLayout * vbox = new QVBoxLayout(vboxWidget);

    vbox->addWidget(new QLabel(i18n("Default viewer mode:"), vboxWidget));

    KONFIGURATOR_NAME_VALUE_TIP viewMode[] =
        //            name            value    tooltip
    {{ i18n("Generic mode"),  "generic", i18n("Use the system's default viewer") },
        { i18n("Text mode"), "text",  i18n("View the file in text-only mode") },
        { i18n("Hex mode"), "hex",  i18n("View the file in hex-mode (better for binary files)") },
        { i18n("Lister mode"), "lister",  i18n("View the file with lister (for huge text files)") }
    };

    vbox->addWidget(createRadioButtonGroup("General", "Default Viewer Mode",
                                           "generic", 0, 4, viewMode, 4, vboxWidget, false, PAGE_VIEWER));


    vbox->addWidget(
        createCheckBox("General", "UseOktetaViewer", _UseOktetaViewer, i18n("Use Okteta as Hex viewer"), vboxWidget, false,
                       i18n("If available, use Okteta as Hex viewer instead of the internal viewer"), PAGE_VIEWER)
                   );

    QWidget * hboxWidget4 = new QWidget(vboxWidget);
    QHBoxLayout * hbox4 = new QHBoxLayout(hboxWidget4);

    QLabel *label5 = new QLabel(i18n("Use lister if the text file is bigger than:"), hboxWidget4);
    hbox4->addWidget(label5);
    KonfiguratorSpinBox *spinBox = createSpinBox("General", "Lister Limit", _ListerLimit,
                                   0, 0x7FFFFFFF, hboxWidget4, false, PAGE_VIEWER);
    hbox4->addWidget(spinBox);
    QLabel *label6 = new QLabel(i18n("MB"), hboxWidget4);
    hbox4->addWidget(label6);

    vbox->addWidget(hboxWidget4);

    hbox2->addWidget(vboxWidget);

    viewerGrid->addWidget(hboxWidget2, 0, 0);


    // ------------------------- editor ----------------------------------

    QGroupBox *editorGrp = createFrame(i18n("Editor"), tab);
    tabLayout->addWidget(editorGrp, 2, 0);
    QGridLayout *editorGrid = createGridLayout(editorGrp);

    QLabel *label1 = new QLabel(i18n("Editor:"), editorGrp);
    editorGrid->addWidget(label1, 0, 0);
    KonfiguratorURLRequester *urlReq = createURLRequester("General", "Editor", "internal editor",
                                       editorGrp, false, PAGE_VIEWER, false);
    editorGrid->addWidget(urlReq, 0, 1);

    QLabel *label2 = new QLabel(i18n("Hint: use 'internal editor' if you want to use Krusader's fast built-in editor"), editorGrp);
    editorGrid->addWidget(label2, 1, 0, 1, 2);
}
コード例 #6
0
ファイル: TuiManager.cpp プロジェクト: Kudoo/Tui-x
void TuiManager::parseControl(Node* container,xml_node<char> *item)
{ 
	int tag = atof(item->first_attribute("tag")->value());
	int x = atof(item->first_attribute("x")->value());
	int y = atof(item->first_attribute("y")->value());
	int w = atoi(item->first_attribute("width")->value());
	int h = atoi(item->first_attribute("height")->value());
	int rotation = atof(item->first_attribute("rotation")->value());

	if(strcmp(item->first_attribute("type")->value(), kTuiContainerPanel) == 0){//panel
		CWidgetWindow* pPanel = createPanel(tag,x,y,w,h,rotation);
		container->addChild(pPanel);
		//recursive
		for( xml_node<char> *iitem = item->first_node( kTuiNodeControl );iitem != NULL; iitem = iitem->next_sibling()){
			parseControl(pPanel,iitem);
		}

	}else if (strcmp(item->first_attribute("type")->value(), kTuiControlCell) == 0){//cell
		//recursive
		for (xml_node<char> *iitem = item->first_node(kTuiNodeControl); iitem != NULL; iitem = iitem->next_sibling()){
			parseControl(container, iitem);
		}

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlImage) == 0){//image
		const char* file = item->first_attribute("image")->value();
		float scaleX = atof(item->first_attribute("scaleX")->value());
		float scaleY = atof(item->first_attribute("scaleY")->value());
		CImageView *pImg = createImage(tag, file, scaleX, scaleY, x, y, rotation);
		container->addChild(pImg);
	
	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlImage9) == 0){//image9
		const char* file = item->first_attribute("image")->value();
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		float up = atof(item->first_attribute("up")->value());
		float down = atof(item->first_attribute("down")->value());
		float left = atof(item->first_attribute("left")->value());
		float right = atof(item->first_attribute("right")->value());
		CImageViewScale9 *pImg = createImage9(tag,file,x,y,w,h,up,down,left,right,rotation);
		container->addChild(pImg);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlButton) == 0){//button
		const char* normal = item->first_attribute("normal")->value();
		const char* select = item->first_attribute("select")->value();
		const char* disable = item->first_attribute("disable")->value();
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		CButton *pBtn = createBtn(tag,normal,select,disable,x,y,w,h,rotation);
		container->addChild(pBtn);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlToggleView) == 0){//toggleView
		const char* normal = item->first_attribute("normal")->value();
		const char* select = item->first_attribute("select")->value();
		const char* disable = item->first_attribute("disable")->value();
		float exclusion = atof(item->first_attribute("exclusion")->value());
		CToggleView* toggle = createToggleView(tag,exclusion,normal,select,disable,x,y,rotation);
		container->addChild(toggle);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlSlider) == 0){//slider
		const char* bg = item->first_attribute("bg")->value();
		const char* progress = item->first_attribute("progress")->value();
		const char* thumb = item->first_attribute("thumb")->value();
		CSlider *pSlider = createSlider(tag,bg,progress,thumb,x,y,rotation);
		container->addChild(pSlider);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlProgress) == 0){//progress
		const char* bg = item->first_attribute("bg")->value();
		const char* progress = item->first_attribute("progress")->value();
		CProgressBar *pProgress = createProgress(tag,bg,progress,x,y,rotation);
		container->addChild(pProgress);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlLabel) == 0){//label
		float size = atof(item->first_attribute("textSize")->value());
		int alignment = atoi(item->first_attribute("alignment")->value());
		const char* text = item->first_attribute("text")->value();
		const char* font = item->first_attribute("textFont")->value();
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		
		int r = atoi(item->first_attribute("red")->value());
		int g = atoi(item->first_attribute("green")->value());
		int b = atoi(item->first_attribute("blue")->value());
		int r2 = atoi(item->first_attribute("strokeRed")->value());
		int g2 = atoi(item->first_attribute("strokeGreen")->value());
		int b2 = atoi(item->first_attribute("strokeBlue")->value());
		int strokeSize = atoi(item->first_attribute("strokeSize")->value());
		int shadowDistance = atoi(item->first_attribute("shadowDistance")->value());
		int shadowBlur = atoi(item->first_attribute("shadowBlur")->value());
		CLabel *pLabel = createLabel(tag, text, font, alignment, size, r, g, b, x, y, w, h,
									r2,g2,b2,strokeSize,shadowDistance,shadowBlur,rotation);
		container->addChild(pLabel);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlLabelAtlas) == 0){//labelAtlas
		const char* imgPath = item->first_attribute("image")->value();
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		CLabelAtlas *pLabAtlas = createLabelAtlas(tag,imgPath,x,y,w,h,rotation);
		container->addChild(pLabAtlas);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlArmature) == 0){//armature
		const char* xml = item->first_attribute("xml")->value();
		const char* png = item->first_attribute("png")->value();
		const char* plist = item->first_attribute("plist")->value();
		const char* name = item->first_attribute("name")->value();
		Armature *pArmature = createArmature(tag,name,png,plist,xml,x,y,rotation);
		container->addChild(pArmature);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlAnim) == 0){//animation
		const char* png = item->first_attribute("png")->value();
		const char* plist = item->first_attribute("plist")->value();
		const char* name = item->first_attribute("name")->value();
		Sprite *pSprite = createAnim(tag,name,png,plist,x,y,rotation);
		container->addChild(pSprite);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlControl) == 0){//controlView
		const char* baseboard = item->first_attribute("baseboard")->value();
		const char* joystick = item->first_attribute("joystick")->value();
		CControlView *pControl = createControl(tag,baseboard,joystick,x,y,rotation);
		container->addChild(pControl);

	}else if (strcmp(item->first_attribute("type")->value(), kTuiContainerScroll) == 0){//scrollView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		int direction = atof(item->first_attribute("direction")->value());
		int innerWidth = atoi(item->first_attribute("innerWidth")->value());
		int innerHeight = atoi(item->first_attribute("innerHeight")->value());
		CScrollView *pView = createScrollView(tag, direction, innerWidth, innerHeight, x, y, w, h, rotation);
		container->addChild(pView);
		//recursive
		for (xml_node<char> *iitem = item->first_node(kTuiNodeControl); iitem != NULL; iitem = iitem->next_sibling()){
			parseControl(pView->getContainer(), iitem);
		}

	}else if (strcmp(item->first_attribute("type")->value(), kTuiContainerLayout) == 0){//layout
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		CLayout *pLayout = createLayout(tag, x, y, w, h, rotation);
		container->addChild(pLayout);
		//recursive
		for (xml_node<char> *iitem = item->first_node(kTuiNodeControl); iitem != NULL; iitem = iitem->next_sibling()){
			parseControl(pLayout, iitem);
		}
		Vector<Node*> vet = pLayout->getChildren();
		for (Node *pChild : vet){//Offset coordinates Because CLayout zero point in the lower left corner
			pChild->setPosition(pChild->getPosition() + Point(w / 2, h / 2));
		}

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlListView) == 0){//listView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		const char* img = item->first_attribute("image")->value();
		float num = atof(item->first_attribute("num")->value());
		CListView* pList = createListView(tag,img,x,y,w,h,rotation);
		container->addChild(pList);

		for(int i=0; i<num;i++){//add item
			xml_node<char> *iitem = item->first_node( kTuiNodeControl );
			w = atof(iitem->first_attribute("width")->value());
			h = atof(iitem->first_attribute("height")->value());

			CLayout *pLayout = createLayout(i,0,0,w,h,rotation);
			for( xml_node<char> *iiitem = iitem->first_node( kTuiNodeControl );iiitem!=NULL; iiitem = iiitem->next_sibling()){
				parseControl(pLayout,iiitem);
			}
			Vector<Node*> vet = pLayout->getChildren();
			for(Node *pChild : vet){//Offset coordinates Because CLayout zero point in the lower left corner
				if(pChild->getTag() > 0)
					pChild->setPosition(pChild->getPosition()+Point(w/2,h/2));
			}
			pList->insertNodeAtLast(pLayout);
		}
		pList->reloadData();

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlPageView) == 0){//pageView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		float num = atoi(item->first_attribute("num")->value());
		int dir = atoi(item->first_attribute("direction")->value());
		const char* img = item->first_attribute("image")->value();
		CPageView *pPageView = createPageView(tag, img, dir, num, x, y, w, h, rotation);
		container->addChild(pPageView);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlCheckBox) == 0){//checkBox
		const char* normal1 = item->first_attribute("normal1")->value();
		const char* normal2 = item->first_attribute("normal2")->value();
		const char* select1 = item->first_attribute("select1")->value();
		const char* select2 = item->first_attribute("select2")->value();
		const char* disable1 = item->first_attribute("disable1")->value();
		const char* disable2 = item->first_attribute("disable2")->value();
		CCheckBox *pCheckBox = createCheckBox(tag,normal1,normal2,select1,select2,disable1,disable2,x,y,rotation);
		container->addChild(pCheckBox);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlArmatureBtn) == 0){//ArmatureBtn
		const char* png = item->first_attribute("png")->value();
		const char* plist = item->first_attribute("plist")->value();
		const char* name = item->first_attribute("name")->value();
		const char* xml = item->first_attribute("xml")->value();
		ArmatureBtn *pArmBtn = createArmatureBtn(tag,name,png,plist,xml,x,y,rotation);
		container->addChild(pArmBtn);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlNumbericStepper) == 0){//NumbericStepper
		const char* lnormal = item->first_attribute("lnormal")->value();
		const char* rnormal = item->first_attribute("rnormal")->value();
		const char* lselect = item->first_attribute("lselect")->value();
		const char* rselect = item->first_attribute("rselect")->value();
		const char* ldisable = item->first_attribute("ldisable")->value();
		const char* rdisable = item->first_attribute("rdisable")->value();
		const char* stepBg = item->first_attribute("stepBg")->value();
		NumericStepper *pNumStep = createNumStep(tag,lnormal,lselect,ldisable,rnormal,rselect,rdisable,stepBg,x,y,rotation);
		container->addChild(pNumStep);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlPaticle) == 0){//Paticle
		const char* plist = item->first_attribute("plist")->value();
		ParticleSystem *pPartical = createParticle(tag,plist,x,y);
		container->addChild(pPartical);

	}else if (strcmp(item->first_attribute("type")->value(), kTuiControlTable) == 0){//TableView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		float num = atoi(item->first_attribute("num")->value());
		int dir = atoi(item->first_attribute("direction")->value());
		int cellWidth = atoi(item->first_attribute("cellWidth")->value());
		int cellHeight = atoi(item->first_attribute("cellHeight")->value());
		const char* img = item->first_attribute("image")->value();
		CTableView *pView = createTableView(tag, img, dir, num, cellWidth, cellHeight, x, y, w, h, rotation);
		container->addChild(pView);

	}else if (strcmp(item->first_attribute("type")->value(), kTuiControlGridView) == 0){//GridView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		int cellWidth = atoi(item->first_attribute("cellWidth")->value());
		int cellHeight = atoi(item->first_attribute("cellHeight")->value());
		int column = atoi(item->first_attribute("column")->value());
		int num = atoi(item->first_attribute("num")->value());
		const char* img = item->first_attribute("image")->value();
		CGridView *pView = createGridView(tag, img, column, num, cellWidth, cellHeight, x, y, w, h, rotation);
		container->addChild(pView);
	
	}else if (strcmp(item->first_attribute("type")->value(), kTuiControlGridPageView) == 0){//GridPageView
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		int cellWidth = atoi(item->first_attribute("cellWidth")->value());
		int cellHeight = atoi(item->first_attribute("cellHeight")->value());
		int column = atoi(item->first_attribute("column")->value());
		int row = atoi(item->first_attribute("row")->value());
		int num = atoi(item->first_attribute("num")->value());
		int dir = atoi(item->first_attribute("direction")->value());
		const char* img = item->first_attribute("image")->value();
		CGridPageView *pView = createGridPageView(tag, img, dir, column, row, num, cellWidth, cellHeight, x, y, w, h, rotation);
		container->addChild(pView);

	}else if(strcmp(item->first_attribute("type")->value(),kTuiControlEditBox) == 0){//EditBox
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		const char* img = item->first_attribute("image")->value();
		int inputMode = atoi(item->first_attribute("inputMode")->value());
		int inputFlag = atoi(item->first_attribute("inputFlag")->value());
		EditBox *pEdit = createEditBox(tag, img, inputMode, inputFlag, x, y, w, h, rotation);
		container->addChild(pEdit);

	}else if (strcmp(item->first_attribute("type")->value(), kTuiControlMovieView) == 0){//MovieView
		const char* png = item->first_attribute("png")->value();
		const char* plist = item->first_attribute("plist")->value();
		const char* json = item->first_attribute("json")->value();
		MovieView *pMovieView = createMovieView(tag, json, plist, png, x, y, rotation);
		container->addChild(pMovieView);

	}else if (strcmp(item->first_attribute("type")->value(), kTuiContainerCircleMenu) == 0){//CircleMenu
		float w = atof(item->first_attribute("width")->value());
		float h = atof(item->first_attribute("height")->value());
		CircleMenu *pMenu = createCircleMenu(tag, x, y, w, h, rotation);
		container->addChild(pMenu);
		//recursive
		for (xml_node<char> *iitem = item->first_node(kTuiNodeControl); iitem != NULL; iitem = iitem->next_sibling()){
			parseControl(pMenu, iitem);
		}
		pMenu->reloadData();
	}
}
コード例 #7
0
ファイル: kggeneral.cpp プロジェクト: aremai/krusader
void KgGeneral::createGeneralTab()
{
    QWidget *tab = createTab(i18n("General"));
    QGridLayout *kgGeneralLayout = new QGridLayout(tab);
    kgGeneralLayout->setSpacing(6);
    kgGeneralLayout->setContentsMargins(11, 11, 11, 11);


    //  -------------------------- GENERAL GROUPBOX ----------------------------------

    QGroupBox *generalGrp = createFrame(i18n("General"), tab);
    QGridLayout *generalGrid = createGridLayout(generalGrp);



    KONFIGURATOR_CHECKBOX_PARAM settings[] = { //   cfg_class  cfg_name                default             text                              restart tooltip
        {"Look&Feel", "Warn On Exit",         _WarnOnExit,        i18n("Warn on exit"),           false,  i18n("Display a warning when trying to close the main window.") },    // KDE4: move warn on exit to the other confirmations
    };
    KonfiguratorCheckBoxGroup *cbs = createCheckBoxGroup(2, 0, settings, 1 /*count*/, generalGrp, PAGE_GENERAL);
    generalGrid->addWidget(cbs, 0, 0);


    KonfiguratorCheckBox *checkBox = createCheckBox("General", "Mimetype Magic", _MimetypeMagic,
                                     i18n("Use MIME type magic"), generalGrp, false,
                                     i18n("MIME type magic allows better distinction of file types, but is slower."), PAGE_GENERAL);
    generalGrid->addWidget(checkBox, 1, 0, 1, 1);


    // temp dir

    QHBoxLayout *hbox = new QHBoxLayout();

    hbox->addWidget(new QLabel(i18n("Temp Folder:"), generalGrp));
    KonfiguratorURLRequester *urlReq3 = createURLRequester("General", "Temp Directory", _TempDirectory,
                                        generalGrp, false, PAGE_GENERAL);
    urlReq3->setMode(KFile::Directory);
    connect(urlReq3->extension(), SIGNAL(applyManually(QObject *, QString, QString)),
            this, SLOT(applyTempDir(QObject *, QString, QString)));
    hbox->addWidget(urlReq3);
    generalGrid->addLayout(hbox, 13, 0, 1, 1);

    QLabel *label4 = new QLabel(i18n("Note: you must have full permissions for the temporary folder."),
                                generalGrp);
    generalGrid->addWidget(label4, 14, 0, 1, 1);


    kgGeneralLayout->addWidget(generalGrp, 0 , 0);


    // ----------------------- delete mode --------------------------------------

    QGroupBox *delGrp = createFrame(i18n("Delete mode"), tab);
    QGridLayout *delGrid = createGridLayout(delGrp);

    KONFIGURATOR_NAME_VALUE_TIP deleteMode[] =
        //            name            value    tooltip
    {{ i18n("Delete files"),  "false", i18n("Files will be permanently deleted.") },
        { i18n("Move to trash"), "true",  i18n("Files will be moved to trash when deleted.") }
    };
    KonfiguratorRadioButtons *trashRadio = createRadioButtonGroup("General", "Move To Trash",
                                           _MoveToTrash ? "true" : "false", 2, 0, deleteMode, 2, delGrp, false, PAGE_GENERAL);
    delGrid->addWidget(trashRadio);

    kgGeneralLayout->addWidget(delGrp, 1 , 0);


    // ----------------------- terminal -----------------------------------------

    QGroupBox *terminalGrp = createFrame(i18n("Terminal"), tab);
    QGridLayout *terminalGrid = createGridLayout(terminalGrp);

    QLabel *label3 = new QLabel(i18n("Terminal:"), generalGrp);
    terminalGrid->addWidget(label3, 0, 0);
    KonfiguratorURLRequester *urlReq2 = createURLRequester("General", "Terminal", _Terminal,
                                        generalGrp, false, PAGE_GENERAL, false);
    terminalGrid->addWidget(urlReq2, 0, 1);

    KONFIGURATOR_CHECKBOX_PARAM terminal_settings[] = { //   cfg_class  cfg_name     default        text            restart tooltip
        {"General", "Send CDs", _SendCDs, i18n("Terminal Emulator sends Chdir on panel change"), false, i18n("When checked, whenever the panel is changed (for example, by pressing Tab), Krusader changes the current folder in the terminal emulator.") },
        {"Look&Feel", "Fullscreen Terminal Emulator", false, i18n("Fullscreen terminal (mc-style)"), false,  i18n("Terminal is shown instead of the Krusader window (full screen).") },
    };
    cbs = createCheckBoxGroup(1, 0, terminal_settings, 2 /*count*/, terminalGrp, PAGE_GENERAL);
    terminalGrid->addWidget(cbs, 1, 0, 1, 2);


    kgGeneralLayout->addWidget(terminalGrp, 2 , 0);
}
コード例 #8
0
ファイル: controllerwindow.cpp プロジェクト: RSATom/Qt
//! [6]
void ControllerWindow::createHintsGroupBox()
{
    hintsGroupBox = new QGroupBox(tr("Hints"));

    msWindowsFixedSizeDialogCheckBox =
            createCheckBox(tr("MS Windows fixed size dialog"));
    x11BypassWindowManagerCheckBox =
            createCheckBox(tr("X11 bypass window manager"));
    framelessWindowCheckBox = createCheckBox(tr("Frameless window"));
    windowNoShadowCheckBox = createCheckBox(tr("No drop shadow"));
    windowTitleCheckBox = createCheckBox(tr("Window title"));
    windowSystemMenuCheckBox = createCheckBox(tr("Window system menu"));
    windowMinimizeButtonCheckBox = createCheckBox(tr("Window minimize button"));
    windowMaximizeButtonCheckBox = createCheckBox(tr("Window maximize button"));
    windowCloseButtonCheckBox = createCheckBox(tr("Window close button"));
    windowContextHelpButtonCheckBox =
            createCheckBox(tr("Window context help button"));
    windowShadeButtonCheckBox = createCheckBox(tr("Window shade button"));
    windowStaysOnTopCheckBox = createCheckBox(tr("Window stays on top"));
    windowStaysOnBottomCheckBox = createCheckBox(tr("Window stays on bottom"));
    customizeWindowHintCheckBox= createCheckBox(tr("Customize window"));

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(msWindowsFixedSizeDialogCheckBox, 0, 0);
    layout->addWidget(x11BypassWindowManagerCheckBox, 1, 0);
    layout->addWidget(framelessWindowCheckBox, 2, 0);
    layout->addWidget(windowNoShadowCheckBox, 3, 0);
    layout->addWidget(windowTitleCheckBox, 4, 0);
    layout->addWidget(windowSystemMenuCheckBox, 5, 0);
    layout->addWidget(customizeWindowHintCheckBox, 6, 0);
    layout->addWidget(windowMinimizeButtonCheckBox, 0, 1);
    layout->addWidget(windowMaximizeButtonCheckBox, 1, 1);
    layout->addWidget(windowCloseButtonCheckBox, 2, 1);
    layout->addWidget(windowContextHelpButtonCheckBox, 3, 1);
    layout->addWidget(windowShadeButtonCheckBox, 4, 1);
    layout->addWidget(windowStaysOnTopCheckBox, 5, 1);
    layout->addWidget(windowStaysOnBottomCheckBox, 6, 1);
    hintsGroupBox->setLayout(layout);
}
コード例 #9
0
ファイル: HomeScreen.cpp プロジェクト: Vallenain/MoSync
/**
 * Create the layout with checkable categories.
 * It is parented by the main layout.
 * For the moment, there are only 6 available categories.
 * ( These could be expanded also by new user categories.)
 * @return The layout that contains the categories.
 */
MAWidgetHandle HomeScreen::createCategoriesLayout()
{
	// Add a layout for categories.
	MAWidgetHandle categoriesLayout = maWidgetCreate(MAW_VERTICAL_LAYOUT);

	// Set layout's size.
	setWidgetSize(
			categoriesLayout,
			MAW_CONSTANT_FILL_AVAILABLE_SPACE,
			mScreenHeight/3); //or MAW_CONSTANT_WRAP_CONTENT

	 // Add a horizontal line.
	MAWidgetHandle line1 = createSpacer(mScreenWidth,BREAKLINE_HEIGHT);
	setWidgetProperty(
			line1,
			MAW_WIDGET_BACKGROUND_COLOR,
			DARK_GREY, 16);

	MAWidgetHandle label = createLabel(
			MAW_CONSTANT_FILL_AVAILABLE_SPACE,
			"  Categories  ",
			BLUE,
			mFontSize);
	maWidgetSetProperty(
			label,
			MAW_LABEL_TEXT_HORIZONTAL_ALIGNMENT,
			MAW_ALIGNMENT_LEFT);
	maWidgetAddChild(categoriesLayout, label);

	 // Add another horizontal line.
	MAWidgetHandle line2 = createSpacer(mScreenWidth,BREAKLINE_HEIGHT);
	setWidgetProperty(line2, MAW_WIDGET_BACKGROUND_COLOR, DARK_GREY, 16);
	maWidgetAddChild(categoriesLayout, line2);

	// Available categories:
	// All ( enabled by default), Nature, Sports, Movies, News, Science.
	mCategoriesStrings.clear();
	mCategoriesStrings.add(CATEGORY_ALL);
	mCategoriesStrings.add(CATEGORY_NATURE);
	mCategoriesStrings.add(CATEGORY_SPORTS);
	mCategoriesStrings.add(CATEGORY_NEWS);
	mCategoriesStrings.add(CATEGORY_MOVIES);
	mCategoriesStrings.add(CATEGORY_SCIENCE);

	setWidgetProperty(
		categoriesLayout, MAW_WIDGET_BACKGROUND_COLOR, DARK_WHITE, 16);

	int index(-1);

	// Each category has a check box and label.
	for (int i=0; i < mCategoriesStrings.size() / 2; i++)
	{
		// Arrange 2 categories per row.
		MAWidgetHandle categoryLayout = maWidgetCreate(MAW_HORIZONTAL_LAYOUT);

		// Set layout's size.
		setWidgetSize(
			categoryLayout,mScreenWidth, MAW_CONSTANT_FILL_AVAILABLE_SPACE);

		MAWidgetHandle checkBox1 = createCheckBox();
		// By default, the first category (All) is checked,
		// so all of them are checked also.
		maWidgetSetProperty(checkBox1,MAW_CHECK_BOX_CHECKED,"true");

		// We hold the array of check boxes, so we can construct
		// the request url based on the chosen categories.
		mCategoryBoxes.add(checkBox1);
		maWidgetAddChild(categoryLayout, checkBox1);

		index++;
		MAWidgetHandle label1 = createLabel(
				MAW_CONSTANT_FILL_AVAILABLE_SPACE,
				mCategoriesStrings[index].c_str(),
				BLUE,
				mFontSize );
		// Arrange the text to the left.
		maWidgetSetProperty(
			label1, MAW_LABEL_TEXT_HORIZONTAL_ALIGNMENT, MAW_ALIGNMENT_LEFT);
		maWidgetAddChild(categoryLayout, label1);

		// Add another check box & label, on the same row.

		MAWidgetHandle checkBox2 = createCheckBox();
		// By default, the first category (All) is checked,
		// so all of them are checked also.
		maWidgetSetProperty(checkBox2,MAW_CHECK_BOX_CHECKED,"true");

		// We hold the array of check boxes, so we can construct
		// the request url based on the chosen categories.
		mCategoryBoxes.add(checkBox2);
		maWidgetAddChild(categoryLayout, checkBox2);

		index++;
		MAWidgetHandle label2 = createLabel(
				MAW_CONSTANT_FILL_AVAILABLE_SPACE,
				mCategoriesStrings[index].c_str(),
				BLUE,
				mFontSize );
		// Arrange the text to the left.
		maWidgetSetProperty(
			label2, MAW_LABEL_TEXT_HORIZONTAL_ALIGNMENT, MAW_ALIGNMENT_LEFT);
		maWidgetAddChild(categoryLayout, label2);

		// Add this layout to the main vertical layout.
		maWidgetAddChild(categoriesLayout, categoryLayout);
	}

	 // Add another horizontal line.
	MAWidgetHandle line3 = createSpacer(mScreenWidth,BREAKLINE_HEIGHT);
	setWidgetProperty(line3, MAW_WIDGET_BACKGROUND_COLOR, DARK_GREY, 16);

	maWidgetAddChild(categoriesLayout, line3);

	return categoriesLayout;
}
コード例 #10
0
ファイル: GUI.cpp プロジェクト: unni07/RecommenderSystem
void GUI::initialize() 
{
	readFeatureList();
	KeyWordSearch::getInstance().initialize();
	QGroupBox * input = new QGroupBox("Input");
	QHBoxLayout * inputArea = new QHBoxLayout();
	int width = this->width();
	int height = this->height();
	auto inputTextEdit =  createLineEdit("input", { 0.03f*width ,0.05f* height }, { 200,15 });
	inputTextEdit->setParent(this);
	auto recommnedButton = createButton("RecommendButton", "Find", { 0.5f * width, 0.05* height }, { 50,20 });
	recommnedButton->setParent(this);

	inputArea->addWidget(inputTextEdit);
	inputArea->addWidget(recommnedButton);
	inputArea->addStretch(1);
	input->setLayout(inputArea);

	QGroupBox * output = new QGroupBox("Output");
	 outputButtons = new QGroupBox("Output");
	QHBoxLayout * outputArea = new QHBoxLayout();
	//auto outputTextEdit = createLineEdit("output", { 0.03f*width ,0.05f* height }, { 500,500 });
	auto outputTextEdit = createTextDisplay("OutputText", { 0,0 }, { 300,500 }, false);
	auto recommendeOutTextEdit = createTextDisplay("RecommendedOutputText", { 0,0 }, { 300,500 }, false);
	recommendeOutTextEdit->setParent(this);
	outputTextEdit->setParent(this);
	outputArea->addWidget(outputTextEdit);
	outputArea->addWidget(recommendeOutTextEdit);

	
	QVBoxLayout * outputButtonArea = new QVBoxLayout();
	auto itr = featureList.begin();
	auto itrEnd = featureList.end();
	while (itr != itrEnd)
	{
		auto label = new QLabel((itr->first).c_str());
		label->setParent(this);
		outputButtonArea->addWidget(label);
		auto itrVector = itr->second.begin();
		auto itrVectorEnd = itr->second.end();
		while (itrVector != itrVectorEnd)
		{
			auto button1 = createCheckBox(*itrVector, *itrVector, { 0,0 }, false);
			button1->setParent(this);
			outputButtonArea->addWidget(button1);
			++itrVector;
		}

		++itr;
	}
	auto button2 = createButton("FilterSearch", "Search");
	outputButtonArea->addWidget(button2);
	outputButtonArea->addStretch(1);
	outputButtons->setLayout(outputButtonArea);
	outputArea->addWidget(outputButtons);
	outputButtons->setVisible(false);

	output->setLayout(outputArea);
	outputArea->addStretch(1);
	mainLayout->addWidget(input);
	mainLayout->addWidget(output);
	mainLayout->addStretch(1);

	connectToTask();
}
コード例 #11
0
ファイル: TitlesScreen.cpp プロジェクト: jaumem/MoSync
/**
 * Fill the list box with data provided by the engine.
 */
void TitleScreen::fillListBox()
{
	// Clear previous entries.
	mCheckBoxes.clear();
	mTitleLabels.clear();

	mTitles.clear();
	mSnippets.clear();

	mTitles = mWiki->getAllTitles();
	mSnippets = mWiki->getAllSnippets();

	// Destroy the list view, and recreate it.
	if ( mListView != -1){
		maWidgetDestroy(mListView);
	}
	mListView = createListView(mScreenWidth, MAW_CONSTANT_FILL_AVAILABLE_SPACE);
	maWidgetAddChild(mMainLayout, mListView);

	// Add a Select/Deselect All button.
	MAWidgetHandle selectAllLayout = maWidgetCreate(MAW_HORIZONTAL_LAYOUT);
	// Set layout's size.
	setWidgetSize(
		selectAllLayout, mScreenWidth, MAW_CONSTANT_FILL_AVAILABLE_SPACE);

	mSelectAll = createCheckBox();
	// All titles are deselected by default.
	maWidgetSetProperty(mSelectAll, MAW_CHECK_BOX_CHECKED, "false");
	maWidgetAddChild(selectAllLayout, mSelectAll);

	MAWidgetHandle labelSelectAll = createLabel(
			MAW_CONSTANT_FILL_AVAILABLE_SPACE,
			MESSAGE_SELECT_ALL.c_str(),
			DARK_GREY,
			mFontSize );
	mTitleLabels.add(labelSelectAll);
	maWidgetAddChild(selectAllLayout, labelSelectAll);
	maWidgetAddChild(mListView,selectAllLayout);

	// Update the UI.
	for (int i=0; i < mTitles.size(); i++)
	{
		// Add results in a horizontal layout.
		MAWidgetHandle layout = maWidgetCreate(MAW_HORIZONTAL_LAYOUT);
		setWidgetSize(layout, mScreenWidth, MAW_CONSTANT_FILL_AVAILABLE_SPACE);

		MAWidgetHandle checkbox = createCheckBox();
		mCheckBoxes.add(checkbox);
		maWidgetAddChild(layout, mCheckBoxes[i]);

		MAWidgetHandle label = createLabel(
				MAW_CONSTANT_FILL_AVAILABLE_SPACE,
				mTitles[i].c_str(),
				BLUE,
				mFontSize);
		mTitleLabels.add(label);
		maWidgetAddChild(layout, label);

		setWidgetProperty(layout, MAW_WIDGET_BACKGROUND_COLOR, DARK_WHITE, 16);

		maWidgetAddChild(mListView,layout);
	}
}
コード例 #12
0
bool FontInfoWindow::create(Point2I pos, Point2I size)
{
	if (!createMDIChild(NULL,
                        "Font Info",
                        WS_VISIBLE | WS_CAPTION,
                        pos,
                        size,
                        parent,
                        0))
		return(false);

#define CBRB_COLUMN 220
#define ITEM_COLUMN 100
#define ITEM_WIDTH  90

	CreateWindow("STATIC", "Count:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 5, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Widht:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 25, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Height:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 45, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Baseline:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 65, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Palette:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 85, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);


	CreateWindow("STATIC", "Foreground:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 105, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Background:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 126, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);
	CreateWindow("STATIC", "Spacing:",
	             WS_CHILD | SS_SIMPLE | WS_VISIBLE,
				 10, 147, ITEM_WIDTH, 20, hWnd, (HMENU)0, hInstance, NULL);


	hWndFontCt         = CreateWindow("STATIC", "", WS_CHILD | SS_SIMPLE | WS_VISIBLE,
	                                  ITEM_COLUMN, 5, 70, 20, hWnd, (HMENU)0, hInstance, NULL);
	hWndFontWidth      = CreateWindow("STATIC", "", WS_CHILD | SS_SIMPLE | WS_VISIBLE,
   	                                  ITEM_COLUMN, 25, 70, 20, hWnd, (HMENU)0, hInstance, NULL);
 	hWndFontHeight     = CreateWindow("STATIC", "", WS_CHILD | SS_SIMPLE | WS_VISIBLE,
	                                  ITEM_COLUMN, 45, 70, 20, hWnd, (HMENU)0, hInstance, NULL);
  	hWndFontBaseline   = CreateWindow("STATIC", "", WS_CHILD | SS_SIMPLE | WS_VISIBLE,
     	                              ITEM_COLUMN, 65, 70, 20, hWnd, (HMENU)0, hInstance, NULL);

	hWndFontForeground    = createGet(ID_GET_FOREGROUND, ITEM_COLUMN, 105, 70, 20);

	hWndFontForegroundSet = CreateWindow("Button", "Set",
	                            WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
				        		ITEM_COLUMN + 75, 105, 30, 20,
						  		hWnd, (HMENU)ID_SET_FOREGROUND, hInstance, NULL);

	hWndFontBackground    = createGet(ID_GET_BACKGROUND, ITEM_COLUMN, 126, 70, 20);
	hWndFontBackgroundSet = CreateWindow("Button", "Set",
	                            WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
				        		ITEM_COLUMN + 75, 126, 30, 20,
						  		hWnd, (HMENU)ID_SET_BACKGROUND, hInstance, NULL);

	hWndFontSpacing    = createGet(ID_GET_SPACING, ITEM_COLUMN, 147, 70, 20);
	hWndFontSpacingSet = CreateWindow("Button", "Set",
	                            WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
				        		ITEM_COLUMN + 75, 147, 30, 20,
						  		hWnd, (HMENU)ID_SET_SPACING, hInstance, NULL);

	hWndPaletteIncl    = CreateWindow("STATIC", "", WS_CHILD | SS_SIMPLE | WS_VISIBLE,
	                                  ITEM_COLUMN, 85, 70, 20, hWnd, (HMENU)0, hInstance, NULL);

	hWndTransparent  = createCheckBox(ID_CB_TRANSPARENT, CBRB_COLUMN,  5, "Transparent");
	hWndTranslucent  = createCheckBox(ID_CB_TRANSLUCENT, CBRB_COLUMN, 25, "Translucent");
	hWndMono         = createCheckBox(ID_CB_MONO,        CBRB_COLUMN, 45, "Mono");
	hWndUnderlined   = createCheckBox(ID_CB_UNDERLINED,  CBRB_COLUMN, 65, "Underlined");
	hWndSavePalette  = createCheckBox(ID_CB_SAVEPALETTE, CBRB_COLUMN, 85, "Save Palette");

	hWndProportional = CreateWindow("BUTTON", "Proportional",
	                   WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | WS_GROUP | BS_TEXT,
		  	  		   CBRB_COLUMN, 115, 120, 20, hWnd, (HMENU)ID_RB_PROPORTIONAL, hInstance, NULL);

	hWndFixed        = CreateWindow("BUTTON", "Fixed",
	                   WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_TEXT,
		  	  		   CBRB_COLUMN, 135, 120, 20, hWnd, (HMENU)ID_RB_FIXED, hInstance, NULL);


	return(true);
}
コード例 #13
0
SearchFind::SearchFind(OpenGLScene *scene,  QString target, int type)
{ //type 1: search, type 2: setting 
	
	delete this->layout();
	this->_layout = new QGridLayout();
	this->setLayout( this->_layout );
	_scene=scene;
		
	if(type==2)
	{
		this->_path = new QLineEdit( this );
		this->_path->setMaximumWidth(100);
		this->_layout->addWidget( _path, 0, 0, 1, 3 );			
		this->_go = new QPushButton( "Search", this );	
		
		this->_layout->addWidget( _go, 0, 2 );		
		connect( _go, SIGNAL(clicked()), this, SLOT(search()) );
		/*connect(&m_eQuery, SIGNAL(finished(bool,QString,QString))  
            ,this, SLOT(onQueryFinished(bool,QString,QString))); 

		connect( _go, SIGNAL(clicked()), 
            this, SLOT(onQueryButton()));  */

		msWindowsFixedSizeDialogCheckBox = createCheckBox(tr("small Molecule"));//draw/search protein
	    //x11BypassWindowManagerCheckBox = createCheckBox(tr("Complex"));  //draw/search complex/physical entity
		//windowNoShadowCheckBox = createCheckBox(tr("smallMoleculer"));  //draw/search complex/physical entity
		//framelessWindowCheckBox = createCheckBox(tr("Small Molecule"));
		//msWindowsFixedSizeDialogCheckBox->setChecked(false);
		//SearchList.insert('P');
         SearchList.insert('C');	SearchList.insert('P'); SearchList.insert('D'); SearchList.insert('S'); SearchList.insert('E');  SearchList.insert('R');	SearchList.insert('M');				 
		//_layout->addWidget(msWindowsFixedSizeDialogCheckBox, 2, 1);

		/* QComboBox *comboBox = new QComboBox;
    comboBox->addItem(tr("item 1"));
    comboBox->addItem(tr("item 2"));
    comboBox->addItem(tr("item 3"));
 
    QComboBox *iconComboBox = new QComboBox;
    iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
    iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
    iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));

		
	_layout->addWidget(iconComboBox);*/

	QListWidget* listBox = new QListWidget;
	//background: #eeeeee; border: 1px solid #afafaf;border-radius: 10px;margin: 10px 0 0 20px;max-width: 305px;min-height: 100px;} QListWidget::item{ background-image: url(:/pictures/attach_icon.png);background-repeat: no-repeat;background-position: left center; color: #212121;border: 1px solid #afafaf;min-height: 54px;max-height: 54px;padding-left: 54px;}QListWidget::item:selected{background-image: url(:/pictures/attach_icon.png);background-repeat: no-repeat;background-position: left center;background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #cdcdcd, stop: 1 #ababab);border-top: 1px solid;border-top-color: #a8abad;border-bottom: 1px solid;border-bottom-color: #bfc7ce;color: #333538;}");
	//listBox->setStyleSheet("QListWidget{ border: 1px solid #afafaf; border-radius: 10px}");
	
	
	listBox->addItem(tr("item 1"));
    listBox->addItem(tr("item 2"));
    listBox->addItem(tr("item 3")); 
    
	
	//_layout->addWidget(listBox);

		//_layout->addWidget(x11BypassWindowManagerCheckBox, 3, 1);
		//_layout->addWidget(windowNoShadowCheckBox, 4, 1);
		//x11BypassWindowManagerCheckBox->setChecked(true);
	}
	else if(type==3)
	{
		//Display small molecule
		QGridLayout *layout = new QGridLayout;	
		hintsGroupBox = new QGroupBox(tr("Display Objects"));	
		hintsGroupBox->setLayout(layout);		
		this->_layout->addWidget(hintsGroupBox,0,0,13,8);

	    layout->setAlignment(Qt::AlignTop);
		framelessWindowCheckBox = createCheckBox(tr("Small Molecule"));
		//framelessWindowCheckBox->setVisible(false);		
		layout->addWidget(framelessWindowCheckBox, 1, 0);
		if(_scene->drawSmallmoleculeSettings)
		{
			framelessWindowCheckBox->setChecked(true);			
		}	
		
		setNewRadioButton = createRadioButton(tr("apply only to new groups"));		
		layout->addWidget(setNewRadioButton, 2, 0);

		setAllRadioButton = createRadioButton(tr("apply to all groups"));
		layout->addWidget(setAllRadioButton, 3, 0);
		
		setNewRadioButton->setChecked(true);

		layout->setSpacing(2);

		/*
		//Setting about rescale mode			
		WindowDragResize= new QGroupBox(tr("Drag_To_Resize"));				 //rag_To_Resize
		WindowDragResize->setLayout(layout);
		this->_layout->addWidget(WindowDragResize,3,0);	

		dragResizeMode1 = createRadioButton(tr("Uniform scale")); //Word file mode // InterNet explorer mode		
		layout->addWidget(dragResizeMode1, 8, 0);

		dragResizeMode2 = createRadioButton(tr("Word file style")); //Word file mode // InterNet explorer mode		
		layout->addWidget(dragResizeMode2, 15, 0);

		dragResizeMode3 = createRadioButton(tr("Explorer syle"));  //Word file mode // InterNet explorer mode		
		layout->addWidget(dragResizeMode3, 16, 0);
		//if(_scene->resizeMode)
		{
			dragResizeMode2->setChecked(true);			
		}
		*/

		//Size of the bubbles
		//fixed size 
		//top level pathway
		//rest
		//Setting about rescale mode			
		/*
		initBubbleSize = new QGroupBox(tr("Bubble Size"));				 //rag_To_Resize
		initBubbleSize->setLayout(layout);
		this->_layout->addWidget(initBubbleSize,6,0);	

		fixedSizeCheckBox = createCheckBox(tr("Fixed initial size"));
		layout->addWidget(fixedSizeCheckBox, 18, 0);
		//if(_scene->drawSmallmoleculeSettings)
		{
			fixedSizeCheckBox->setChecked(true);			
		}	
		topSizeInput = new QLineEdit( this );
		_layout->addWidget( topSizeInput, 20,0 );

		sonSizeInput = new QLineEdit( this ); //Word file mode // InterNet explorer mode		
		layout->addWidget(sonSizeInput, 22, 0);

		ApplyButton = new QPushButton( "Apply", this );
		this->_layout->addWidget( ApplyButton, 24, 0 );		
		//connect( ApplyButton, SIGNAL(clicked()), this, SLOT(search()) );
		*/
	}		
	else if(type==4)
	{
		//Display small molecule
		QGridLayout *layout = new QGridLayout;	
		hintsGroupBox = new QGroupBox(tr("Search Objects"));	
		hintsGroupBox->setLayout(layout);

		layout->setSpacing(0);
		layout->setMargin(0);

		QButtonGroup *bg1 = new QButtonGroup(this);
		QButtonGroup *bg2 = new QButtonGroup(this);
		
		_layout->addWidget(hintsGroupBox,0,0,5,1);
		
		layout->setAlignment(Qt::AlignTop);
		proteinRadioButton = createRadioButton(tr("Protein"));
		layout->addWidget(proteinRadioButton, 1, 0);
		
		compartmentRadioButton = createRadioButton(tr("Compartment"));
		layout->addWidget(compartmentRadioButton, 2, 0);

		pathwayRadioButton = createRadioButton(tr("Pathway"));
		layout->addWidget(pathwayRadioButton, 3, 0);	


		bg1->addButton(proteinRadioButton);
		bg1->addButton(compartmentRadioButton);
		bg1->addButton(pathwayRadioButton);

		if(_scene->searchType == 'P')
		{
			proteinRadioButton->setChecked(true);			
		}	
		else if(_scene->searchType == 'M')
		{
			compartmentRadioButton->setChecked(true);			
		}
		else if(_scene->searchType == 'W')
		{
			pathwayRadioButton->setChecked(true);			
		}		
		setNewRadioButton = createRadioButton(tr("apply only to new groups"));		
		layout->addWidget(setNewRadioButton, 4, 0);

		setAllRadioButton = createRadioButton(tr("apply to all groups"));
		layout->addWidget(setAllRadioButton, 5, 0);	

		bg2->addButton(setNewRadioButton);
		bg2->addButton(setAllRadioButton);

		setNewRadioButton->setChecked(true);
	}	
	else if(type==5)
	{   //search setting 2
		//
		//Display small molecule
		QGridLayout *layout = new QGridLayout;	
		hintsGroupBox = new QGroupBox(tr("Search Relations"));	
		hintsGroupBox->setLayout(layout);		
		this->_layout->addWidget(hintsGroupBox,0,0,13,8);

	    layout->setAlignment(Qt::AlignTop);
		
		sharedCheckBox = createCheckBox(tr("shared"));
		layout->addWidget(sharedCheckBox, 1, 0);

		differedCheckBox = createCheckBox(tr("differed"));
		layout->addWidget(differedCheckBox, 1, 0);

		linkedCheckBox = createCheckBox(tr("linked"));
		layout->addWidget(linkedCheckBox, 1, 0);

		expressedCheckBox = createCheckBox(tr("expressed"));
		layout->addWidget(expressedCheckBox, 1, 0);
		
		if(_scene->searchShared)
		{
			sharedCheckBox->setChecked(true);			
		}
		if(_scene->searchDiffered)
		{
			differedCheckBox->setChecked(true);			
		}
		if(_scene->searchLinked)
		{
			linkedCheckBox->setChecked(true);			
		}
		if(_scene->searchExpressed)
		{
			expressedCheckBox->setChecked(true);			
		}
				
		setNewRadioButton = createRadioButton(tr("apply only to new groups"));		
		layout->addWidget(setNewRadioButton, 2, 0);

		setAllRadioButton = createRadioButton(tr("apply to all groups"));
		layout->addWidget(setAllRadioButton, 3, 0);
		
		setNewRadioButton->setChecked(true);

		layout->setSpacing(2);
	}	
	/*if(type==6)
	{
		this->_path = new QLineEdit( this );
		this->_path->setMaximumWidth(100);
		this->_layout->addWidget( _path, 0, 0, 1, 3 );			
		this->_go = new QPushButton( "Search", this );		
		this->_layout->addWidget( _go, 0, 2 );		
		connect( _go, SIGNAL(clicked()), this, SLOT(search()) );

		msWindowsFixedSizeDialogCheckBox = createCheckBox(tr("small Molecule"));//draw/search protein
	    //x11BypassWindowManagerCheckBox = createCheckBox(tr("Complex"));  //draw/search complex/physical entity
		//windowNoShadowCheckBox = createCheckBox(tr("smallMoleculer"));  //draw/search complex/physical entity
		//framelessWindowCheckBox = createCheckBox(tr("Small Molecule"));
		//msWindowsFixedSizeDialogCheckBox->setChecked(false);
		//SearchList.insert('P');
         SearchList.insert('C');	SearchList.insert('P'); SearchList.insert('D');  SearchList.insert('E');  SearchList.insert('R');	SearchList.insert('M');		
		//_layout->addWidget(msWindowsFixedSizeDialogCheckBox, 2, 1);

		
		//_layout->addWidget(x11BypassWindowManagerCheckBox, 3, 1);
		//_layout->addWidget(windowNoShadowCheckBox, 4, 1);
		//x11BypassWindowManagerCheckBox->setChecked(true);
	}*/
}