-void FindTextureDialog::BuildDialog ()
-{
- GtkWidget *dlg, *vbox, *hbox, *table, *label;
- GtkWidget *button, *check, *entry, *arrow;
-
- dlg = m_pWidget;
- gtk_window_set_title (GTK_WINDOW (dlg), "Find / Replace Texture(s)");
- gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (g_pParentWnd->m_pWidget));
-
- hbox = gtk_hbox_new (FALSE, 5);
- gtk_widget_show (hbox);
- gtk_container_add (GTK_CONTAINER (dlg), hbox);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-
- vbox = gtk_vbox_new (FALSE, 5);
- gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
-
- table = gtk_table_new (2, 3, FALSE);
- gtk_widget_show (table);
- gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
- gtk_table_set_row_spacings (GTK_TABLE (table), 5);
- gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
- label = gtk_label_new ("Find:");
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-
- label = gtk_label_new ("Replace:");
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-
- entry = gtk_entry_new ();
- gtk_widget_show (entry);
- gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_signal_connect (GTK_OBJECT (entry), "focus_in_event",
- GTK_SIGNAL_FUNC (find_focus_in), NULL);
- AddDialogData (entry, &m_strFind, DLG_ENTRY_TEXT);
-
- button = gtk_button_new ();
- gtk_widget_show (button);
- gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (find_clicked), entry);
-
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
- gtk_widget_show (arrow);
- gtk_container_add (GTK_CONTAINER (button), arrow);
-
- entry = gtk_entry_new ();
- gtk_widget_show (entry);
- gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2,
- (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_signal_connect (GTK_OBJECT (entry), "focus_in_event",
- GTK_SIGNAL_FUNC (replace_focus_in), NULL);
- AddDialogData (entry, &m_strReplace, DLG_ENTRY_TEXT);
-
- button = gtk_button_new ();
- gtk_widget_show (button);
- gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (find_clicked), entry);
-
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
- gtk_widget_show (arrow);
- gtk_container_add (GTK_CONTAINER (button), arrow);
-
- check = gtk_check_button_new_with_label ("Use selected brushes only");
- gtk_widget_show (check);
- gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0);
- AddDialogData (check, &m_bSelectedOnly, DLG_CHECK_BOOL);
-
- check = gtk_check_button_new_with_label ("Replace everywhere (selected/active), don't test against Find");
- gtk_widget_show (check);
- gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0);
- AddDialogData (check, &m_bForce, DLG_CHECK_BOOL);
-
- check = gtk_check_button_new_with_label ("Live updates from Texture/Camera windows");
- gtk_widget_show (check);
- gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0);
- AddDialogData (check, &m_bLive, DLG_CHECK_BOOL);
-
- vbox = gtk_vbox_new (FALSE, 5);
- gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
-
- button = gtk_button_new_with_label( "Find" );
- gtk_widget_show( button );
- gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked",
- GTK_SIGNAL_FUNC( OnFind ), NULL );
- gtk_widget_set_usize( button, 60, -2 );
-
- button = gtk_button_new_with_label ("OK");
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (OnOK), NULL);
- gtk_widget_set_usize (button, 60, -2);
-
- button = gtk_button_new_with_label ("Apply");
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (OnApply), NULL);
- gtk_widget_set_usize (button, 60, -2);
-
- button = gtk_button_new_with_label ("Close");
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (OnClose), NULL);
- gtk_widget_set_usize (button, 60, -2);
-
- gtk_widget_show (dlg);