Commit 820e47e3 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

New file. A simplified and robust font selector for Gnumeric.

1999-07-11  Miguel de Icaza  <miguel@gnu.org>

	* src/widget-font-selector.c: New file.  A simplified and robust
	font selector for Gnumeric.
parent a3506bf7
1999-07-11 Miguel de Icaza <miguel@gnu.org>
* src/widget-font-selector.c: New file. A simplified and robust
font selector for Gnumeric.
1999-07-11 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (context_cut_cmd, context_copy_cmd context_paste_cmd,
......
SUBDIRS = intl po macros plugins src doc icons
change_logs = \
OChangeLog
EXTRA_DIST = \
gnumeric.desktop README HACKING gnumeric.spec.in \
gnumeric.keys.in gnumeric.mime $(appicon_DATA) \
gnumeric.gnorba
gnumeric.gnorba $(change_logs)
appicondir = $(datadir)/pixmaps
appicon_DATA = gnome-gnumeric.png gnome-gnumeric-xl.png
......
1999-07-11 Miguel de Icaza <miguel@gnu.org>
* src/widget-font-selector.c: New file. A simplified and robust
font selector for Gnumeric.
1999-07-11 Jody Goldberg <jgoldberg@home.com>
* src/item-grid.c (context_cut_cmd, context_copy_cmd context_paste_cmd,
......
......@@ -44,6 +44,11 @@ Gnumeric Spread Sheet task list
* Add column/row title printing
* Add color printing support.
* Font dialog
* Get the list of *valid* fonts from GnomePrint
* Create a simplistic dialog (to map to font-bold yes/no).
* Cell dimension computation is broken on font change for multilines.
* Number formatting
......
......@@ -37,3 +37,4 @@ src/xml-io.c
src/print.glade.h
src/import.glade.h
src/hf-config.glade.h
src/font-sel.glade.h
\ No newline at end of file
......@@ -166,6 +166,8 @@ GNUMERIC_BASE_SOURCES = \
utils.h \
widget-editable-label.c \
widget-editable-label.h \
widget-font-selector.c \
widget-font-selector.h \
workbook.c \
xml-io.c \
xml-io.h
......@@ -246,11 +248,13 @@ idl_DATA = Gnumeric.idl
gladedir = $(datadir)/gnumeric/glade
glade_DATA = \
font-sel.glade \
hf-config.glade \
import.glade \
print.glade
glade_msgs = \
font-sel.glade.h \
hf-config.glade.h \
import.glade.h \
print.glade.h
......
......@@ -15,6 +15,7 @@
#include "format.h"
#include "formats.h"
#include "pattern-selector.h"
#include "widget-font-selector.h"
/* The main dialog box */
static GtkWidget *cell_format_prop_win = 0;
......@@ -523,12 +524,10 @@ font_changed (GtkWidget *widget, GtkStyle *previous_style, GnomePropertyBox *pro
static GtkWidget *
create_font_page (GtkWidget *prop_win, CellList *cells)
{
GtkWidget *font_widget;
font_widget = gnome_font_selection_new ();
font_widget = font_selector_new ();
gtk_widget_show (font_widget);
gtk_signal_connect (GTK_OBJECT (GNOME_FONT_SELECTION (font_widget)->preview),
gtk_signal_connect (GTK_OBJECT (FONT_SELECTOR (font_widget)->font_preview),
"style_set",
GTK_SIGNAL_FUNC (font_changed), prop_win);
return font_widget;
......
......@@ -15,6 +15,7 @@
#include "format.h"
#include "formats.h"
#include "pattern-selector.h"
#include "widget-font-selector.h"
/* The main dialog box */
static GtkWidget *cell_format_prop_win = 0;
......@@ -523,12 +524,10 @@ font_changed (GtkWidget *widget, GtkStyle *previous_style, GnomePropertyBox *pro
static GtkWidget *
create_font_page (GtkWidget *prop_win, CellList *cells)
{
GtkWidget *font_widget;
font_widget = gnome_font_selection_new ();
font_widget = font_selector_new ();
gtk_widget_show (font_widget);
gtk_signal_connect (GTK_OBJECT (GNOME_FONT_SELECTION (font_widget)->preview),
gtk_signal_connect (GTK_OBJECT (FONT_SELECTOR (font_widget)->font_preview),
"style_set",
GTK_SIGNAL_FUNC (font_changed), prop_win);
return font_widget;
......
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>font-sel.glade</name>
<program_name>font-sel.glade</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>False</use_widget_names>
<output_main_file>True</output_main_file>
<output_support_files>True</output_support_files>
<output_build_files>True</output_build_files>
<backup_source_files>True</backup_source_files>
<main_source_file>interface.c</main_source_file>
<main_header_file>interface.h</main_header_file>
<handler_source_file>callbacks.c</handler_source_file>
<handler_header_file>callbacks.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>font-sel.glade.h</translatable_strings_file>
</project>
<widget>
<class>GtkWindow</class>
<name>font-toplevel</name>
<visible>False</visible>
<title>window1</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkTable</class>
<name>toplevel-table</name>
<border_width>3</border_width>
<rows>4</rows>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>6</column_spacing>
<widget>
<class>GtkEntry</class>
<name>font-style-entry</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<editable>False</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
<widget>
<class>GtkEntry</class>
<name>font-size-entry</name>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<width>60</width>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
<widget>
<class>GtkLabel</class>
<name>label1</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<label>Font:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<name>label2</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<label>Font style:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<name>label3</name>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<label>Size:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkEntry</class>
<name>font-name-entry</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<editable>False</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame1</name>
<border_width>4</border_width>
<child>
<left_attach>0</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<label>Preview:</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkEntry</class>
<name>preview-entry</name>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>AaBbCcDdEe12345</text>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<height>120</height>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkCList</class>
<name>font-name-list</name>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label7</name>
<label>label7</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkCList</class>
<name>font-style-list</name>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label8</name>
<label>label8</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow3</name>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkCList</class>
<name>font-size-list</name>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label9</name>
<label>label9</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>
......@@ -262,14 +262,6 @@
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button2</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button3</name>
......
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>font-sel.glade</name>
<program_name>font-sel.glade</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>False</use_widget_names>
<output_main_file>True</output_main_file>
<output_support_files>True</output_support_files>
<output_build_files>True</output_build_files>
<backup_source_files>True</backup_source_files>
<main_source_file>interface.c</main_source_file>
<main_header_file>interface.h</main_header_file>
<handler_source_file>callbacks.c</handler_source_file>
<handler_header_file>callbacks.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>font-sel.glade.h</translatable_strings_file>
</project>
<widget>
<class>GtkWindow</class>
<name>font-toplevel</name>
<visible>False</visible>
<title>window1</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkTable</class>
<name>toplevel-table</name>
<border_width>3</border_width>
<rows>4</rows>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>6</column_spacing>
<widget>
<class>GtkEntry</class>
<name>font-style-entry</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<editable>False</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
<widget>
<class>GtkEntry</class>
<name>font-size-entry</name>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<width>60</width>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
<widget>
<class>GtkLabel</class>
<name>label1</name>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<label>Font:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<name>label2</name>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>