void
on_print_bw_button_clicked             (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));
		short value;

		if( IsGrayPrint(g_main_window) )
			value = CND_BJGRAYSCALE_ON;
		else
			value = CND_BJGRAYSCALE_OFF;

		UpdateMenuLink(CNCL_GRAYSCALE, value);

		UpdateWidgets(window, "print_bw_button");

#ifdef	GUI_WITH_PIXMAPS
		UpdateDrawingArea(window, "basic_draw_area");
		UpdateDrawingArea(window, "quality_draw_area");
#endif
	}
	EnableSignal();
}
gboolean
on_quality_draw_area_expose_event      (GtkWidget       *widget,
                                        GdkEventExpose  *event,
                                        gpointer         user_data)
{
	DrawQualityDrawingArea(GetTopWidget(widget), widget);
	return TRUE;
}
Exemple #3
0
void
on_color_dialog_vivid_button_clicked   (GtkButton       *button,
                                        gpointer         user_data)
{
	GtkWidget* window = GetTopWidget(GTK_WIDGET(button));
	gboolean vivid_active = GTK_TOGGLE_BUTTON(LookupWidget(window,
								"color_dialog_vivid_button"))->active;

	SensitiveColorCorrectCombo(g_color_dialog, !vivid_active);
}
void HideDialog(UIDialog* dialog) 
{
	gint pos_x, pos_y;
	gdk_window_get_root_origin(dialog->window->window, &pos_x, &pos_y);

	dialog->pos_x = pos_x;
	dialog->pos_y = pos_y;

	gtk_widget_hide(GetTopWidget(dialog->window));
	gtk_main_quit();
}
Exemple #5
0
wxSize wxControl::DoGetBestSize() const
{
    Widget w = (Widget)GetTopWidget();

    // Do not return any arbitrary default value...
    wxASSERT_MSG (w, wxT("DoGetBestSize called before creation"));

    XtWidgetGeometry preferred;
    XtQueryGeometry (w, NULL, &preferred);

    return wxSize(preferred.width, preferred.height);
}
/* Send button */
void
on_setconfig_type001_button1_clicked
                                        (GtkButton       *button,
                                        gpointer         user_data)
{
	LPSETCONFIGCOMPTYPE001WORK lpWk = (LPSETCONFIGCOMPTYPE001WORK)gLPSetConfigWork;
	if ( CheckWorkType001() != 0 ) goto Err;
	GtkWidget* window = GetTopWidget(GTK_WIDGET(button));	
	GtkWidget* check_button = NULL;

	if ( lpWk->uiType == UI_CUSTOMSETTINGS_TYPE001 ){
		/* Abrasion Prevention */
		check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton1");
		gCurrentAbrasionPrevention =  GTK_TOGGLE_BUTTON(check_button)->active;

		/* Manual Head Alignment */
		check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton2");
		gCurrentManualHeadMode =  GTK_TOGGLE_BUTTON(check_button)->active;

		/* Dry Level */
		gCurrentDryLevelValue = (short)GetActiveButtonIndex( window, setconfig_type001_radiobutton_name, CUSTOM_SETTINGS_TYPE001_RADIOBUTTON_DEFAULT );
	}
	else if ( lpWk->uiType == UI_AUTOPOWER_TYPE001 ) {
		GtkWidget *onCombo, *offCombo;
		gchar *onStr, *offStr;
		short onSize, offSize;

		onCombo = LookupWidget( GTK_WIDGET(button), "setconfig_type001_combobox201" );
		offCombo = LookupWidget( GTK_WIDGET(button), "setconfig_type001_combobox202" );

		onStr = gtk_combo_box_get_active_text(GTK_COMBO_BOX(onCombo));
		offStr = gtk_combo_box_get_active_text(GTK_COMBO_BOX(offCombo));

		onSize = sizeof(setconfig_type001_02_onlist)/sizeof(*setconfig_type001_02_onlist);
		offSize = sizeof(setconfig_type001_02_offlist)/sizeof(*setconfig_type001_02_offlist);

		gCurrentAutoPowerOnIndex = GetAutoPowerIndex( (char **)setconfig_type001_02_onlist, onSize, onStr );
		gCurrentAutoPowerOffIndex = GetAutoPowerIndex( (char **)setconfig_type001_02_offlist, offSize, offStr );
	}	
	else if ( lpWk->uiType == UI_PAPERSOURCESETTINGS_TYPE001 ) {
		gCurrentPaperSourceSettingsValue = 
			(short)GetActiveButtonIndex( window, setconfig_type001_ps_radiobutton_name, PAPERSOURCE_SETTINGS_TYPE001_RADIOBUTTON_DEFAULT );
	}
	else if ( lpWk->uiType ==  UI_QUIET_TYPE001 ){
		check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton401");
		gCurrentQuietMode =  GTK_TOGGLE_BUTTON(check_button)->active;
	}

	lpWk->status = US_SEND;
Err:
	gtk_widget_destroy(gtk_widget_get_toplevel(GTK_WIDGET(button)));
}
void wxRadioBox::ChangeFont(bool keepOriginalSize)
{
    wxWindow::ChangeFont(keepOriginalSize);

    for (unsigned int i = 0; i < m_noItems; i++)
    {
        WXWidget radioButton = m_radioButtons[i];

        XtVaSetValues ((Widget) radioButton,
                       wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay((Widget) GetTopWidget())),
                       NULL);
    }
}
void
on_setconfig_type001_checkbutton_toggled
                                        (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton));	

	if ( GTK_WIDGET_VISIBLE( window ) == TRUE ){	
		if( GTK_TOGGLE_BUTTON(togglebutton)->active ) {
			UtilMessageBox(LookupText(g_keytext_list, "LUM_LID_WARNING_PAPER_ABRASION"), g_window_title, MB_ICON_NO | MB_OK);
		}
	}
}
void
on_borderless_button_clicked           (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));

		if( GTK_TOGGLE_BUTTON(button)->active )
		{
			short media_type_value = GetCurrentnValue(CNCL_MEDIATYPE);

			if( IsAvailableMediaBorder(g_mediaborder_dialog, media_type_value) )
			{
				gchar* alert_msg
					= LookupText(g_keytext_list, "mediaborder_alert");
				UtilMessageBox(alert_msg, g_window_title,
					MB_OK | MB_ICON_INFORMATION);

				UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS);
			}
			else
			{
				short new_media_type_value;
				if( (new_media_type_value
						= ShowMediaBorderDialog(g_mediaborder_dialog,
												media_type_value)) != -1 )
				{
					UpdateMenuLink(CNCL_MEDIATYPE, new_media_type_value);
					UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS);
				}
				else
				{
					gtk_toggle_button_set_active(
						GTK_TOGGLE_BUTTON(button), FALSE);
				}
			}
		}
		else
		{
			UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_NORMAL);
		}

		UpdateWidgets(window, "borderless_button");

#ifdef	GUI_WITH_PIXMAPS
		UpdateDrawingArea(window, "basic_draw_area");
#endif
	}
	EnableSignal();
}
void
on_border_ext_i_button_toggled         (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton));
		g_main_window->ext_border
			= GetActiveButtonIndex(window, g_border_ext_button_name, 3);

		UpdateWidgets(window, "border_ext_button");
	}
	EnableSignal();
}
void
on_quality_dialog_ht_button_toggled    (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton));
		int bin_method = GetActiveButtonIndex(window, bin_method_button_name,0);

		UpdateMenuLink(CNCL_DITHER_PAT, bin_method_button_value[bin_method]);

		UpdateQualityDialogWidgets(window, "quality_ht_button");
	}
	EnableSignal();
}
void
on_printing_scaling_spin_changed       (GtkEditable     *editable,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(editable));
		GtkSpinButton* scaling_spin
			= (GtkSpinButton*)LookupWidget(window, "printing_scaling_spin");
		g_main_window->scaling = (short)scaling_spin->adjustment->value;

//		UpdateWidgets(window, "pringing_scaling_spin");
	}
	EnableSignal();
}
gboolean
on_color_sample_draw_area_expose_event (GtkWidget       *widget,
                                        GdkEventExpose  *event,
                                        gpointer         user_data)
{
	GdkWindow* window = widget->window;
	GdkGC* gc = gdk_gc_new(window);
	GdkPixmap* pixmap;

	pixmap = LoadPixmap(GetTopWidget(widget), NULL, "color_sample.xpm");
	DrawPixmap(window, gc, 0, 0, pixmap, NULL);
	FreePixmap(pixmap, NULL);

	gdk_gc_unref(gc);
	return TRUE;
}
void
on_centering_button_clicked            (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));

		if( GTK_TOGGLE_BUTTON(button)->active )
			g_main_window->centering = LOCATION_CENTER;
		else
			g_main_window->centering = LOCATION_UPPERLEFT;

		UpdateWidgets(window, "centering_button");
	}
	EnableSignal();
}
/* Ver.3.50 */
void
on_setconfig_type001_checkbutton3_toggled
                                        (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton));
	int status;

	if ( GTK_WIDGET_VISIBLE( window ) == TRUE ){	
		if( GTK_TOGGLE_BUTTON(togglebutton)->active ) {
			status = UtilMessageBox(LookupText(g_keytext_list, "LUM_IDS_MNTMSG_PREVENTPAPERGAP_MSG"), g_window_title, MB_ICON_EXCLAMATION | MB_OK | MB_CANCEL);
			if ( (status == US_CANCEL) || (status == US_X) ){
				gtk_toggle_button_set_active( togglebutton, FALSE );
			}
		}
	}
}
Exemple #16
0
wxSize wxTextCtrl::DoGetBestSize() const
{
    if( IsSingleLine() )
    {
        wxSize best = wxControl::DoGetBestSize();
#if wxCHECK_MOTIF_VERSION( 2, 3 )
        // OpenMotif 2.3 gives way too big X sizes
        wxSize other_best = wxDoGetSingleTextCtrlBestSize
                                ( (Widget) GetTopWidget(), this );
        return wxSize( other_best.x, best.y );
#else
        if( best.x < 90 ) best.x = 90;

        return best;
#endif
    }
    else
        return wxWindow::DoGetBestSize();
}
Exemple #17
0
void wxTopLevelWindowMotif::Lower()
{
    Widget top = (Widget) GetTopWidget();
    Window parent_window = XtWindow( top ),
        next_parent   = XtWindow( top ),
        root          = RootWindowOfScreen( XtScreen( top ) );
    // search for the parent that is child of ROOT, because the WM may
    // reparent twice and notify only the next parent (like FVWM)
    while( next_parent != root )
    {
        Window *theChildren;
        unsigned int n;

        parent_window = next_parent;
        XQueryTree( XtDisplay( top ), parent_window, &root,
            &next_parent, &theChildren, &n );
        XFree( theChildren ); // not needed
    }
    XLowerWindow( XtDisplay( top ), parent_window );
}
Exemple #18
0
void wxTopLevelWindowMotif::DoGetPosition(int *x, int *y) const
{
    Widget top = (Widget) GetTopWidget();
    Window parent_window = XtWindow((Widget) top),
        next_parent   = XtWindow((Widget) top),
        root          = RootWindowOfScreen(XtScreen((Widget) top));

    // search for the parent that is child of ROOT, because the WM may
    // reparent twice and notify only the next parent (like FVWM)
    while (next_parent != root) {
        Window *theChildren; unsigned int n;
        parent_window = next_parent;
        XQueryTree(XtDisplay((Widget) top), parent_window, &root,
            &next_parent, &theChildren, &n);
        XFree(theChildren); // not needed
    }
    int xx, yy; unsigned int dummy;
    XGetGeometry(XtDisplay((Widget) top), parent_window, &root,
        &xx, &yy, &dummy, &dummy, &dummy, &dummy);
    if (x) *x = xx;
    if (y) *y = yy;
}
/*-------------------------------------------------------------------------------
	SetConfigType001 callback functions
-------------------------------------------------------------------------------*/
static void GetParmSetConfigType001_CustomSettings( int uiType, GtkButton *button )
{
	GtkWidget* check_button = NULL;
	GtkWidget* window = GetTopWidget(GTK_WIDGET(button));

	/* Abrasion Prevention */
	check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton1");
	gCurrentAbrasionPrevention =  GTK_TOGGLE_BUTTON(check_button)->active;

	/* Manual Head Alignment */
	check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton2");
	gCurrentManualHeadMode =  GTK_TOGGLE_BUTTON(check_button)->active;

	/* Dry Level */
	gCurrentDryLevelValue = (short)GetActiveButtonIndex( window, setconfig_type001_radiobutton_name, CUSTOM_SETTINGS_TYPE001_RADIOBUTTON_DEFAULT );

	if ( uiType == UI_CUSTOMSETTINGS_TYPE002 ){
		/* Prevent Paper Jam */
		check_button = LookupWidget( GTK_WIDGET(button), "setconfig_type001_checkbutton3");
		gCurrentPreventPaperJam = GTK_TOGGLE_BUTTON(check_button)->active;
	}
}
/* Spin BUtton */
static void C_DLG_SpinValueChanged( GtkSpinButton   *spinbutton , short id )
{
	short	spin_value;
	GtkWidget* window = GetTopWidget(GTK_WIDGET(spinbutton));


	if( DisableSignal() )
	{
		spin_value = spinbutton->adjustment->value;
	
		/* Prevent from showing "-0" */
		if( CofirmSpinValue( spinbutton ) )
		{
#ifdef _PRINTUI_DEBUG_
			fprintf(stderr,"change -0 to 0 (C_DLG_SpinValueChanged)\n" );
#endif
		}

		/* Update sacle value */
		gtk_range_set_value( GTK_RANGE(LookupWidget(window, spin_scale_table[id].scale_name )) , (gdouble)spin_value );
	}
	EnableSignal();
}
void
on_quality_button_clicked              (GtkButton       *button,
                                        gpointer         user_data)
{
	if( DisableSignal() )
	{
		GtkWidget* window = GetTopWidget(GTK_WIDGET(button));
		int quality
		 = g_mess_map[GetActiveButtonIndex(window, g_quality_button_name,0)];

		switch( quality )
		{
		case CNCL_MESS_Q_MAP1:
		case CNCL_MESS_Q_MAP2:
		case CNCL_MESS_Q_MAP3:
		{
			UpdateMenuLink(CNCL_PRINTQUALITY, GetCurrentnValue(quality));
			UpdateMenuLink(CNCL_DITHER_PAT, CND_UIBIN_ED);
			break;
		}
		default:
		{
			UpdateMenuLink(CNCL_PRINTQUALITY, g_quality_dialog->print_quality);
			UpdateMenuLink(CNCL_DITHER_PAT, g_quality_dialog->bin_method);
			break;
		}
		}
		

		UpdateWidgets(window, "quality_buttons");
#ifdef	GUI_WITH_PIXMAPS
		UpdateDrawingArea(window, "quality_draw_area");
#endif
	}
	EnableSignal();
}