예제 #1
0
HGTalkLoginBox::HGTalkLoginBox()
{
	Gtk::Image * pImage = Gtk::manage(new Gtk::Image(HGTALK_ICON_128));
	pack_start(*pImage, FALSE, TRUE, 0);
	pImage->set_size_request(-1, 180);

	Gtk::Label * pTemp = Gtk::manage(new Gtk::Label(HGTALK_USERNAME));
	pTemp->set_alignment(0.0, 0.5);
	pack_start(*pTemp, FALSE, TRUE, 0);
	m_pUsername = Gtk::manage(new HGTalkUsernameEntry);
	pack_start(*m_pUsername, FALSE, TRUE, 0);

	pTemp = Gtk::manage(new Gtk::Label(HGTALK_PASSWORD));
	pTemp->set_alignment(0.0, 0.5);
	pack_start(*pTemp, FALSE, TRUE, 0);
	m_pPassword = Gtk::manage(new HGTalkPasswordEntry);
	pack_start(*m_pPassword, FALSE, TRUE, 0);

	m_pRemPass = 
		Gtk::manage(new HGTalkRempassButton);
	pack_start(*m_pRemPass, FALSE, TRUE, 0);

	Gtk::ButtonBox * pButtonBox =
		Gtk::manage(new Gtk::HButtonBox);
	pack_start(*pButtonBox, FALSE, TRUE, 0);
	Gtk::Button * pButton = 
		Gtk::manage(new HGTalkLoginButton);
	pButtonBox->pack_start(*pButton, FALSE, FALSE, 0);

	m_pTip = Gtk::manage(new Gtk::Label());
	pack_start(*m_pTip, TRUE, TRUE, 0);

	pButtonBox = Gtk::manage(new Gtk::HButtonBox);
	pButtonBox->set_layout(Gtk::BUTTONBOX_END);
	pack_start(*pButtonBox, FALSE, TRUE, 0);

	Gtk::LinkButton * pLinkButton =
		Gtk::manage(new HGTalkPreferencesButton);
	pButtonBox->pack_start(*pLinkButton, FALSE, FALSE, 0);
	pLinkButton = Gtk::manage(new HGTalkAboutButton);
	pButtonBox->pack_start(*pLinkButton, FALSE, FALSE, 0);

	show_all();
}
예제 #2
0
Player_ControlsGUI::Player_ControlsGUI()
: m_VBox_Main(Gtk::ORIENTATION_VERTICAL,20),
  m_VBox(Gtk::ORIENTATION_VERTICAL,10),
  m_SHBox(Gtk::ORIENTATION_VERTICAL,5),
  m_SHBox2(Gtk::ORIENTATION_HORIZONTAL,5),
  m_Frame_Horizontal("Will-tanium Software [^_^] "),
  m_Frame_Vertical("  "),
 
  
  m_progressLabel("000:00:00.000000000 / 000:00:00.000000000"),
m_Alignment(1, 1, 1, 0),
m_AlignmentVol(1,1,0,0),
m_AlignmentSeek(0,0,1,0),
m_playbutton(Gtk::Stock::MEDIA_PLAY), 
	m_pausebutton(Gtk::Stock::MEDIA_PAUSE), 
	m_previousbutton(Gtk::Stock::MEDIA_PREVIOUS),
	m_nextbutton(Gtk::Stock::MEDIA_NEXT),
	m_openbutton(Gtk::Stock::OPEN),
	m_stopbutton(Gtk::Stock::MEDIA_STOP)
{
  set_title("Player Controls:");
  set_default_size(300, 350);
  add(m_VBox_Main);

  m_VBox_Main.pack_start(m_Frame_Horizontal, Gtk::PACK_SHRINK, 5);
  
  //The horizontal ButtonBoxes:
  m_VBox.set_border_width(20);
  m_Frame_Horizontal.add(m_VBox);
 
   Gtk::ButtonBox* bbox = 0;
   bbox = Gtk::manage( new Gtk::ButtonBox(Gtk::ORIENTATION_HORIZONTAL) );
    bbox->set_border_width(5);
   m_VBox.pack_start(*bbox);
  
  // adding the buttons to the box

 bbox->set_layout(Gtk::BUTTONBOX_START);
  bbox->set_spacing(5);

  bbox->add(m_playbutton);
  bbox->add(m_pausebutton);
  bbox->add(m_previousbutton);
  bbox->add(m_nextbutton);
  bbox->add(m_openbutton);
  bbox->add(m_stopbutton);
  
  // give the buttons there behavior and attributes :) Willnux master plan :)
  
  // Step 1: do the button to signal connections :)
  
  m_playbutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_playbutton_pressed));
  m_pausebutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_pausebutton_pressed));
  m_previousbutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_previousbutton_pressed));
  m_nextbutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_nextbutton_pressed));
  m_openbutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_openbutton_pressed));
  m_stopbutton.signal_clicked().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_stopbutton_pressed));

   
 m_playbutton.set_sensitive(false);
 m_pausebutton.set_sensitive(false);
 m_previousbutton.set_sensitive(false);
 m_nextbutton.set_sensitive(false);
 m_openbutton.set_sensitive();
 m_stopbutton.set_sensitive(false);
 m_pausebutton.hide();



  m_VBox.pack_start(m_SHBox2);
 
  m_SHBox2.set_border_width(5); 
  //m_SHBox2.pack_start(m_Alignment,Gtk::PACK_EXPAND_WIDGET,5);
   m_SHBox2.pack_start(m_ProgressBar,Gtk::PACK_EXPAND_WIDGET,5);
 
   
  test_seeker = 0.0;
  
// m_Alignment.add(m_ProgressBar); // my progress bar addition :)
  //m_VBox.pack_start(m_ProgressBar,Gtk::PACK_EXPAND_WIDGET,5);

  m_SHBox2.pack_end(m_progressLabel,Gtk::PACK_SHRINK,5); 
  m_progressLabel.set_alignment(Gtk::ALIGN_CENTER);
  // now for the seek bar
  
  
  // Packing the seeker Component
   
 
  //m_Frame_Vertical.add(m_HBox);
  m_VBox.pack_start(m_AlignmentSeek,Gtk::PACK_SHRINK,5);
  m_AlignmentSeek.add(seeker);
  seeker.set_range(0,1000);
  seeker.set_draw_value(false);
  seeker.signal_change_value().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_value_changed_seeker));
  seeker.set_value(0);
 
  
  // Then we create our Playlist viewer here :)
 
 
 
   
   

   //The vertical ButtonBoxes:
    m_VBox_Main.pack_start(m_Frame_Vertical, Gtk::PACK_SHRINK, 5);  
    m_HBox.set_border_width(2);
    m_Frame_Vertical.add(m_HBox);
    //m_HBox.pack_start(m_CodecInfoArea);

    //deliver_CodecInfo();

    
    //m_VBox_Main.pack_start(video_area,Gtk::PACK_EXPAND_WIDGET,40);
   

  	 m_HBox.pack_start(video_area,Gtk::PACK_EXPAND_WIDGET,40);
// then we connect a signal that we will use to our videa_area
        Gdk::Color color;
	//color = ("red");
	//video_area->modify_bg(Gtk::STATE_NORMAL, color);
	set_screen_resize(640,480);
	video_area.signal_realize().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_video_window_realize));

    



    m_HBox.pack_end(m_AlignmentVol,Gtk::PACK_SHRINK,4);
  
    m_AlignmentVol.add(m_SHBox);
    m_SHBox.pack_start(
    *Gtk::manage(new Gtk::Label("Volume:", 0)), Gtk::PACK_SHRINK);
    
   // define properties for the volume slider
    
    
    m_SHBox.pack_start(vol,Gtk::PACK_SHRINK,2);
    vol.set_range(0,100);
    vol.set_draw_value(false);
    vol.signal_change_value().connect(sigc::mem_fun(*this,&Player_ControlsGUI::on_value_changed_vol));
    vol.set_value(80);	
 // add the vertical lined box to the window



  m_PlaylistView.add(playlist);
  //Set an automatic scrolling policy
  m_PlaylistView.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC);
  m_VBox_Main.pack_end(m_PlaylistView,Gtk::PACK_EXPAND_WIDGET,20);
  show_all_children();
}