当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Group::w方法代码示例

本文整理汇总了C++中Fl_Group::w方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Group::w方法的具体用法?C++ Fl_Group::w怎么用?C++ Fl_Group::w使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fl_Group的用法示例。


在下文中一共展示了Fl_Group::w方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateChannels

void Keyboard::updateChannels(char side) {

	Fl_Group *group;
	gClick   *add;

	if (side == 0)	{
		group = gChannelsL;
		add   = addChannelL;
	}
	else {
		group = gChannelsR;
		add   = addChannelR;
	}

	//printf("[keyboard::updateChannels] side %d has %d widgets\n", side, group->children());

	for (int i=0; i<group->children(); i++) {
		gChannel *gch = (gChannel*) group->child(i);
		gch->position(gch->x(), group->y()+(i*24));
	}
	group->size(group->w(), group->children()*24);
	add->position(add->x(), group->y()+group->h());

	redraw();
}
开发者ID:micahscopes,项目名称:giada,代码行数:25,代码来源:gg_keyboard.cpp

示例2: createBottomBar

Fl_Group* gdSampleEditor::createBottomBar(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(8, waveTools->y()+waveTools->h()+8, w()-16, h);
  g->begin();
    Fl_Group* previewBox = createPreviewBox(g->x(), g->y(), g->h());

    geBox* divisor1 = new geBox(previewBox->x()+previewBox->w()+8, g->y(), 1, g->h());
    divisor1->box(FL_BORDER_BOX);

    Fl_Group* opTools = createOpTools(divisor1->x()+divisor1->w()+12, g->y(), g->h());

    geBox* divisor2 = new geBox(opTools->x()+opTools->w()+8, g->y(), 1, g->h());
    divisor2->box(FL_BORDER_BOX);

    createInfoBox(divisor2->x()+divisor2->w()+8, g->y(), g->h());

  g->end();
  g->resizable(0);

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:21,代码来源:sampleEditor.cpp

示例3: createInfoBox

Fl_Group* gdSampleEditor::createInfoBox(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 400, h);
  g->begin();
    info = new geBox(g->x(), g->y(), g->w(), g->h());
  g->end();	

  info->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_TOP);
  
  updateInfo();

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:13,代码来源:sampleEditor.cpp

示例4: gSampleChannel

gChannel *Keyboard::addChannel(char side, Channel *ch) {
	Fl_Group *group;
	gClick   *add;

	if (side == 0) {
		group = gChannelsL;
		add   = addChannelL;
	}
	else {
		group = gChannelsR;
		add   = addChannelR;
	}

	gChannel *gch = NULL;

	if (ch->type == CHANNEL_SAMPLE)
		gch = (gSampleChannel*) new gSampleChannel(
				group->x(),
				group->y() + group->children() * 24,
				group->w(),
				20,
				(SampleChannel*) ch);
	else
		gch = (gMidiChannel*) new gMidiChannel(
				group->x(),
				group->y() + group->children() * 24,
				group->w(),
				20,
				(MidiChannel*) ch);

	group->add(gch);
	group->size(group->w(), group->children() * 24);
	add->position(group->x(), group->y()+group->h());
	fixRightColumn();
	redraw();

	return gch;
}
开发者ID:micahscopes,项目名称:giada,代码行数:38,代码来源:gg_keyboard.cpp

示例5: uiBasis

uiBasis:: uiBasis( Fl_Group &tabs, const BasisInfo  &bi ) :
name( bi.name ),
group( new Fl_Group( tabs.x(), tabs.y()+24, tabs.w(), tabs.h()-24, bi.name.c_str() ) ),
input()
{
    //--------------------------------------------------------------------------
    // record the new tab
    //--------------------------------------------------------------------------
    tabs.add(group);
    group->labelfont( FL_COURIER );
    group->labelsize( 14 );
  
    
    
    static const int bh = 23;
    
    //--------------------------------------------------------------------------
    // create the parameters
    //--------------------------------------------------------------------------
    const int    h     = group->h();
    const size_t nb    = bi.param.size();
    const int    hfree = h - nb * bh;
    const int    hskip = hfree/(nb+1);
    
    int       y = group->y();
    const int x = group->x() + 8;

    for( size_t i=1; i <= nb; ++i )
    {
        y += hskip;
        const string &param = bi.param[i];
        Fl_Input *box = new Fl_Input(x,y,100,bh,param.c_str());
        box->input_type(FL_FLOAT_INPUT);
        box->labeltype( FL_NORMAL_LABEL );
        box->align(FL_ALIGN_RIGHT);
        box->labelfont(FL_HELVETICA);
        box->labelsize(12);
        box->textsize(12);
        box->textfont(FL_HELVETICA);
        group->add(box);
        box->value("0.0");
        y += bh;
        input.push_back(box);
        box->callback(ChangeCB);
        box->when(FL_WHEN_RELEASE);
    }
    
    
    
}
开发者ID:ybouret,项目名称:convivial2,代码行数:50,代码来源:basis.cpp

示例6: OnAddCommunity

//callback for add Community
void OnAddCommunity(Fl_Widget* pWidget,void * pParam)
{
    const char * scName=fl_input("New Community Name", "");
    if(scName==NULL)
        return ;
    
    char * sName = new char[strlen(scName)*2];
    strcpy(sName,scName);
    
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    Fl_Group* pG = (Fl_Group*)pTab->value();
    
    pTab->begin();
    MakeCommunityPane(10,30,pG->w()-20,pG->h()-10,sName);
    pTab->end();
    
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:18,代码来源:uMS.cpp

示例7: createOpTools

Fl_Group* gdSampleEditor::createOpTools(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 572, h);
  g->begin();
  g->resizable(0);
    volumeTool = new geVolumeTool(g->x(), g->y(), ch);
    boostTool  = new geBoostTool(volumeTool->x()+volumeTool->w()+4, g->y(), ch);
    panTool    = new gePanTool(boostTool->x()+boostTool->w()+4, g->y(), ch);
   
    pitchTool = new gePitchTool(g->x(), panTool->y()+panTool->h()+8, ch);

    rangeTool = new geRangeTool(g->x(), pitchTool->y()+pitchTool->h()+8, ch);
    shiftTool = new geShiftTool(rangeTool->x()+rangeTool->w()+4, pitchTool->y()+pitchTool->h()+8, ch);
    reload    = new geButton(g->x()+g->w()-70, shiftTool->y(), 70, 20, "Reload");
  g->end();

  if (ch->wave->isLogical()) // Logical samples (aka takes) cannot be reloaded.
    reload->deactivate();

  reload->callback(cb_reload, (void*)this);

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:23,代码来源:sampleEditor.cpp

示例8: if

gdEditor::gdEditor(SampleChannel *ch)
	: gWindow(640, 480),
		ch(ch)
{
	set_non_modal();

	if (G_Conf.sampleEditorX)
		resize(G_Conf.sampleEditorX, G_Conf.sampleEditorY, G_Conf.sampleEditorW, G_Conf.sampleEditorH);

	Fl_Group *bar = new Fl_Group(8, 8, w()-16, 20);
	bar->begin();
		reload  = new gClick(bar->x(), bar->y(), 50, 20, "Reload");
		zoomOut = new gClick(bar->x()+bar->w()-20, bar->y(), 20, 20, "-");
		zoomIn  = new gClick(zoomOut->x()-24, bar->y(), 20, 20, "+");
	bar->end();
	bar->resizable(new gBox(reload->x()+reload->w()+4, bar->y(), 80, bar->h()));

	waveTools = new gWaveTools(8, 36, w()-16, h()-120, ch);
	waveTools->end();

	Fl_Group *tools = new Fl_Group(8, waveTools->y()+waveTools->h()+8, w()-16, 130);
	tools->begin();
		volume        = new gDial (tools->x()+42,	                   tools->y(), 20, 20, "Volume");
		volumeNum     = new gInput(volume->x()+volume->w()+4,        tools->y(), 46, 20, "dB");

		boost         = new gDial (volumeNum->x()+volumeNum->w()+80, tools->y(), 20, 20, "Boost");
		boostNum      = new gInput(boost->x()+boost->w()+4,          tools->y(), 46, 20, "dB");

		normalize     = new gClick(boostNum->x()+boostNum->w()+40,   tools->y(), 70, 20, "Normalize");
		pan 				  = new gDial (normalize->x()+normalize->w()+40, tools->y(), 20, 20, "Pan");
		panNum    	  = new gInput(pan->x()+pan->w()+4,              tools->y(), 45, 20, "%");

		pitch				  = new gDial  (tools->x()+42,	                     volume->y()+volume->h()+4, 20, 20, "Pitch");
		pitchNum		  = new gInput (pitch->x()+pitch->w()+4,	           volume->y()+volume->h()+4, 46, 20);
		pitchToBar    = new gClick (pitchNum->x()+pitchNum->w()+4,       volume->y()+volume->h()+4, 46, 20, "To bar");
		pitchToSong   = new gClick (pitchToBar->x()+pitchToBar->w()+4,   volume->y()+volume->h()+4, 46, 20, "To song");
		pitchReset    = new gClick (pitchToSong->x()+pitchToSong->w()+4, volume->y()+volume->h()+4, 46, 20, "Reset");

		chanStart     = new gInput(tools->x()+52,                    pitch->y()+pitch->h()+4, 60, 20, "Start");
		chanEnd       = new gInput(chanStart->x()+chanStart->w()+40, pitch->y()+pitch->h()+4, 60, 20, "End");
		resetStartEnd = new gClick(chanEnd->x()+chanEnd->w()+4,      pitch->y()+pitch->h()+4, 46, 20, "Reset");

	tools->end();
	tools->resizable(new gBox(chanStart->x()+chanStart->w()+4, tools->y(), 80, tools->h()));

	char buf[16];
	///sprintf(buf, "%d", ch->beginTrue / 2); // divided by 2 because stereo
	sprintf(buf, "%d", ch->begin / 2); // divided by 2 because stereo
	chanStart->value(buf);
	chanStart->type(FL_INT_INPUT);
	chanStart->callback(cb_setChanPos, this);

	/* inputs callback: fire when they lose focus or Enter is pressed. */

	chanStart->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY);
	chanEnd  ->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY);

	///sprintf(buf, "%d", ch->endTrue / 2);	// divided by 2 because stereo
	sprintf(buf, "%d", ch->end / 2);  // divided by 2 because stereo
	chanEnd->value(buf);
	chanEnd->type(FL_INT_INPUT);
	chanEnd->callback(cb_setChanPos, this);

	resetStartEnd->callback(cb_resetStartEnd, this);

	volume->callback(cb_setVolume, (void*)this);
	volume->value(ch->guiChannel->vol->value());

	float dB = 20*log10(ch->volume);   // dB = 20*log_10(linear value)
	if (dB > -INFINITY)	sprintf(buf, "%.2f", dB);
	else            		sprintf(buf, "-inf");
	volumeNum->value(buf);
	volumeNum->align(FL_ALIGN_RIGHT);
	volumeNum->callback(cb_setVolumeNum, (void*)this);

	boost->range(1.0f, 10.0f);
	boost->callback(cb_setBoost, (void*)this);
	if (ch->boost > 10.f)
		boost->value(10.0f);
	else
		boost->value(ch->boost);
	boost->when(FL_WHEN_CHANGED | FL_WHEN_RELEASE);

	float boost = 20*log10(ch->boost); // dB = 20*log_10(linear value)
	sprintf(buf, "%.2f", boost);
	boostNum->value(buf);
	boostNum->align(FL_ALIGN_RIGHT);
	boostNum->callback(cb_setBoostNum, (void*)this);

	normalize->callback(cb_normalize, (void*)this);

	pan->range(0.0f, 2.0f);
	pan->callback(cb_panning, (void*)this);

	pitch->range(0.01f, 4.0f);
	pitch->value(ch->pitch);
	pitch->callback(cb_setPitch, (void*)this);
	pitch->when(FL_WHEN_RELEASE);

	sprintf(buf, "%.4f", ch->pitch); // 4 digits
//.........这里部分代码省略.........
开发者ID:micahscopes,项目名称:giada,代码行数:101,代码来源:gd_editor.cpp

示例9: make_window

Fl_Double_Window* ResonanceUI::make_window() {
  { resonancewindow = new Fl_Double_Window(780, 305, "Resonance");
    resonancewindow->user_data((void*)(this));
    { khzvalue = new Fl_Value_Output(415, 264, 45, 18, "kHz");
      khzvalue->labelsize(12);
      khzvalue->minimum(0.001);
      khzvalue->maximum(48);
      khzvalue->step(0.01);
      khzvalue->textfont(1);
      khzvalue->textsize(12);
      khzvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* khzvalue
    { dbvalue = new Fl_Value_Output(415, 282, 45, 18, "dB");
      dbvalue->labelsize(12);
      dbvalue->minimum(-150);
      dbvalue->maximum(150);
      dbvalue->step(0.1);
      dbvalue->textfont(1);
      dbvalue->textsize(12);
      dbvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* dbvalue
    { Fl_Group* o = new Fl_Group(6, 5, 768, 256);
      o->box(FL_BORDER_BOX);
      rg=new ResonanceGraph(o->x(),o->y(),o->w(),o->h(),"");
      rg->init(respar,khzvalue,dbvalue);
      rg->show();
      o->end();
    } // Fl_Group* o
    { Fl_Button* o = new Fl_Button(690, 283, 84, 17, "Close");
      o->box(FL_THIN_UP_BOX);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 264, 66, 15, "Zero");
      o->tooltip("Clear the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Zero);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 282, 66, 18, "Smooth");
      o->tooltip("Smooth the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Smooth);
    } // Fl_Button* o
    { Fl_Check_Button* o = enabled = new Fl_Check_Button(6, 270, 78, 27, "Enable");
      enabled->box(FL_THIN_UP_BOX);
      enabled->down_box(FL_DOWN_BOX);
      enabled->callback((Fl_Callback*)cb_enabled);
      o->value(respar->Penabled);
    } // Fl_Check_Button* enabled
    { maxdb = new Fl_Roller(90, 282, 84, 15);
      maxdb->type(1);
      maxdb->minimum(1);
      maxdb->maximum(90);
      maxdb->step(1);
      maxdb->value(30);
      maxdb->callback((Fl_Callback*)cb_maxdb);
    } // Fl_Roller* maxdb
    { Fl_Value_Output* o = maxdbvo = new Fl_Value_Output(126, 264, 24, 18, "Max.");
      maxdbvo->tooltip("The Maximum amplitude (dB)");
      maxdbvo->labelsize(12);
      maxdbvo->minimum(1);
      maxdbvo->maximum(127);
      maxdbvo->step(1);
      maxdbvo->value(30);
      maxdbvo->textfont(1);
      maxdbvo->textsize(12);
      maxdbvo->callback((Fl_Callback*)cb_maxdbvo);
      o->value(respar->PmaxdB);
    } // Fl_Value_Output* maxdbvo
    { new Fl_Box(150, 264, 24, 18, "dB");
    } // Fl_Box* o
    { Fl_Value_Output* o = centerfreqvo = new Fl_Value_Output(210, 264, 33, 18, "C.f.");
      centerfreqvo->tooltip("Center Frequency (kHz)");
      centerfreqvo->labelsize(12);
      centerfreqvo->minimum(1);
      centerfreqvo->maximum(10);
      centerfreqvo->step(0.01);
      centerfreqvo->value(1);
      centerfreqvo->textfont(1);
      centerfreqvo->textsize(12);
      centerfreqvo->callback((Fl_Callback*)cb_centerfreqvo);
      centerfreqvo->when(3);
      o->value(respar->getcenterfreq()/1000.0);
    } // Fl_Value_Output* centerfreqvo
    { Fl_Value_Output* o = octavesfreqvo = new Fl_Value_Output(210, 282, 33, 18, "Oct.");
      octavesfreqvo->tooltip("No. of octaves");
      octavesfreqvo->labelsize(12);
      octavesfreqvo->minimum(1);
      octavesfreqvo->maximum(127);
      octavesfreqvo->step(1);
      octavesfreqvo->value(30);
      octavesfreqvo->textfont(1);
      octavesfreqvo->textsize(12);
      octavesfreqvo->callback((Fl_Callback*)cb_octavesfreqvo);
      octavesfreqvo->when(3);
//.........这里部分代码省略.........
开发者ID:ishkabbible,项目名称:ZASF,代码行数:101,代码来源:ResonanceUI.c

示例10: KMeans

ClusterView2D::ClusterView2D(int x, int y, int w, int h, int inResolution, cxVolume * pVolume) : Fl_Gl_Window(x, y, w, h-COLOR_CHOOSER_HEIGHT){

	//mode(FL_ALPHA | FL_DEPTH | FL_DOUBLE | FL_RGB8 );
	//	Fl::add_idle(&idle_cp, (void*)this);
	opacityDisp = 0;
	histogram1D = 0;
	m_dataPts = NULL;
	m_cluster = NULL;
	m_ctrs = NULL;
	m_pVolume = pVolume;
	
	m_percentHeight = (float)COLOR_CHOOSER_HEIGHT / (float) h;
	m_percentWidth = (float)COLOR_CHOOSER_WIDTH / (float) w;
	ClusterView2D *ihateptrs = this; // this is necessary because &this doesnt work.
		
	//m_buttonA = new Fl_Button(x+MARGIN+COLOR_CHOOSER_WIDTH, y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN, BUTTON_WIDTH,BUTTON_HEIGHT, "Reset");
	//m_buttonA->callback((Fl_Callback*)cb_buttonA, this);
	//m_buttonA->resizable(0);
	

	Fl_Group* o = new Fl_Group(	2,
								y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN,
								COLOR_CHOOSER_WIDTH*3,
								COLOR_CHOOSER_HEIGHT*4,"K-Means settings");
    o->box(FL_ENGRAVED_FRAME);
    o->align(FL_ALIGN_TOP_LEFT);

	m_pInputA = new Fl_Input(	o->x()+3,
								o->y()+MARGIN,
								BUTTON_WIDTH*2 + 3*2,
								BUTTON_HEIGHT,"Filename");
    m_pInputA->value("");
	m_pInputA->align(FL_ALIGN_RIGHT);
	
	m_pButtonChooser = new Fl_Button(	(m_pInputA->x()+m_pInputA->w()),
										o->y()+ MARGIN, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Browse..");
    m_pButtonChooser->callback((Fl_Callback *)cb_ButtonChooser, this);
	
	m_pFileChooser = NULL;
	
	m_inp_tch = new Fl_Input(o->x() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, BUTTON_WIDTH, BUTTON_HEIGHT, "timesteps intervals");
	m_inp_tch->align(FL_ALIGN_TOP_LEFT);
	m_inp_tch->value("12");
	
	m_inp_t = new Fl_Input(o->x() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "algorithm");
    m_inp_t->align(FL_ALIGN_TOP_LEFT);
	m_inp_t->value("0");
	
	m_inp_k = new Fl_Input(m_inp_tch->x()+m_inp_tch->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, BUTTON_WIDTH, BUTTON_HEIGHT, "clusters");
	m_inp_k->align(FL_ALIGN_TOP_LEFT);
	m_inp_k->value("3");
	
	m_inp_s = new Fl_Input(m_inp_t->x()+m_inp_t->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "stages");
	m_inp_s->align(FL_ALIGN_TOP_LEFT);
	m_inp_s->value("300");
	
	m_inp_start_time = new Fl_Input(m_inp_k->x()+m_inp_k->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, 
									BUTTON_WIDTH, BUTTON_HEIGHT, "start timestep");
	m_inp_start_time->align(FL_ALIGN_TOP_LEFT);
	m_inp_start_time->value("0");

	m_inp_total_time = new Fl_Input(m_inp_s->x()+m_inp_s->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + 
									MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "number of timesteps");
	m_inp_total_time->align(FL_ALIGN_TOP_LEFT);
	m_inp_total_time->value("120");


	Fl_Button* bt_save = new Fl_Button(	m_inp_tch->x()+m_inp_tch->w() + 3,
										m_pInputA->y()+ BUTTON_HEIGHT*5 + MARGIN*3, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Create new cluster");
	bt_save->callback((Fl_Callback *)cb_ButtonSave, this);

	Fl_Button* bt_load = new Fl_Button(	bt_save->x()+bt_save->w()+3,
										m_pInputA->y()+ BUTTON_HEIGHT*5 + MARGIN*3, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Load cluster");
	bt_load->callback((Fl_Callback *)cb_ButtonLoad, this);	

	
	o->end();
	m_pLB = new Fl_Light_Button(o->x() + o->w() + 3,
			 	    (y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN), 
				    BUTTON_WIDTH,BUTTON_HEIGHT, "Show all clusters");
    //m_pLB->labelsize(TEXTSIZE);
    m_pLB->callback((Fl_Callback *)cb_LB, this);
	m_pLB->set();
	m_bshowall = true; 

	m_pButtonNext = new Fl_Button(	o->x() + o->w() + 3,
									(y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN + BUTTON_HEIGHT + 3),
									BUTTON_WIDTH, BUTTON_HEIGHT,"Next Cluster");
    m_pButtonNext->callback((Fl_Callback *)cb_ButtonNext, this);

#ifdef CHANGES
	m_pButtonClear = new Fl_Light_Button(	o->x() + o->w() + 3,
									(y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN + BUTTON_HEIGHT*2 + 6),
									BUTTON_WIDTH, BUTTON_HEIGHT,"Clear Cluster");
    m_pButtonClear->callback((Fl_Callback *)cb_ButtonClear, this);
	m_pButtonClear->set();
	m_bClear = true;
//.........这里部分代码省略.........
开发者ID:sukharev,项目名称:ucd,代码行数:101,代码来源:clusterview2d.cpp

示例11: make_group

void Fl_File_Dialog::make_group(int w, int h)
{	
	{
		Fl_Group* o = new Fl_Group(5, 5, w-10, 35);
		o->box(FL_THIN_UP_BOX);
		
		up_ = new Fl_Highlight_Button(5, 5, 25, 25);
		up_->image(up_pix);
		home_ = new Fl_Highlight_Button(35, 5, 25, 25);
		home_->image(home_pix);
		refresh_ = new Fl_Highlight_Button(65, 5, 25, 25);
		refresh_->image(refresh_pix);
		new_folder_ = new Fl_Highlight_Button(95, 5, 25, 25);
		new_folder_->image(new_pix);
		
		path_ = new Fl_Input_Browser(125, 5, w-140, 25); 
		path_->type(Fl_Input_Browser::NONEDITABLE);
		path_->end();
		Fl_Group::current()->resizable(path_);

		o->end();
	} //end top

	{
		Fl_Group* o = new Fl_Group(5, 45, w-10, h-140);
		o->box(FL_FLAT_BOX);
		int W=o->w(), H=o->h();

		listview_ = new Fl_ListView(0, 0, W-5, H);
		listview_->add_column("File");
		listview_->add_column("Size",80);
		listview_->add_column("Type",80);
		listview_->add_column("Modified",120);
		listview_->column_flags(0,FL_ALIGN_LEFT);
		listview_->column_flags(1,FL_ALIGN_LEFT);
		listview_->column_flags(2,FL_ALIGN_LEFT);
		listview_->column_flags(3,FL_ALIGN_LEFT);		
		listview_->end();

		preview_ = new PreviewBox(0, 0, 0, 0);
		preview_->label(preview_text);
		preview_->hide();
		preview_->box(FL_THIN_DOWN_BOX);
		preview_info_ = new Fl_Box(0, 0, 0, 0);
		preview_info_->label(preview_info);
		preview_info_->hide();
		preview_info_->box(FL_FLAT_BOX);
		preview_info_->label_size(11);
		preview_info_->label_font(FL_HELVETICA);
		preview_info_->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT|FL_ALIGN_TOP);
						
		o->resizable(o);
		o->end();
		resizable(o);	

		// Outside of group
		preview_but_ = new Fl_Check_Button(5, 45+H, W, 18, "Show Preview");
		preview_but_->text_size(10);
                preview_but_->value(Fl_File_Dialog::initial_preview);
                if(mode()==DIRECTORY) preview_but_->deactivate();
	}

	{
		Fl_Group* o = new Fl_Group(5, h-70, w-10, 30);
		
		//location_ = new Fl_FileInput(55, 0, w-120, 25, "Location:");
		location_ = new Fl_Input_Browser(55, 0, w-120, 25, "Location:");
		location_->maxh(200);
		location_->callback(cb_location, this);
		location_->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);

		Fl_Group::current()->resizable(location_);

		ok_ = new Fl_Return_Button(w-60, 0, 50, 25, "OK");
		ok_->shortcut(0xff0d);
		
		o->end();
	} //loc, ok
	
	{
		Fl_Group* o = new Fl_Group(5, h-35, w-10, 30);
		
		filter_ = new Fl_Input_Browser(40, 0, w-105, 25, "Filter:");		
		filter_->type(Fl_Input_Browser::NONEDITABLE);
		
		filter_->end();
		Fl_Group::current()->resizable(filter_);
		
		cancel_ = new Fl_Button(w-60, 0, 50, 25, "&Cancel");
		
		o->end();
	}

	preview(Fl_File_Dialog::initial_preview);	
}
开发者ID:edeproject,项目名称:svn,代码行数:95,代码来源:Fl_File_Dialog.cpp


注:本文中的Fl_Group::w方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。