Пример #1
0
/** \brief
 *
 * Constructor. Sets up a modeless window and adds the HUD component to a
 * ScrolledWindow component.
 *
 */
HUDWindow::HUDWindow()
{
	set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);
	set_title(gettext("Player HUD Window"));
	set_resizable(true);
	set_decorated(true);
	set_position(Gtk::WIN_POS_CENTER);
	set_modal(false);
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	PositionWindow();

    f_charView.AddHUDColumns();
    f_charView.set_border_width( 1 );
    //f_charView.update();
	//
    f_scrolledWindow.add( f_charView );
	f_scrolledWindow.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
	f_scrolledWindow.set_shadow_type( Gtk::SHADOW_IN  );
	f_scrolledWindow.set_border_width( 1 );
	//
	f_mainBox.pack_start( f_scrolledWindow, Gtk::PACK_EXPAND_WIDGET );
	f_mainBox.pack_start( f_statusBox, Gtk::PACK_SHRINK );
	//
	add( f_mainBox );

	f_statusBox.Update();
	
	show_all_children();
}
Пример #2
0
void playerWindow::on_fullscreen_clicked
(
	void
)
{
	// hide all useless stuff for fullscreen mode
	menubar->set_visible(!menubar->get_visible());
	borderleft->set_visible(!borderleft->get_visible());
	borderright->set_visible(!borderright->get_visible());
	// show/hide window decoration 
	set_decorated(!get_decorated());
	// switch between the fullscreen and the unfullscreen button
	unfullscreenBtn->set_visible(!unfullscreenBtn->get_visible());
	fullscreenBtn->set_visible(!fullscreenBtn->get_visible());
	// switch between fullscreen and a decorated window 
	(get_decorated()) ? unmaximize () : maximize ();
	(get_decorated()) ? unfullscreen() : fullscreen();
	// set the fullscreen state
	isFullscreen = !isFullscreen;
	/* Call timeout function at a 3000ms interval to hide or show 
	player controls when it is in fullscreen mode. When the window 
	is no more in the fullscreen mode, timeout signals are
	disconnected motion detector */
	if (isFullscreen) { 
		// set the timer to call periodically the timeout function
		timeout_fullscreen =  Glib::signal_timeout().connect
		(
			sigc::mem_fun
			(
				*this, 
				&playerWindow::on_timeout_fullscreen
			), 
			3000
		);
		// set a motion detector into the drawing area
		mouse_motion_signal_drawingArea = 
			videoDrawingArea->signal_motion_notify_event().connect
		(
			sigc::mem_fun
			(
				*this, 
				&playerWindow::on_mousemove
			)
		);
		/* set the focus into the drawing area. Without the focus, 
		the motion detection doesn't occurs when a movie is playing*/
		videoDrawingArea->set_can_focus
		(
			!videoDrawingArea->get_can_focus()
		);
		// next trigger to attempt to hide the mediaplayer controler
		nextmotiondetection = time(NULL)+3;
	} else {
		// disconnect signals
		timeout_fullscreen.disconnect() ;
		mouse_motion_signal_drawingArea.disconnect();
		// remove the focus
		videoDrawingArea->set_can_focus(!videoDrawingArea->get_can_focus());
	}
}
Пример #3
0
SplashScreen::SplashScreen(Gtk::Window *parent) :
	Gtk::Window(Gtk::WINDOW_POPUP),
	f_parent( parent )
{
    molib::moWCString splash_path( Common::GetFullPathnameForImage( SPLASH_IMAGE ) );

	if( splash_path != "" )
	{
		splash_path = molib::moFile::FullPath(splash_path);
		f_splash.set( splash_path.c_str() );
	}

	set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
	set_title(gettext("Turn Watcher Splashscreen"));
	set_resizable(false);
	set_decorated(false);
	set_has_frame(false);
	set_position(Gtk::WIN_POS_CENTER);
	set_transient_for(*f_parent);	// avoid having an icon in toolbar
	set_modal(true);		// the first click closes the splash no matter where
	set_keep_above();		// keep splashscreen on top of everything
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	add(f_box);

	f_box.add(f_splash);

	f_box.set_events(Gdk::BUTTON_PRESS_MASK);
	f_box.signal_button_press_event().connect(
			sigc::mem_fun(*this, &SplashScreen::on_button_press_event));

	show_all_children();
}
WindowPointer::GtkPointerWindow::
GtkPointerWindow(const PointerSpec &pointerspec):
    area(pointerspec)
{
    add(area);
    area.show();
    set_decorated(false);
    set_keep_above(true);
}
Пример #5
0
GxSplashBox::GxSplashBox()
    : Gtk::Window(Gtk::WINDOW_POPUP) {
    set_redraw_on_allocate(true);
    set_app_paintable();
    signal_expose_event().connect(
        sigc::group(&gx_cairo::splash_expose, GTK_WIDGET(gobj()),
		    sigc::_1, (void*)0), false);
    set_decorated(false);
    set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
    set_position(Gtk::WIN_POS_CENTER );
    set_default_size(280,80);
    show_all();
}
Пример #6
0
FloatWidget::FloatWidget(Gtk::Widget& parent, int width, int height) :
m_width(width),
m_height(height) {
	m_parent = &parent;

	resize(m_width, m_height);
	set_decorated(false);
	set_keep_above();
	set_skip_taskbar_hint(true);
	set_skip_pager_hint(true);
	set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
	reparent(parent);
	
	m_widgetlist.insert(this);
}
Пример #7
0
tempopopup::tempopopup(tempo *a_tempo) :
    m_tempo(a_tempo),
    m_escape(false),
    m_return(false),
    m_is_typing(false),
    m_current_beats(0),
    m_base_time_ms(0),
    m_last_time_ms(0)
{
 //   std::string title = "BPM";
 //   set_title(title);
    set_size_request(150, 50);
    
#if GTK_MINOR_VERSION < 12
    m_tooltips = manage( new Tooltips() );
#endif
    
    /* bpm spin button */
    m_adjust_bpm = manage(new Adjustment(m_tempo->m_mainperf->get_bpm(), c_bpm_minimum -1, c_bpm_maximum, 1));
    m_spinbutton_bpm = manage( new SpinButton( *m_adjust_bpm ));
    m_spinbutton_bpm->set_editable( true );
    m_spinbutton_bpm->set_digits(2);                             // 2 = two decimal precision
    m_adjust_bpm->signal_value_changed().connect(
        mem_fun(*this, &tempopopup::adj_callback_bpm ));
 
    m_spinbutton_bpm->set_numeric();
    
    add_tooltip
    ( 
        m_spinbutton_bpm,
        "Adjust beats per minute (BPM) value.\n"
        "Values range from 0 to 600.00.\n"
        "Escape to leave without setting\n"
        "Entry of 0 indicates a STOP marker.\n"
    );
    
    m_spinbutton_bpm->set_update_policy(Gtk::UPDATE_IF_VALID);  // ignore bad entries
    
    Label* bpmlabel = manage(new Label("BPM"));
    
    /* bpm tap tempo button - sequencer64 */
    m_button_tap = manage(new Button("0"));
    m_button_tap->signal_clicked().connect(sigc::mem_fun(*this, &tempopopup::tap));
    add_tooltip
    (
        m_button_tap,
        "Tap in time to set the beats per minute (BPM) value. "
        "After 5 seconds of no taps, the tap-counter will reset to 0. "
        "Also see the File / Options / Keyboard / Tap BPM key assignment."
    );
    m_button_tap->set_can_focus(false);  // to force all keys to the spin button
    
    HBox *hbox = manage(new HBox());
    hbox->set_border_width(6);
    
    hbox->pack_start(*bpmlabel, Gtk::PACK_SHRINK);
    hbox->pack_start(*m_spinbutton_bpm, Gtk::PACK_SHRINK );
    hbox->pack_start(*m_button_tap, Gtk::PACK_SHRINK, 5 );
    
    add(*hbox);
    set_modal();                            // keep focus until done
    set_transient_for(*m_tempo->m_perfedit); // always on top
    set_decorated(false);                   // don't show title bar
    
    add_events( Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK );
    
    m_timeout_connect = Glib::signal_timeout().connect(
                        mem_fun(*this, &tempopopup::timer_callback), 25);
}
// class constructor
genericFilechooserInputOutput::genericFilechooserInputOutput
(
	Gtk::Window& parent, 
	const Glib::ustring& title,
	const Glib::ustring& inputLabel,
	const Glib::ustring& outputLabel,
	const Glib::ustring& inputButtonLabel,
	const Glib::ustring& outputButtonLabel,
	const Glib::ustring& inputPlaceHolderLabel,
	const Glib::ustring& outputPlaceHolderLabel,
	bool setModal
)
: 
	Gtk::Dialog(title, parent, setModal),
	dialogOptionBox(get_vbox ())
{
	// dialog configuration
	set_resizable(true);
	set_position(Gtk::WIN_POS_CENTER);
	set_decorated(true);
	// define labels
	Gtk::Label * inputPathLabel = Gtk::manage(new Gtk::Label(inputLabel));
	Gtk::Label * outputPathLabel = Gtk::manage(new Gtk::Label(outputLabel));
	// define box
	Gtk::Box * pathInputBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 2));
	Gtk::Box * pathOutputBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 2));
	// define buttons
	pathInputButton = Gtk::manage(new Gtk::Button(inputButtonLabel));
	pathOutputButton = Gtk::manage(new Gtk::Button(outputButtonLabel));
	// define entry
	pathInputEntry = Gtk::manage(new Gtk::Entry());
	pathInputEntry->set_editable(true);
	pathInputEntry->set_placeholder_text(inputPlaceHolderLabel);
	pathOutputEntry = Gtk::manage(new Gtk::Entry());
	pathOutputEntry->set_editable(true);
	pathOutputEntry->set_placeholder_text(outputPlaceHolderLabel);
	// pack the entry and its button
	pathInputBox->pack_start(*pathInputEntry);
	pathInputBox->pack_start(*pathInputButton);
	pathOutputBox->pack_start(*pathOutputEntry);
	pathOutputBox->pack_start(*pathOutputButton);
    // pack elements into the dialog box
    dialogOptionBox->pack_start(*inputPathLabel);
    dialogOptionBox->pack_start(*pathInputBox);
    dialogOptionBox->pack_start(*outputPathLabel);
    dialogOptionBox->pack_start(*pathOutputBox);
	// append filechooser buttons and linked events
	add_button
	(
		Gtk::Stock::CANCEL, 
		Gtk::RESPONSE_CANCEL
	);
	add_button
	(
		Gtk::Stock::OK, 
		Gtk::RESPONSE_OK
	);
	connectSignalClicked();
	show_all_children();
//	
	// run the filechooser and grab the result
	response = run();
}
Пример #9
0
/**
 * The “DockLight” preview allows more control over the opened windows you can 
 * navigate to a specific window much easier. Select the window or close the desired 
 * application, the real time preview make that very easy. 
 */
Preview::Preview()
: Gtk::Window(Gtk::WindowType::WINDOW_POPUP),
m_initialItemMax(0)
{
    m_mouseIn = false;
    m_canLeave = true;
    m_currentIndex = -1;
    m_thisInstance = (Gtk::Window*)this;
    m_dockItemIndex = -1;
    m_dockItemsCount = 0;
    m_previewWidth = DEF_PREVIEW_WIDTH;
    m_previewHeight = DEF_PREVIEW_HEIGHT;
    m_isActive = false;

    // Set up the top-level window.
    set_title("DockPreview");
    set_decorated(false);
    set_app_paintable(true);

    // Set masks for mouse events
    add_events(Gdk::BUTTON_PRESS_MASK |
            Gdk::BUTTON_RELEASE_MASK |
            Gdk::BUTTON_PRESS_MASK |
            Gdk::SCROLL_MASK |
            Gdk::SMOOTH_SCROLL_MASK |
            Gdk::POINTER_MOTION_HINT_MASK |
            Gdk::FOCUS_CHANGE_MASK |
            Gdk::ENTER_NOTIFY_MASK |
            Gdk::LEAVE_NOTIFY_MASK |
            Gdk::POINTER_MOTION_MASK);


    GdkScreen *screen;
    GdkVisual *visual;

    gtk_widget_set_app_paintable(GTK_WIDGET(gobj()), TRUE);
    screen = gdk_screen_get_default();
    visual = gdk_screen_get_rgba_visual(screen);

    if (visual != NULL && gdk_screen_is_composited(screen)) {
        gtk_widget_set_visual(GTK_WIDGET(gobj()), visual);
    }


    font.set_family("System");
    font.set_size(8 * PANGO_SCALE);
    font.set_weight(Pango::WEIGHT_NORMAL);

    Glib::signal_timeout().
            connect(sigc::mem_fun(*this, &Preview::on_timeoutDraw), DEF_FRAMERATE);

    WnckScreen *wnckscreen = wnck_screen_get_default();

    g_signal_connect(G_OBJECT(wnckscreen), "window-opened",
            G_CALLBACK(Preview::on_window_opened), NULL);

    g_signal_connect(wnckscreen, "window_closed",
            G_CALLBACK(Preview::on_window_closed), NULL);


    m_timer.start();

}
TransparentSlider::TransparentSlider() :
    _redInit(0.5),
    _greenInit(1),
    _blueInit(0.5),
    _alphaInit(0.5),
	_buttonLabel("Close"),
	_box(Gtk::ORIENTATION_VERTICAL),
	_inner_box(Gtk::ORIENTATION_HORIZONTAL),
	_alignment(Gtk::ALIGN_END, Gtk::ALIGN_END, 0.0, 0.0),
    _button(_buttonLabel),
    _adjustmentRed(Gtk::Adjustment::create(_redInit, 0, 1.0, 0.1, 0.1, 0)),
    _adjustmentGreen(Gtk::Adjustment::create(_greenInit, 0, 1.0, 0.1, 0.1, 0)),
    _adjustmentBlue(Gtk::Adjustment::create(_blueInit, 0, 1.0, 0.1, 0.1, 0)),
    _adjustmentAlpha(Gtk::Adjustment::create(_alphaInit, 0, 1.0, 0.1, 0.1, 0)),
    _scaleRed(_adjustmentRed, Gtk::ORIENTATION_VERTICAL),
    _scaleGreen(_adjustmentGreen, Gtk::ORIENTATION_VERTICAL),
    _scaleBlue(_adjustmentBlue, Gtk::ORIENTATION_VERTICAL),
    _scaleAlpha(_adjustmentAlpha, Gtk::ORIENTATION_VERTICAL)
{

    // Set up the top-level window.
	set_border_width(10);
    set_title("Color Slider Test");
    set_default_size(400,400);
    set_decorated(false);
    add_events(Gdk::BUTTON_PRESS_MASK);
    set_position(Gtk::WIN_POS_CENTER);
    set_app_paintable(true);

    // Signal handlers
    signal_draw().connect(sigc::mem_fun(*this, &TransparentSlider::on_draw));
    signal_screen_changed().connect(sigc::mem_fun(*this, &TransparentSlider::on_screen_changed));
    signal_button_press_event().connect(sigc::mem_fun(*this, &TransparentSlider::on_window_clicked));
    _button.signal_clicked().connect(sigc::mem_fun(*this, &TransparentSlider::on_button_clicked));

    // Widgets

    // Add the box and pack it.
    add(_box);
    _box.pack_start(_inner_box);
    _box.pack_start(_alignment);

    // Pack the inner box
    _inner_box.set_homogeneous();
    _inner_box.pack_start(_scaleRed);
    _inner_box.pack_start(_scaleGreen);
    _inner_box.pack_start(_scaleBlue);
    _inner_box.pack_start(_scaleAlpha);

    // Set up the scales:
    _scaleRed.set_digits(3);
    _scaleRed.set_inverted();
    _scaleGreen.set_digits(3);
    _scaleGreen.set_inverted();
    _scaleBlue.set_digits(3);
    _scaleBlue.set_inverted();
    _scaleAlpha.set_digits(3);
    _scaleAlpha.set_inverted();

    // Set up the close button
    _alignment.add(_button);
    _button.set_size_request(100, 10);

    // Initialize the process of drawing the colored part.
    on_screen_changed(get_screen());

    // Show the window and all its children.
    show_all_children();
}