Пример #1
0
Bool PaletteSubDialog::CreateLayout(void)
{
    if (!GeDialog::CreateLayout()) return FALSE;
	m_rowArea = NULL;
    m_layoutArea = NULL;
    m_labelCheckArea = NULL;
    m_searchText != NULL;
    BaseContainer *bc = GetActiveDocument()->BaseList2D::GetDataInstance()->GetContainerInstance(PALETTE_SCENE_HOOK_ID)->GetContainerInstance(m_id);
    if(bc != nullptr){
        FromContainer(*bc);
    }else{
        m_paletteID = 0;
    }
    
    Int32 numRows = 1;
    if(m_layout == 0){
        numRows = m_rows;
    }

    GroupBegin(0,BFH_SCALEFIT|BFV_SCALEFIT,0,1,String(),0);
        GroupBegin(1, BFH_LEFT|BFV_TOP, 0, 1, String(), 0);
            GroupBegin(3,BFH_LEFT|BFV_TOP,1,0,String(),0);
            m_actionPopup = AddPopupButton(3,BFH_LEFT);
            m_trashArea = AddUserArea(4, BFH_CENTER);
            AttachUserArea(m_trash, m_trashArea);
            GroupEnd();
        GroupEnd();
        GroupBegin(8,BFH_SCALEFIT|BFV_SCALEFIT,0,1,String(),0);
            ScrollGroupBegin(2,BFH_SCALEFIT|BFV_SCALEFIT,SCROLLGROUP_VERT|SCROLLGROUP_HORIZ,SizePix(40),SizePix(40*numRows));
                GroupBegin(6,BFH_SCALEFIT|BFV_SCALEFIT,0,1,String(),0);
                m_spotColors = new PaletteColor[1];
                m_spotColors[0].SetColor(Color(0.f,0.f,0.f).SetSource(COLOR_SOURCE_DISPLAY));
                m_spotColors[0].SetColorID(0);
                m_spotColors[0].SetSelectCallback(m_selectCallback,m_selectCallbackData);
                m_spotColors[0].SetDragable(m_dragable);
                C4DGadget *area = AddUserArea(0,0);
                AttachUserArea(m_spotColors[0],area);
                GroupEnd();
            GroupEnd();
        GroupEnd();
 
    GroupEnd();
    return TRUE;
}
Пример #2
0
Bool LiquidToolDialog::CreateLayout(void)
{
	GroupBegin(0, BFH_SCALEFIT, 1, 0, "", 0);
	GroupBegin(0, BFH_SCALEFIT, 2, 0, "", 0);
	GroupSpace(4, 1);

	AddStaticText(0, 0, 0, 0, "R", 0);
	AddEditSlider(1000, BFH_SCALEFIT);

	AddStaticText(0, 0, 0, 0, "G", 0);
	AddEditSlider(1001, BFH_SCALEFIT);

	AddStaticText(0, 0, 0, 0, "B", 0);
	AddEditSlider(1002, BFH_SCALEFIT);
	GroupEnd();

	GroupEnd();
	return true;
}
Пример #3
0
void PaletteSubDialog::LayoutPalette()
{
    Int32 rows = 0;
    Int32 cols = 0;
    Int32 tmp = 0;
    rows = m_rows;
    if(m_layout == 1){
        tmp = rows;
        rows = cols;
        cols = tmp;
    }
    if(m_spotColors != NULL){
        delete[] m_spotColors;
    }
    m_spotColors = new PaletteColor[m_palette.GetCount()];
    GroupBegin(30, BFH_SCALEFIT|BFV_SCALEFIT, cols, rows, String(), 0);
    GroupSpace(0,0);
    for(int i=0;i<m_palette.GetCount();i++){
        Int32 pos;
        if(m_searchString == "" || m_palette[i].m_name.ToLower().FindFirst(m_searchString.ToLower(), &pos)){
            m_spotColors[i].SetColor(m_palette[i]);
            m_spotColors[i].SetColorID(i);
            m_spotColors[i].SetSelectCallback(m_selectCallback,m_selectCallbackData);
            m_spotColors[i].SetDragable(m_dragable);
            m_spotColors[i].SetPaletteID(m_paletteID);
            
            if(m_showLabel){
                GroupBegin(400 + i*3,0,1,0,"",FALSE);
                AddStaticText(400 + i*3+1,0,0,0,m_palette[i].m_name,BORDER_NONE);
            }
            C4DGadget *area = AddUserArea(400 + i*3+2,0);
            AttachUserArea(m_spotColors[i],area);
            if(m_showLabel){
                GroupEnd();
            }
        }
    }
    GroupEnd();
}
Пример #4
0
Bool MemStatDialog::CreateLayout(void)
{
	// first call the parent instance
	Bool res = GeDialog::CreateLayout();

	SetTitle("Memory Statistics");

	GroupBegin(0, BFH_SCALEFIT, 2, 0, "", 0);
	{
		GroupBorderSpace(4, 4, 4, 4);
		AddStaticText(0, BFH_FIT, 0, 0, "Memory In Use", 0); AddStaticText(IDC_MEMORY_STAT_MEMORY_INUSE, BFH_SCALEFIT, SizeChr(140), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "Memory Peak", 0); AddStaticText(IDC_MEMORY_STAT_MEMORY_PEAK, BFH_SCALEFIT, SizeChr(140), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "Number of Allocations (Current)", 0); AddStaticText(IDC_MEMORY_STAT_NO_OF_ALLOCATIONS_CURRENT, BFH_SCALEFIT, SizeChr(100), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "Number of Allocations (Total)", 0); AddStaticText(IDC_MEMORY_STAT_NO_OF_ALLOCATIONS_TOTAL, BFH_SCALEFIT, SizeChr(100), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "OpenGL memory (total/free) MiB", 0); AddStaticText(IDC_MEMORY_STAT_OGL_MEMORY, BFH_SCALEFIT, SizeChr(100), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "EOGL Texture Cache", 0); AddStaticText(IDC_MEMORY_STAT_EOGL_TEXBUFFER, BFH_SCALEFIT, SizeChr(100), 0, String(), 0);
		AddStaticText(0, BFH_FIT, 0, 0, "EOGL VBO Cache", 0); AddStaticText(IDC_MEMORY_STAT_EOGL_VERTEXBUFFER, BFH_SCALEFIT, SizeChr(100), 0, String(), 0);
	}
	GroupEnd();

	GroupBegin(0, BFH_LEFT, 2, 0, "", 0);
	{
		AddButton(IDC_MEMORY_TEST_1MB, BFH_FIT, 0, 0, "Test Max Memory Alloc (  1 MB)");
		AddStaticText(IDC_MEMORY_TEST_1MB_RES, BFH_FIT, SizeChr(140), 0, String(), 0);

		AddButton(IDC_MEMORY_TEST_10MB, BFH_FIT, 0, 0, "Test Max Memory Alloc ( 10 MB)");
		AddStaticText(IDC_MEMORY_TEST_10MB_RES, BFH_FIT, SizeChr(140), 0, String(), 0);

		AddButton(IDC_MEMORY_TEST_100MB, BFH_FIT, 0, 0, "Test Max Memory Alloc (100 MB)");
		AddStaticText(IDC_MEMORY_TEST_100MB_RES, BFH_FIT, SizeChr(140), 0, String(), 0);
	}
	GroupEnd();

	SetTimer(500);

	return res;
}
Пример #5
0
	virtual Bool CreateLayout(void)
	{
		GroupBegin(0, BFH_SCALEFIT | BFV_SCALEFIT, 2, 0, "", BFV_GRIDGROUP_ALLOW_WEIGHTS);
		AddButton(1000, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog1");
		AddButton(1001, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog1");
		AddButton(1002, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog1");
		AddButton(1003, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog1");
		AddEditNumberArrows(1006, BFH_SCALEFIT);
		AddEditShortcut(1004, BFH_SCALEFIT | BFV_CENTER);

		BaseContainer fontchooserdata;
		fontchooserdata.SetBool(FONTCHOOSER_ENABLE_SIZE, true);
		AddCustomGui(1010, CUSTOMGUI_FONTCHOOSER, String(), BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, fontchooserdata);

		GroupEnd();
		return true;
	}
Пример #6
0
/*********************************************************************\
	Function name    : CCompareTableDialog::CreateLayout
	Description      :
	Created at       : 09.10.01, @ 21:07:14
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CCompareTableDialog::CreateLayout(void)
{
	SetTitle(GeLoadString(IDS_COMPARE_TABLE_CAPTION));

	GroupBegin(101, BFH_FIT, 0, 1, "", 0);
		//AddStaticText(201, BFH_LEFT, 0, 0, GeLoadString(IDS_ORIGINAL_TABLE), 0);
		AddListView(IDC_OUTPUT_LIST, BFH_FIT, 800, 300);
		//AddStaticText(202, BFH_LEFT, 0, 0, GeLoadString(IDS_NEW_TABLE), 0);
		//AddListView(IDC_NEW_LIST, BFH_FIT, 400, 10);
	GroupEnd();

	AddButton(IDS_SAVE_BTN, BFH_LEFT, 0, 0, GeLoadString(IDS_SAVE_RESULT));

	m_wndOutputList.AttachListView(this, IDC_OUTPUT_LIST);

	AddDlgGroup(DLG_OK | DLG_CANCEL);

	return true;
}
Пример #7
0
/*********************************************************************\
	Function name    : CResEditBrowser::CreateLayout
	Description      :
	Created at       : 25.09.01, @ 22:33:40
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CResEditBrowser::CreateLayout(void)
{
	GroupBeginInMenuLine();
	AddButton(IDC_BROWSE_BUTTON, BFH_LEFT, 0, 0, GeLoadString(IDS_BROWSE));
	GroupEnd();

	GroupBegin(101, BFH_SCALEFIT | BFV_SCALEFIT, 1, 0, "", 0);
	if (!m_wndTreeView.CreateTreeView(IDC_DIRECTORY_TREE, this, NOTOK, nullptr,
			TREE_ITEM_SAME_HEIGHT, BFH_SCALEFIT | BFV_SCALEFIT))
		return false;

	GroupEnd();

	/*m_wndListView.AttachListView(this, IDC_FILE_LIST);


	BaseContainer bc;
	bc.SetInt32('name', LV_COLUMN_TEXT);
	m_wndListView.SetLayout(1, bc);*/
	return true;
}
Пример #8
0
	virtual Bool CreateLayout(void)
	{
		GroupBegin(999, BFH_SCALEFIT | BFV_SCALEFIT, 3, 0, "", BFV_GRIDGROUP_ALLOW_WEIGHTS);

		AddStaticText(1000, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1001, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1001, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);

		AddStaticText(1002, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1003, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1003, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);

		AddStaticText(1004, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1005, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);
		AddStaticText(1005, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, "SubDialog2", BORDER_THIN_IN);

		AddEditNumberArrows(1006, BFH_SCALEFIT);

		if (!weights_saved)
		{
			// set the columns
			weights.SetInt32(GROUPWEIGHTS_PERCENT_W_CNT, 3);				// number of rows - has to be equal to the given layout
			weights.SetFloat(GROUPWEIGHTS_PERCENT_W_VAL + 0, 1);		// weight for col 1
			weights.SetFloat(GROUPWEIGHTS_PERCENT_W_VAL + 1, -250);	// FIXED weight for col 2
			weights.SetFloat(GROUPWEIGHTS_PERCENT_W_VAL + 2, 1);		// weight for col 1

			// set the rows
			weights.SetInt32(GROUPWEIGHTS_PERCENT_H_CNT, 4);					// number of rows - has to be equal to the given layout
			weights.SetFloat(GROUPWEIGHTS_PERCENT_H_VAL + 0, -1.0);		// weight for row 1
			weights.SetFloat(GROUPWEIGHTS_PERCENT_H_VAL + 1, -150.0);	// FIXED weight for row 2
			weights.SetFloat(GROUPWEIGHTS_PERCENT_H_VAL + 2, 60.0);		// weight for row 3
			weights.SetFloat(GROUPWEIGHTS_PERCENT_H_VAL + 3, 0.0);		// weight for row 4
			weights_saved = true;
		}

		GroupWeightsLoad(999, weights);

		GroupEnd();
		return true;
	}
Пример #9
0
/*********************************************************************\
	Function name    : CCustomSubDialog::CreateLayout
	Description      :
	Created at       : 27.03.02, @ 12:04:28
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CCustomSubDialog::CreateLayout(void)
{
    Int32 i;
    GroupBegin(100, BFH_SCALEFIT | BFV_SCALEFIT, 2, 0, "", 0);
    Int32 lID = FIRST_CUSTOM_ELEMENT_ID;

    if (!m_pProp || m_pProp[0].type == CUSTOMTYPE_END)
    {
        GroupBegin(100, BFH_SCALEFIT, 1, 0, "", 0);
    }

    AddCheckbox(IDC_CUSTOM_OPEN_CLOSE, BFH_LEFT, 0, 0, "Open");
    Bool b = false;
    if (m_pElement)
    {
        CCustomElements* pElement = g_pCustomElements->GetItem(m_pElement->m_lElement);
        if (pElement)
        {
            BasePlugin *bs = (BasePlugin*)FindPlugin(pElement->m_lID, PLUGINTYPE_CUSTOMGUI);
            if (bs)
            {
                b = true;
                if (!(bs->GetInfo() & CUSTOMGUI_SUPPORT_LAYOUTSWITCH))
                    Enable(IDC_CUSTOM_OPEN_CLOSE, false);
                else
                    Enable(IDC_CUSTOM_OPEN_CLOSE, true);
            }
        }
    }
    if (!b)
        Enable(IDC_CUSTOM_OPEN_CLOSE, true);

    if (!m_pProp || m_pProp[0].type == CUSTOMTYPE_END)
    {
        AddStaticText(100, BFH_LEFT | BFV_CENTER, 0, 0, GeLoadString(IDS_CUSTOM_NO_PROPS), 0);
        GroupEnd();
    }

    AddStaticText(100, 0, 0, 0, "", 0);

    for (i = 0; m_pProp && m_pProp[i].type != CUSTOMTYPE_END; i++, lID++)
    {
        AddStaticText(100, BFH_LEFT | BFV_CENTER, 0, 0, m_pProp[i].ident, 0);
        switch (m_pProp[i].type)
        {
        case CUSTOMTYPE_FLAG:
            AddCheckbox(lID, BFH_LEFT | BFV_CENTER, 0, 0, "");
            break;
        case CUSTOMTYPE_LONG:
            AddEditNumber(lID, BFH_LEFT | BFV_CENTER);
            break;
        case CUSTOMTYPE_REAL:
            AddEditNumber(lID, BFH_LEFT | BFV_CENTER);
            break;
        case CUSTOMTYPE_STRING:
            AddEditText(lID, BFH_SCALEFIT | BFV_CENTER);
            break;
        case CUSTOMTYPE_VECTOR:
            AddEditNumber(lID++, BFH_LEFT | BFV_CENTER);
            AddEditNumber(lID++, BFH_LEFT | BFV_CENTER);
            AddEditNumber(lID, BFH_LEFT | BFV_CENTER);
            break;

        default:
            AddStaticText(lID, BFH_LEFT | BFV_CENTER, 0, 0, "wird auch noch ;-)", 0);
            break;
        }
    }
    /*if (!m_pProp || i == 0)
    	AddStaticText(100, BFH_LEFT | BFV_CENTER, 0, 0, GeLoadString(IDS_CUSTOM_NO_PROPS), 0);*/
    return true;
}
Пример #10
0
void PaletteSubDialog::PaletteLayout()
{
    if(m_rowArea != NULL){
        GetInt32(m_rowArea, m_rows);
    }
    if(m_layoutArea != NULL){
        GetInt32(m_layoutArea, m_layout);
    }
    if(m_labelCheckArea != NULL){
        GetBool(m_labelCheckArea,m_showLabel);
    }
    if(m_searchText != NULL){
        GetString(m_searchText, m_searchString);
    }
    if(m_showControls && !m_controlsShown){
        LayoutFlushGroup(1);
        GroupBegin(51, BFV_SCALEFIT, 1, 0, String(), 0);
            m_nameArea = AddEditText(IDC_NAME, BFH_SCALEFIT);
            SetString(IDC_NAME, m_palette.m_name);
            
            GroupBegin(123,BFH_SCALEFIT,0,1,String(),0);
            String rowText("Rows");
            if(m_layout == 1){
                rowText = String("Columns");
            }
            AddStaticText(9, BFH_LEFT, 0, 0, rowText, 0);
            
            m_rowArea = AddEditNumberArrows(IDC_ROWS, BFH_RIGHT);
            GroupEnd();
            SetInt32(m_rowArea, m_rows,1,99);
            
            m_layoutArea = AddComboBox(IDC_LAYOUT_DIRECTION,BFH_LEFT);
            AddChild(m_layoutArea, 0, String("Horizontal"));
            AddChild(m_layoutArea, 1, String("Vertical"));
            SetInt32(m_layoutArea, m_layout);
            
            m_labelCheckArea = AddCheckbox(IDC_LABELCHECKBOX,BFH_LEFT,0,0,String("Show Labels"));
            SetBool(m_labelCheckArea, m_showLabel);
        
            AddStaticText(IDC_FILTERLABEL, BFH_CENTER, 0, 0, String("Filter:"), 0);
            m_searchText = AddEditText(IDC_SEARCHTEXT, BFH_SCALEFIT);
            SetString(m_searchText, m_searchString);
        
            m_controlsShown = TRUE;
        
			GroupBegin(142,BFV_SCALEFIT,1,0,String(),0);
				GroupBorderNoTitle(BORDER_THIN_IN);
				AddButton(IDC_CREATEMATERIAL, BFH_CENTER, 0, 0, String("Create Materials"));
				m_linkColor = AddCheckbox(IDC_LINKMATERIALS,BFH_LEFT,0,0,String("Link colors"));
			GroupEnd();
        
            AddButton(IDC_HIDE, BFH_CENTER, 0, 0, String("Hide Controls"));
        GroupEnd();
        
        GroupBegin(3,BFV_SCALEFIT,1,0,String(),0);
            m_actionPopup = AddPopupButton(3,BFH_LEFT);
            m_trashArea = AddUserArea(4, BFH_CENTER);
            AttachUserArea(m_trash, m_trashArea);
        GroupEnd();
        LayoutChanged(1);
    }
    if(!m_showControls && m_controlsShown){
        LayoutFlushGroup(1);
            GroupBegin(3,BFV_SCALEFIT,1,0,String(),0);
                m_actionPopup = AddPopupButton(3,BFH_LEFT);
                m_trashArea = AddUserArea(4, BFH_CENTER);
                AttachUserArea(m_trash, m_trashArea);
            GroupEnd();
        LayoutChanged(1);
        m_rowArea = NULL;
        m_layoutArea = NULL;
        m_labelCheckArea = NULL;
        m_searchText = NULL;
        m_controlsShown = FALSE;
    }
    
	LayoutFlushGroup(6);
    LayoutPalette();
	LayoutChanged(6);
}