GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox3b;
  GtkWidget *toolbar1;
  GtkIconSize tmp_toolbar_icon_size;
  GtkWidget *toolbuttonOpen;
  GtkWidget *toolbuttonSave;
  GtkWidget *tmp_image;
  GtkWidget *toolbuttonScript;
  GtkWidget *toolbuttonDVD;
  GtkWidget *toolbuttonHalfD1;
  GtkWidget *toolbuttonSVCD;
  GtkWidget *toolbuttonVCD;
  GtkWidget *hbox11;
  GtkWidget *frame1;
  GtkWidget *alignment1;
  GtkWidget *vbox2;
  GtkWidget *notebook1;
  GtkWidget *scrolledwindow1;
  GtkWidget *treeview1;
  GtkWidget *hbox5;
  GtkWidget *image1;
  GtkWidget *label11;
  GtkWidget *scrolledwindow2;
  GtkWidget *treeview2;
  GtkWidget *hbox6;
  GtkWidget *image2;
  GtkWidget *label17;
  GtkWidget *scrolledwindow3;
  GtkWidget *treeview3;
  GtkWidget *hbox7;
  GtkWidget *image3;
  GtkWidget *label18;
  GtkWidget *scrolledwindow4;
  GtkWidget *treeview4;
  GtkWidget *hbox8;
  GtkWidget *image4;
  GtkWidget *label19;
  GtkWidget *scrolledwindow5;
  GtkWidget *treeview5;
  GtkWidget *hbox9;
  GtkWidget *image5;
  GtkWidget *label20;
  GtkWidget *scrolledwindow6;
  GtkWidget *treeview6;
  GtkWidget *hbox10;
  GtkWidget *image6;
  GtkWidget *label21;
  GtkWidget *scrolledwindow7;
  GtkWidget *treeview7;
  GtkWidget *hbox4;
  GtkWidget *image7;
  GtkWidget *label22;
  GtkWidget *treeview8;
  GtkWidget *label28;
  GtkWidget *hbox13;
  GtkWidget *buttonAdd;
  GtkWidget *image11;
  GtkWidget *label23;
  GtkWidget *frame2;
  GtkWidget *alignment2;
  GtkWidget *hbox1;
  GtkWidget *vbox3;
  GtkWidget *scrolledwindow9;
  GtkWidget *treeview0;
  GtkWidget *hbox14;
  GtkWidget *buttonRemove;
  GtkWidget *image15;
  GtkWidget *buttonDown;
  GtkWidget *image14;
  GtkWidget *buttonUp;
  GtkWidget *image13;
  GtkWidget *buttonPartial;
  GtkWidget *buttonProperties;
  GtkWidget *alignment4;
  GtkWidget *hbox16;
  GtkWidget *label25;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *buttonPreview;
  GtkWidget *alignment5;
  GtkWidget *hbox17;
  GtkWidget *image17;
  GtkWidget *label26;
  GtkWidget *buttonClose;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  dialog1 = gtk_dialog_new ();
  gtk_container_set_border_width (GTK_CONTAINER (dialog1), 6);
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Video Filter Manager"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);
  gtk_dialog_set_has_separator (GTK_DIALOG (dialog1), FALSE);

  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
  gtk_box_set_spacing (GTK_BOX(dialog_vbox1), 12);
  gtk_widget_show (dialog_vbox1);

  vbox3b = gtk_vbox_new (FALSE, 12);
  gtk_widget_show (vbox3b);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox3b, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox3b), 6);

  toolbar1 = gtk_toolbar_new ();
  gtk_widget_show (toolbar1);
  gtk_box_pack_start (GTK_BOX (vbox3b), toolbar1, FALSE, FALSE, 0);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));

  toolbuttonOpen = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-open");
  gtk_widget_show (toolbuttonOpen);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonOpen);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonOpen), tooltips, QT_TR_NOOP("Open filter list [Ctrl-O]"), NULL);
  gtk_widget_add_accelerator (toolbuttonOpen, "clicked", accel_group,
                              GDK_O, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonOpen), TRUE);

  toolbuttonSave = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-save");
  gtk_widget_show (toolbuttonSave);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonSave);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonSave), tooltips, QT_TR_NOOP("Save filter list [Ctrl-S]"), NULL);
  gtk_widget_add_accelerator (toolbuttonSave, "clicked", accel_group,
                              GDK_S, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonSave), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-save-as", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonScript = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("Save Script"));
  gtk_widget_show (toolbuttonScript);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonScript);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonScript), tooltips, QT_TR_NOOP("Save as script [Ctrl-J]"), NULL);
  gtk_widget_add_accelerator (toolbuttonScript, "clicked", accel_group,
                              GDK_J, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonScript), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonDVD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("DVD Res"));
  gtk_widget_show (toolbuttonDVD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonDVD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonDVD), tooltips, QT_TR_NOOP("DVD resolution [Ctrl-1]"), NULL);
  gtk_widget_add_accelerator (toolbuttonDVD, "clicked", accel_group,
                              GDK_1, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonDVD), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonHalfD1 = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("Half D1 Res"));
  gtk_widget_show (toolbuttonHalfD1);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonHalfD1);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonHalfD1), tooltips, QT_TR_NOOP("Half D1 resolution [Ctrl-2]"), NULL);
  gtk_widget_add_accelerator (toolbuttonHalfD1, "clicked", accel_group,
                              GDK_2, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonHalfD1), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonSVCD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("SVCD Res"));
  gtk_widget_show (toolbuttonSVCD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonSVCD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonSVCD), tooltips, QT_TR_NOOP("SVCD resolution [Ctrl-3]"), NULL);
  gtk_widget_add_accelerator (toolbuttonSVCD, "clicked", accel_group,
                              GDK_3, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonSVCD), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonVCD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("VCD Res"));
  gtk_widget_show (toolbuttonVCD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonVCD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonVCD), tooltips, QT_TR_NOOP("VCD resolution [Ctrl-4]"), NULL);
  gtk_widget_add_accelerator (toolbuttonVCD, "clicked", accel_group,
                              GDK_4, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonVCD), TRUE);

  hbox11 = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (hbox11);
  gtk_box_pack_start (GTK_BOX (vbox3b), hbox11, TRUE, TRUE, 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (hbox11), frame1, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (frame1), alignment1);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 6, 0, 18, 0);

  vbox2 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (alignment1), vbox2);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (vbox2), notebook1, TRUE, TRUE, 0);
  gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook1), FALSE);
  gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook1), GTK_POS_LEFT);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow1);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  treeview1 = gtk_tree_view_new ();
  gtk_widget_show (treeview1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview1);
  gtk_widget_set_size_request (treeview1, 288, 336);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview1), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview1), FALSE);

  hbox5 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox5);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), hbox5);

  image1 = create_pixmap (dialog1, "1.png");
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox5), image1, FALSE, FALSE, 0);

  label11 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Transform"));
  gtk_widget_show (label11);
  gtk_box_pack_start (GTK_BOX (hbox5), label11, FALSE, FALSE, 4);
  gtk_label_set_use_markup (GTK_LABEL (label11), TRUE);

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview2 = gtk_tree_view_new ();
  gtk_widget_show (treeview2);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), treeview2);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview2), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview2), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview2), FALSE);

  hbox6 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox6);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), hbox6);

  image2 = create_pixmap (dialog1, "2.png");
  gtk_widget_show (image2);
  gtk_box_pack_start (GTK_BOX (hbox6), image2, FALSE, FALSE, 0);

  label17 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Interlacing"));
  gtk_widget_show (label17);
  gtk_box_pack_start (GTK_BOX (hbox6), label17, FALSE, FALSE, 4);

  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow3);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow3);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview3 = gtk_tree_view_new ();
  gtk_widget_show (treeview3);
  gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview3);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview3), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview3), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview3), FALSE);

  hbox7 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox7);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), hbox7);

  image3 = create_pixmap (dialog1, "4.png");
  gtk_widget_show (image3);
  gtk_box_pack_start (GTK_BOX (hbox7), image3, FALSE, FALSE, 0);

  label18 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Colors"));
  gtk_widget_show (label18);
  gtk_box_pack_start (GTK_BOX (hbox7), label18, FALSE, FALSE, 4);

  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow4);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow4);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview4 = gtk_tree_view_new ();
  gtk_widget_show (treeview4);
  gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview4);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview4), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview4), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview4), FALSE);

  hbox8 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox8);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), hbox8);

  image4 = create_pixmap (dialog1, "5.png");
  gtk_widget_show (image4);
  gtk_box_pack_start (GTK_BOX (hbox8), image4, FALSE, FALSE, 0);

  label19 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Noise"));
  gtk_widget_show (label19);
  gtk_box_pack_start (GTK_BOX (hbox8), label19, FALSE, FALSE, 4);

  scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow5);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow5);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview5 = gtk_tree_view_new ();
  gtk_widget_show (treeview5);
  gtk_container_add (GTK_CONTAINER (scrolledwindow5), treeview5);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview5), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview5), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview5), FALSE);

  hbox9 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox9);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 4), hbox9);

  image5 = create_pixmap (dialog1, "3.png");
  gtk_widget_show (image5);
  gtk_box_pack_start (GTK_BOX (hbox9), image5, FALSE, FALSE, 0);

  label20 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Sharpness"));
  gtk_widget_show (label20);
  gtk_box_pack_start (GTK_BOX (hbox9), label20, FALSE, FALSE, 4);

  scrolledwindow6 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow6);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow6);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview6 = gtk_tree_view_new ();
  gtk_widget_show (treeview6);
  gtk_container_add (GTK_CONTAINER (scrolledwindow6), treeview6);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview6), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview6), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview6), FALSE);

  hbox10 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox10);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 5), hbox10);

  image6 = create_pixmap (dialog1, "7.png");
  gtk_widget_show (image6);
  gtk_box_pack_start (GTK_BOX (hbox10), image6, FALSE, FALSE, 0);

  label21 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Subtitles"));
  gtk_widget_show (label21);
  gtk_box_pack_start (GTK_BOX (hbox10), label21, FALSE, FALSE, 4);

  scrolledwindow7 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow7);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow7);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview7 = gtk_tree_view_new ();
  gtk_widget_show (treeview7);
  gtk_container_add (GTK_CONTAINER (scrolledwindow7), treeview7);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview7), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview7), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview7), FALSE);

  hbox4 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 6), hbox4);

  image7 = create_pixmap (dialog1, "6.png");
  gtk_widget_show (image7);
  gtk_box_pack_start (GTK_BOX (hbox4), image7, FALSE, FALSE, 0);

  label22 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Misc"));
  gtk_widget_show (label22);
  gtk_box_pack_start (GTK_BOX (hbox4), label22, FALSE, FALSE, 4);

  treeview8 = gtk_tree_view_new ();
  gtk_widget_show (treeview8);
  gtk_container_add (GTK_CONTAINER (notebook1), treeview8);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview8), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview8), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview8), FALSE);

  label28 = gtk_label_new (QT_TR_NOOP("External"));
  gtk_widget_show (label28);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 7), label28);

  hbox13 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox13);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox13, FALSE, FALSE, 0);

  buttonAdd = gtk_button_new ();
  gtk_widget_show (buttonAdd);
  gtk_box_pack_end (GTK_BOX (hbox13), buttonAdd, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonAdd, QT_TR_NOOP("Add selected filter to the Active Filters list"), NULL);

  image11 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image11);
  gtk_container_add (GTK_CONTAINER (buttonAdd), image11);

  label23 = gtk_label_new (QT_TR_NOOP("<b>Available Filters</b>"));
  gtk_widget_show (label23);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label23);
  gtk_label_set_use_markup (GTK_LABEL (label23), TRUE);
  gtk_misc_set_alignment (GTK_MISC (label23), 1, 1);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (hbox11), frame2, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);

  alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (frame2), alignment2);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 6, 0, 18, 0);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_container_add (GTK_CONTAINER (alignment2), hbox1);

  vbox3 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox3);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox3, TRUE, TRUE, 0);

  scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow9);
  gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_OUT);

  treeview0 = gtk_tree_view_new ();
  gtk_widget_show (treeview0);
  gtk_container_add (GTK_CONTAINER (scrolledwindow9), treeview0);
  gtk_widget_set_size_request (treeview0, 288, 336);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview0), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview0), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview0), FALSE);

  hbox14 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox14);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox14, FALSE, FALSE, 0);

  buttonRemove = gtk_button_new ();
  gtk_widget_show (buttonRemove);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonRemove, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonRemove, QT_TR_NOOP("Remove filter"), NULL);

  image15 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image15);
  gtk_container_add (GTK_CONTAINER (buttonRemove), image15);

  buttonDown = gtk_button_new ();
  gtk_widget_show (buttonDown);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonDown, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonDown, QT_TR_NOOP("Move filter down"), NULL);

  image14 = gtk_image_new_from_icon_name ("gtk-go-down", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image14);
  gtk_container_add (GTK_CONTAINER (buttonDown), image14);

  buttonUp = gtk_button_new ();
  gtk_widget_show (buttonUp);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonUp, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonUp, QT_TR_NOOP("Move filter up"), NULL);

  image13 = gtk_image_new_from_icon_name ("gtk-go-up", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image13);
  gtk_container_add (GTK_CONTAINER (buttonUp), image13);

  buttonPartial = gtk_button_new_with_mnemonic (QT_TR_NOOP("P_artial"));
  gtk_widget_show (buttonPartial);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonPartial, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonPartial, QT_TR_NOOP("Apply the current filter only to a part of the file"), NULL);

  buttonProperties = gtk_button_new ();
  gtk_widget_show (buttonProperties);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonProperties, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonProperties, QT_TR_NOOP("Configure filter"), NULL);

  alignment4 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment4);
  gtk_container_add (GTK_CONTAINER (buttonProperties), alignment4);

  hbox16 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox16);
  gtk_container_add (GTK_CONTAINER (alignment4), hbox16);

  label25 = gtk_label_new_with_mnemonic (QT_TR_NOOP("C_onfigure"));
  gtk_widget_show (label25);
  gtk_box_pack_start (GTK_BOX (hbox16), label25, FALSE, FALSE, 0);

  label2 = gtk_label_new (QT_TR_NOOP("<b >Active Filters</b>"));
  gtk_widget_show (label2);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
  gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
  gtk_misc_set_alignment (GTK_MISC (label2), 1, 1);

  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  buttonPreview = gtk_button_new ();
  gtk_widget_show (buttonPreview);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), buttonPreview, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (buttonPreview, GTK_CAN_DEFAULT);

  alignment5 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment5);
  gtk_container_add (GTK_CONTAINER (buttonPreview), alignment5);

  hbox17 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox17);
  gtk_container_add (GTK_CONTAINER (alignment5), hbox17);

  image17 = create_pixmap (dialog1, "preview-button.png");
  gtk_widget_show (image17);
  gtk_box_pack_start (GTK_BOX (hbox17), image17, FALSE, FALSE, 0);

  label26 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Preview"));
  gtk_widget_show (label26);
  gtk_box_pack_start (GTK_BOX (hbox17), label26, FALSE, FALSE, 0);

  buttonClose = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (buttonClose);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), buttonClose, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (buttonClose, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox3b, "vbox3b");
  GLADE_HOOKUP_OBJECT (dialog1, toolbar1, "toolbar1");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonOpen, "toolbuttonOpen");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonSave, "toolbuttonSave");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonScript, "toolbuttonScript");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonDVD, "toolbuttonDVD");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonHalfD1, "toolbuttonHalfD1");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonSVCD, "toolbuttonSVCD");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonVCD, "toolbuttonVCD");
  GLADE_HOOKUP_OBJECT (dialog1, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (dialog1, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (dialog1, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog1, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (dialog1, treeview1, "treeview1");
  GLADE_HOOKUP_OBJECT (dialog1, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (dialog1, image1, "image1");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (dialog1, treeview2, "treeview2");
  GLADE_HOOKUP_OBJECT (dialog1, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (dialog1, image2, "image2");
  GLADE_HOOKUP_OBJECT (dialog1, label17, "label17");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow3, "scrolledwindow3");
  GLADE_HOOKUP_OBJECT (dialog1, treeview3, "treeview3");
  GLADE_HOOKUP_OBJECT (dialog1, hbox7, "hbox7");
  GLADE_HOOKUP_OBJECT (dialog1, image3, "image3");
  GLADE_HOOKUP_OBJECT (dialog1, label18, "label18");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow4, "scrolledwindow4");
  GLADE_HOOKUP_OBJECT (dialog1, treeview4, "treeview4");
  GLADE_HOOKUP_OBJECT (dialog1, hbox8, "hbox8");
  GLADE_HOOKUP_OBJECT (dialog1, image4, "image4");
  GLADE_HOOKUP_OBJECT (dialog1, label19, "label19");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow5, "scrolledwindow5");
  GLADE_HOOKUP_OBJECT (dialog1, treeview5, "treeview5");
  GLADE_HOOKUP_OBJECT (dialog1, hbox9, "hbox9");
  GLADE_HOOKUP_OBJECT (dialog1, image5, "image5");
  GLADE_HOOKUP_OBJECT (dialog1, label20, "label20");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow6, "scrolledwindow6");
  GLADE_HOOKUP_OBJECT (dialog1, treeview6, "treeview6");
  GLADE_HOOKUP_OBJECT (dialog1, hbox10, "hbox10");
  GLADE_HOOKUP_OBJECT (dialog1, image6, "image6");
  GLADE_HOOKUP_OBJECT (dialog1, label21, "label21");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow7, "scrolledwindow7");
  GLADE_HOOKUP_OBJECT (dialog1, treeview7, "treeview7");
  GLADE_HOOKUP_OBJECT (dialog1, hbox4, "hbox4");
  GLADE_HOOKUP_OBJECT (dialog1, image7, "image7");
  GLADE_HOOKUP_OBJECT (dialog1, label22, "label22");
  GLADE_HOOKUP_OBJECT (dialog1, treeview8, "treeview8");
  GLADE_HOOKUP_OBJECT (dialog1, label28, "label28");
  GLADE_HOOKUP_OBJECT (dialog1, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (dialog1, buttonAdd, "buttonAdd");
  GLADE_HOOKUP_OBJECT (dialog1, image11, "image11");
  GLADE_HOOKUP_OBJECT (dialog1, label23, "label23");
  GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (dialog1, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow9, "scrolledwindow9");
  GLADE_HOOKUP_OBJECT (dialog1, treeview0, "treeview0");
  GLADE_HOOKUP_OBJECT (dialog1, hbox14, "hbox14");
  GLADE_HOOKUP_OBJECT (dialog1, buttonRemove, "buttonRemove");
  GLADE_HOOKUP_OBJECT (dialog1, image15, "image15");
  GLADE_HOOKUP_OBJECT (dialog1, buttonDown, "buttonDown");
  GLADE_HOOKUP_OBJECT (dialog1, image14, "image14");
  GLADE_HOOKUP_OBJECT (dialog1, buttonUp, "buttonUp");
  GLADE_HOOKUP_OBJECT (dialog1, image13, "image13");
  GLADE_HOOKUP_OBJECT (dialog1, buttonPartial, "buttonPartial");
  GLADE_HOOKUP_OBJECT (dialog1, buttonProperties, "buttonProperties");
  GLADE_HOOKUP_OBJECT (dialog1, alignment4, "alignment4");
  GLADE_HOOKUP_OBJECT (dialog1, hbox16, "hbox16");
  GLADE_HOOKUP_OBJECT (dialog1, label25, "label25");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, buttonPreview, "buttonPreview");
  GLADE_HOOKUP_OBJECT (dialog1, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (dialog1, hbox17, "hbox17");
  GLADE_HOOKUP_OBJECT (dialog1, image17, "image17");
  GLADE_HOOKUP_OBJECT (dialog1, label26, "label26");
  GLADE_HOOKUP_OBJECT (dialog1, buttonClose, "buttonClose");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, tooltips, "tooltips");

  gtk_window_add_accel_group (GTK_WINDOW (dialog1), accel_group);

  return dialog1;
}
Beispiel #2
0
int arz_m(class arz_rek *rek,GtkWidget *wpredok)
{

class arz_m_data data;
char strsql[512];
iceb_u_str kikz;
data.rk=rek;
 
data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

GtkWidget *label=NULL;

sprintf(strsql,"%s %s",name_system,gettext("Автоматическая разноска зарплаты"));
label=gtk_label_new(gettext("Автоматическая разноска зарплаты"));

gtk_window_set_title(GTK_WINDOW(data.window),strsql);
gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(arz_m_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
 hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0; i < KOLENTER; i++)
 gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);

GtkWidget *separator1=gtk_hseparator_new();
GtkWidget *separator3=gtk_hseparator_new();
gtk_container_add (GTK_CONTAINER (vbox), separator1);
//Вставляем радиокнопки
GSList *group;

data.radiobutton2[0]=gtk_radio_button_new_with_label(NULL,gettext("С учётом сальдо"));
gtk_box_pack_start (GTK_BOX (vbox),data.radiobutton2[0], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.radiobutton2[0]), "clicked",GTK_SIGNAL_FUNC(arz_radio2_0),&data);

group=gtk_radio_button_group(GTK_RADIO_BUTTON(data.radiobutton2[0]));

data.radiobutton2[1]=gtk_radio_button_new_with_label(group,gettext("Без учёта сальдо"));
gtk_signal_connect(GTK_OBJECT(data.radiobutton2[1]), "clicked",GTK_SIGNAL_FUNC(arz_radio2_1),&data);
gtk_box_pack_start (GTK_BOX (vbox),data.radiobutton2[1], TRUE, TRUE, 0);

gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data.radiobutton2[data.rk->metka_saldo]),TRUE); //Устанавливем активной кнопку

gtk_container_add (GTK_CONTAINER (vbox), separator3);


gtk_container_add (GTK_CONTAINER (vbox), hboxknop);

GtkTooltips *tooltips_enter[KOLENTER];


sprintf(strsql,"%s %s",gettext("Дата"),gettext("(м.г)"));
data.knopka_enter[E_DATA]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DATA]), data.knopka_enter[E_DATA], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_DATA]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_DATA]),(gpointer)E_DATA);
tooltips_enter[E_DATA]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_DATA],data.knopka_enter[E_DATA],gettext("Выбор даты"),NULL);

data.entry[E_DATA] = gtk_entry_new_with_max_length (7);
gtk_box_pack_start (GTK_BOX (hbox[E_DATA]), data.entry[E_DATA], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DATA]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DATA]),data.rk->data.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DATA]),(gpointer)E_DATA);


sprintf(strsql,"%s (,,)",gettext("Табельный номер"));
data.knopka_enter[E_TABNOM]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.knopka_enter[E_TABNOM], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_TABNOM]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_TABNOM]),(gpointer)E_TABNOM);
tooltips_enter[E_TABNOM]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_TABNOM],data.knopka_enter[E_TABNOM],gettext("Выбор табельного номера"),NULL);

data.entry[E_TABNOM] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.entry[E_TABNOM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_TABNOM]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_TABNOM]),data.rk->tabnom.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_TABNOM]),(gpointer)E_TABNOM);


sprintf(strsql,"%s (%s)",gettext("Дата выплаты зарплаты"),gettext("д.м.г"));
data.knopka_enter[E_DATA_PER]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DATA_PER]), data.knopka_enter[E_DATA_PER], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_DATA_PER]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_DATA_PER]),(gpointer)E_DATA_PER);
tooltips_enter[E_DATA_PER]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_DATA_PER],data.knopka_enter[E_DATA_PER],gettext("Выбор даты"),NULL);

data.entry[E_DATA_PER] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_DATA_PER]), data.entry[E_DATA_PER], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DATA_PER]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DATA_PER]),data.rk->data_per.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DATA_PER]),(gpointer)E_DATA_PER);


sprintf(strsql,"%s (,,)",gettext("Код начисления"));
data.knopka_enter[E_KOD_NAH]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_NAH]), data.knopka_enter[E_KOD_NAH], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KOD_NAH]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KOD_NAH]),(gpointer)E_KOD_NAH);
tooltips_enter[E_KOD_NAH]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KOD_NAH],data.knopka_enter[E_KOD_NAH],gettext("Выбор кода начисления"),NULL);

data.entry[E_KOD_NAH] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_NAH]), data.entry[E_KOD_NAH], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD_NAH]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD_NAH]),data.rk->kod_nah.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD_NAH]),(gpointer)E_KOD_NAH);


sprintf(strsql,"%s (,,)",gettext("Код подразделения"));
data.knopka_enter[E_PODR]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_PODR]), data.knopka_enter[E_PODR], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_PODR]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_PODR]),(gpointer)E_PODR);
tooltips_enter[E_PODR]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_PODR],data.knopka_enter[E_PODR],gettext("Выбор подразделения"),NULL);

data.entry[E_PODR] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_PODR]), data.entry[E_PODR], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_PODR]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_PODR]),data.rk->podr.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_PODR]),(gpointer)E_PODR);


sprintf(strsql,"%s (,,)",gettext("Код группы подразделения"));
data.knopka_enter[E_KOD_GRUP_POD]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_GRUP_POD]), data.knopka_enter[E_KOD_GRUP_POD], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KOD_GRUP_POD]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KOD_GRUP_POD]),(gpointer)E_KOD_GRUP_POD);
tooltips_enter[E_KOD_GRUP_POD]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KOD_GRUP_POD],data.knopka_enter[E_KOD_GRUP_POD],gettext("Выбор группы"),NULL);

data.entry[E_KOD_GRUP_POD] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_GRUP_POD]), data.entry[E_KOD_GRUP_POD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD_GRUP_POD]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD_GRUP_POD]),data.rk->kod_grup_pod.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD_GRUP_POD]),(gpointer)E_KOD_GRUP_POD);


sprintf(strsql,"%s (,,)",gettext("Код категории"));
data.knopka_enter[E_KOD_KAT]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_KAT]), data.knopka_enter[E_KOD_KAT], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KOD_KAT]),"clicked",GTK_SIGNAL_FUNC(arz_m_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KOD_KAT]),(gpointer)E_KOD_KAT);
tooltips_enter[E_KOD_KAT]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KOD_KAT],data.knopka_enter[E_KOD_KAT],gettext("Выбор категории"),NULL);

data.entry[E_KOD_KAT] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KOD_KAT]), data.entry[E_KOD_KAT], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD_KAT]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD_KAT]),data.rk->kod_kat.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD_KAT]),(gpointer)E_KOD_KAT);


label=gtk_label_new(gettext("Процент выплаты"));
gtk_box_pack_start (GTK_BOX (hbox[E_PROC_VIP]), label, FALSE, FALSE, 0);

data.entry[E_PROC_VIP] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_PROC_VIP]), data.entry[E_PROC_VIP], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_PROC_VIP]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_PROC_VIP]),data.rk->proc_vip.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_PROC_VIP]),(gpointer)E_PROC_VIP);

label=gtk_label_new(gettext("Максимальная сумма выплати"));
gtk_box_pack_start (GTK_BOX (hbox[E_MAX_SUM]), label, FALSE, FALSE, 0);

data.entry[E_MAX_SUM] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_MAX_SUM]), data.entry[E_MAX_SUM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_MAX_SUM]), "activate",GTK_SIGNAL_FUNC(arz_m_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_MAX_SUM]),data.rk->max_sum.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_MAX_SUM]),(gpointer)E_MAX_SUM);

GtkTooltips *tooltips[KOL_FK];

sprintf(strsql,"F2 %s",gettext("Расчёт"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Начать расчёт"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(arz_m_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F4 %s",gettext("Очистить"));
data.knopka[FK4]=gtk_button_new_with_label(strsql);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Очистить меню от введеноой информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]),"clicked",GTK_SIGNAL_FUNC(arz_m_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK4], TRUE, TRUE, 0);


sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(arz_m_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);

gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.voz);
}
Beispiel #3
0
static VALUE
rg_initialize(VALUE self)
{
    RBGTK_INITIALIZE(self, gtk_tooltips_new());
    return Qnil;
}
Beispiel #4
0
Widget BolfView(){

	GtkTooltips *Tooltips;
	Tooltips=gtk_tooltips_new();

	Widget Window, InputText, SearchButton, SelectType, Table, SelectText, Slider, News;
	Widget NijiaM, KamerM, HipHop, AfricaM;
	Widget MusicLabel, GameLabel, FunLabel, MovieLabel, SportLabel;

	GtkWidget *pageLayoutExpander, *scrolledWindow;
	pageLayoutExpander = gtk_expander_new_with_mnemonic("Page");

	MusicLabel= gtk_label_new("Music");
	GameLabel= gtk_label_new("Games");
	FunLabel= gtk_label_new("Funny");
	MovieLabel= gtk_label_new("Movies");
	SportLabel= gtk_label_new("Sports");


	//	Warning = gtk_label_new("Click On Me  \n If You wanna Quit \n Or Cancel if you dont");
	//declaring the url entry;
	UrlText=gtk_entry_new();
	gtk_entry_set_visibility(GTK_ENTRY(UrlText),TRUE);
	gtk_widget_set_size_request(UrlText,600,25);
	gtk_entry_set_text (GTK_ENTRY(UrlText),"http://DONOT WRITE HERE!!!!!!");
	gtk_tooltips_set_tip(Tooltips,UrlText,"This is to displace th current URL",NULL);

	
	//declaring the search text
	InputText=gtk_entry_new();
	gtk_entry_set_visibility(GTK_ENTRY(InputText),TRUE);
	gtk_widget_set_size_request(InputText,20,40);
	gtk_tooltips_set_tip(Tooltips,InputText,"Enter Your Search Here!!!!",NULL);
	
	/* create Webview */
	
	web[count] = webkit_web_view_new();


	//declaring the search button;
	SearchButton=gtk_button_new();
	SearchButton=ImageButton("pictures/search.jpeg");
	gtk_widget_set_size_request(SearchButton,130,80);
	gtk_tooltips_set_tip(Tooltips,SearchButton,"Search Button",NULL);
	g_signal_connect(SearchButton, "clicked",  G_CALLBACK(InputConnect), InputText);
	

	//creating a slider	
	Slider=MyEvent("pictures/ani1.gif");
	//gtk_widget_set_size_request(Slider,1000,3000);
	gtk_tooltips_set_tip(Tooltips,Slider,"News",NULL);
	g_signal_connect_swapped(Slider, "button_press_event", G_CALLBACK(Newso),NULL);

	//creating news
	News=MyEvent("pictures/ani2.gif");
	//gtk_widget_set_size_request(News,400,150);
	gtk_tooltips_set_tip(Tooltips,News,"News",NULL);
	g_signal_connect_swapped(News, "button_press_event", G_CALLBACK(Newso),NULL);

	//Music	
	NijiaM=MyEvent("pictures/concour.jpeg");
	gtk_widget_set_size_request(NijiaM,175,80);
	gtk_tooltips_set_tip(Tooltips,NijiaM,"Nijia Music",NULL);
	g_signal_connect_swapped(NijiaM, "button_press_event", G_CALLBACK(NijiaMusic),NULL);
	
	HipHop=MyEvent("pictures/hiphop.jpeg");
	gtk_widget_set_size_request(HipHop,175,80);
	gtk_tooltips_set_tip(Tooltips,HipHop,"Hip, HOp, R&B",NULL);
	g_signal_connect_swapped(HipHop, "button_press_event", G_CALLBACK(HipHopMusic),NULL);

	KamerM=MyEvent("pictures/camerhits.jpeg");
	gtk_widget_set_size_request(KamerM,175,80);
	gtk_tooltips_set_tip(Tooltips,KamerM,"Kamer Hits",NULL);
	g_signal_connect_swapped(KamerM, "button_press_event", G_CALLBACK(KamerHits),NULL);

	AfricaM=MyEvent("pictures/cam.jpeg");
	gtk_widget_set_size_request(AfricaM,175,80);
	gtk_tooltips_set_tip(Tooltips,AfricaM,"Africa Music",NULL);
	g_signal_connect_swapped(AfricaM,"button_press_event",G_CALLBACK(AfricaMusic),NULL);

	//Movies	
	Widget Nolly, Holly,Bolly, Horos;

	Nolly=MyEvent("pictures/nollywood.jpeg");
	gtk_widget_set_size_request(Nolly,175,80);
	gtk_tooltips_set_tip(Tooltips,Nolly,"NollyWood(Nigeria Film Industry)",NULL);
	g_signal_connect_swapped(Nolly, "button_press_event", G_CALLBACK(Nollywood),NULL);
	
	Holly=MyEvent("pictures/hollywood.jpeg");
	gtk_widget_set_size_request(Holly,175,80);
	gtk_tooltips_set_tip(Tooltips,Holly,"Hollywood(America Film Industry)",NULL);
	g_signal_connect_swapped(Holly, "button_press_event", G_CALLBACK(Hollywood),NULL);

	Bolly=MyEvent("pictures/bollywood.jpeg");
	gtk_widget_set_size_request(Bolly,175,80);
	gtk_tooltips_set_tip(Tooltips,Bolly,"Bollywood(The Indians)",NULL);
	g_signal_connect_swapped(Bolly, "button_press_event", G_CALLBACK(Bollywood),NULL);

	Horos=MyEvent("pictures/horos.jpeg");
	gtk_widget_set_size_request(Horos,175,80);
	gtk_tooltips_set_tip(Tooltips,Horos,"Horos Movies",NULL);
	g_signal_connect_swapped(Horos,"button_press_event",G_CALLBACK(Horosmov),NULL);

	//funny movies

	Widget African,American,Europe,Kids;
	African=MyEvent("pictures/basket.jpeg");
	gtk_widget_set_size_request(African,175,80);
	gtk_tooltips_set_tip(Tooltips,African,"Africa Fun",NULL);
	g_signal_connect_swapped(African, "button_press_event", G_CALLBACK(AfricaFun),NULL);
	
	American=MyEvent("pictures/amerifun.jpeg");
	gtk_widget_set_size_request(American,175,80);
	gtk_tooltips_set_tip(Tooltips,American,"American Fun",NULL);
	g_signal_connect_swapped(American, "button_press_event", G_CALLBACK(AmericaFun),NULL);

	Europe=MyEvent("pictures/africanfunny.jpeg");
	gtk_widget_set_size_request(Europe,175,80);
	gtk_tooltips_set_tip(Tooltips,Europe,"General Fun",NULL);
	g_signal_connect_swapped(Europe, "button_press_event", G_CALLBACK(NijiaBoys),NULL);

	Kids=MyEvent("pictures/kids.jpeg");
	gtk_widget_set_size_request(Kids,175,80);
	gtk_tooltips_set_tip(Tooltips,Kids,"Kid Movies And Funs",NULL);
	g_signal_connect_swapped(Kids,"button_press_event",G_CALLBACK(KidsMovies),NULL);

	//Games
	Widget Race,War,HerosGame,KidGame;
	Race=MyEvent("pictures/race.jpeg");
	gtk_widget_set_size_request(Race,175,80);
	gtk_tooltips_set_tip(Tooltips,Race,"Racee Games",NULL);
	g_signal_connect_swapped(Race, "button_press_event", G_CALLBACK(RaceGame),NULL);
	
	War=MyEvent("pictures/war.jpeg");
	gtk_widget_set_size_request(War,175,80);
	gtk_tooltips_set_tip(Tooltips,War,"War Games",NULL);
	g_signal_connect_swapped(War, "button_press_event", G_CALLBACK(WarGame),NULL);

	HerosGame=MyEvent("pictures/horos2.jpeg");
	gtk_widget_set_size_request(HerosGame,175,80);
	gtk_tooltips_set_tip(Tooltips,HerosGame,"Horo Games",NULL);
	g_signal_connect_swapped(HerosGame, "button_press_event", G_CALLBACK(HeroGame),NULL);

	KidGame=MyEvent("pictures/kidgame.jpeg");
	gtk_widget_set_size_request(KidGame,175,80);
	gtk_tooltips_set_tip(Tooltips,KidGame,"Games For Children",NULL);
	g_signal_connect_swapped(KidGame,"button_press_event",G_CALLBACK(KidGames),NULL);

	//sports
	Widget Foot,Basket,Resl,Others;
	Foot=MyEvent("pictures/fifa.png");
	gtk_widget_set_size_request(Foot,175,80);
	gtk_tooltips_set_tip(Tooltips,Foot,"Football",NULL);
	g_signal_connect(Foot, "button_press_event", G_CALLBACK(Football),UrlText);
	
	Basket=MyEvent("pictures/basketball.jpeg");
	gtk_widget_set_size_request(Basket,175,80);
	gtk_tooltips_set_tip(Tooltips,Basket,"Basketball",NULL);
	g_signal_connect(Basket, "button_press_event", G_CALLBACK(Basketball),UrlText);

	Resl=MyEvent("pictures/resling.jpeg");
	gtk_widget_set_size_request(Resl,175,80);
	gtk_tooltips_set_tip(Tooltips,Resl,"Resling",NULL);
	g_signal_connect(Resl, "button_press_event", G_CALLBACK(Resling),UrlText);
	

	Others=MyEvent("pictures/games.jpeg");
	gtk_widget_set_size_request(Others,175,80);
	gtk_tooltips_set_tip(Tooltips,Others,"Rugby,Handball, MotoGP, Athletic and Other sports",NULL);
	g_signal_connect(Others,"button_press_event",G_CALLBACK(OtherSports),UrlText);


	//define the select type of entertianment;
	SelectType=gtk_combo_new();
	gtk_entry_set_text(GTK_ENTRY((GTK_COMBO(SelectType))-> entry),"Mp3 Music");
	GList *list=NULL;
	list=g_list_append(list," Music Vidios");
	list=g_list_append(list,"Movies");
	list=g_list_append(list,"Games");
	list=g_list_append(list,"Funny Vidio");
	list=g_list_append(list,"News");

	gtk_combo_set_popdown_strings(GTK_COMBO(SelectType),list);
	gtk_combo_set_case_sensitive(GTK_COMBO(SelectType),FALSE);
	//gtk_widget_set_size_request(SelectType,100,300);
	//getting the text from the combo
	SelectText=gtk_label_new(gtk_entry_get_text(GTK_ENTRY((GTK_COMBO(SelectType))->entry)));

	Widget back_button,forward_button,home_button,Iback,Iforward,Ihome;

	Iback=gtk_image_new_from_stock(GTK_STOCK_GO_BACK,1);
	Iforward=gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD,1);
	Ihome=gtk_image_new_from_stock(GTK_STOCK_HOME,1);

	back_button = gtk_button_new();
	gtk_container_add(GTK_CONTAINER(back_button),Iback);
	gtk_widget_set_size_request(back_button,40,40);
		gtk_tooltips_set_tip(Tooltips,back_button,"go back",NULL);
	forward_button = gtk_button_new();
	gtk_container_add(GTK_CONTAINER(forward_button),Iforward);	
	gtk_widget_set_size_request(forward_button,40,40);
		gtk_tooltips_set_tip(Tooltips,forward_button,"go forward",NULL);
	home_button=gtk_button_new();
	gtk_container_add(GTK_CONTAINER(home_button),Ihome);
		gtk_tooltips_set_tip(Tooltips,home_button,"Home",NULL);

	//create a table and insert struffs.
	Table=gtk_table_new(50,50,FALSE);
	gtk_table_attach_defaults(GTK_TABLE(Table),UrlText,10,40,0,1);
	gtk_table_attach(GTK_TABLE(Table),back_button,8,10,0,1,1,1,0,0);
	gtk_table_attach(GTK_TABLE(Table),forward_button,40,42,0,1,1,1,0,0);
	gtk_table_attach_defaults(GTK_TABLE(Table),home_button,46,48,0,1);
	gtk_table_attach(GTK_TABLE(Table), Slider,12,25,12,14, 1, 1, 0, 0 );	
	gtk_table_attach(GTK_TABLE(Table), News,30,35,12,14, 1, 1, 0, 0 );	
	
	//input search
	gtk_table_attach_defaults(GTK_TABLE(Table),InputText,15,30,15,18);
	gtk_table_attach_defaults(GTK_TABLE(Table),SelectType,30,32,15,18);
	gtk_table_attach(GTK_TABLE(Table),SearchButton,32,36,15,17, 1, 1, 0, 0 );

	//Labels
	gtk_table_attach(GTK_TABLE(Table), MusicLabel,8,14,17,18, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), MovieLabel,16,22,17,18, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), FunLabel,24,30,17,18, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), GameLabel,32,38,17,18, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), SportLabel,40,46,17,18, 1, 1, 0, 0 );

	//Music Search
	gtk_table_attach(GTK_TABLE(Table), AfricaM,8,14,18,25, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), NijiaM,8,14,26,30, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), KamerM,8,14,31,35, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), HipHop,8,14,36,40, 1, 1, 0, 0 );
	
	//movies Search
	gtk_table_attach(GTK_TABLE(Table), Nolly,16,22,18,25, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Holly,16,22,26,30, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Bolly,16,22,31,35, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Horos,16,22,36,40, 1, 1, 0, 0 );

	//Funny Vidios
	gtk_table_attach(GTK_TABLE(Table), African,24,30,18,25, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), American,24,30,26,30, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Europe,24,30,31,35, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Kids,24,30,36,40, 1, 1, 0, 0 );

	//Game Search
	gtk_table_attach(GTK_TABLE(Table), Race,32,38,18,25, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), War,32,38,26,30, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), HerosGame,32,38,31,35, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), KidGame,32,38,36,40, 1, 1, 0, 0 );

	//Sports
	gtk_table_attach(GTK_TABLE(Table), Foot,40,46,18,25, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Basket,40,46,26,30, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Resl,40,46,31,35, 1, 1, 0, 0 );
	gtk_table_attach(GTK_TABLE(Table), Others,40,46,36,40, 1, 1, 0, 0 );

	

	scrolledWindow = gtk_scrolled_window_new(NULL, NULL);
	gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(scrolledWindow), web[count]);
	gtk_widget_show_all(scrolledWindow);

	gtk_container_add( GTK_CONTAINER(pageLayoutExpander), scrolledWindow);
	gtk_table_attach_defaults(GTK_TABLE(Table), pageLayoutExpander,0,50,11,50);
	g_signal_connect_swapped(WEBKIT_WEB_VIEW(web[count]),"load-finished",G_CALLBACK(viewSearchedPage),pageLayoutExpander);


	g_signal_connect(InputText, "activate",  G_CALLBACK(activate), web[count]);

	g_signal_connect(WEBKIT_WEB_VIEW(web[count]),"load-progress-changed",G_CALLBACK(progress),UrlText);
	g_signal_connect(WEBKIT_WEB_VIEW(web[count]),"load-finished",G_CALLBACK(finished),UrlText);
	g_signal_connect_swapped(G_OBJECT(Window), "destroy",G_CALLBACK(gtk_main_quit), NULL);
	g_signal_connect(back_button, "clicked",  G_CALLBACK(back), web[count]);
	g_signal_connect(forward_button, "clicked",  G_CALLBACK(forward), web[count]);
 	g_signal_connect(home_button, "clicked",  G_CALLBACK(Home), web[count]);
 	g_signal_connect(NijiaM, "button_press_event",  G_CALLBACK(NijiaM), web[count]);
 	
 	

	return Table;
}
Beispiel #5
0
GtkWidget *
create_window1 (void)
{
	GtkWidget *vbox1;

	/* menu */
	GtkWidget *menubar1;
	GtkWidget *menuitem1;
	GtkWidget *menuitem1_menu;
	GtkWidget *open;
	GtkWidget *apply;
	GtkWidget *save;
	GtkWidget *separatormenuitem1;
	GtkWidget *save_picture;
	GtkWidget *save_picture_image;
	GtkWidget *xsane;
	GtkWidget *separatormenuitem2;
	GtkWidget *quit;
	GtkWidget *menuitem2;
	GtkWidget *menuitem2_menu;
	GtkWidget *font;
	GtkWidget *separator2;
	GtkWidget *spell_check;
	GtkWidget *separator3;
	GtkWidget *menuitem3;
	GtkWidget *menuitem3_menu;
	GtkWidget *zoom_in;
	GtkWidget *zoom_out;
	GtkWidget *normal_size;
	GtkWidget *menuitem4;
	GtkWidget *menuitem4_menu;
	GtkWidget *about;
	GtkAccelGroup *accel_group;

	/* toolbar */
	GtkWidget *toolbar;
	GtkIconSize tmp_toolbar_icon_size;
	GtkWidget *toolbutton_open;
	GtkWidget *toolbutton_apply;
	GtkWidget *toolbutton_save;
	GtkWidget *toolitem1;
	GtkWidget *vseparator1;
	GtkWidget *toolbutton_spell;
	GtkWidget *toolitem2;
	GtkWidget *vseparator2;
	GtkWidget *toolbutton_zoom_in;
	GtkWidget *toolbutton_zoom_out;
	GtkWidget *toolbutton_zoom_fit;

	/* image */
	GtkWidget *vpaned1;
	GtkWidget *scrolledwindow_image;

	/* text */
	GtkTooltips *tooltips;

	PangoFontDescription *font_desc;

	tooltips = gtk_tooltips_new ();
	accel_group = gtk_accel_group_new ();

	window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_widget_set_size_request (window1, 600, 300);
	gtk_window_maximize (GTK_WINDOW (window1));
	gtk_window_set_title (GTK_WINDOW (window1), _("hocr-gtk"));

	vbox1 = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox1);
	gtk_container_add (GTK_CONTAINER (window1), vbox1);

	/* menu */

	menubar1 = gtk_menu_bar_new ();
	gtk_widget_show (menubar1);
	gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);

	menuitem1 = gtk_menu_item_new_with_mnemonic (_("_File"));
	gtk_widget_show (menuitem1);
	gtk_container_add (GTK_CONTAINER (menubar1), menuitem1);

	menuitem1_menu = gtk_menu_new ();
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menuitem1_menu);

	open = gtk_image_menu_item_new_from_stock ("gtk-open", accel_group);
	gtk_widget_show (open);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), open);

	apply = gtk_image_menu_item_new_from_stock ("gtk-apply", accel_group);
	gtk_widget_show (apply);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), apply);

	save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
	gtk_widget_show (save);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), save);

	separatormenuitem1 = gtk_separator_menu_item_new ();
	gtk_widget_show (separatormenuitem1);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), separatormenuitem1);
	gtk_widget_set_sensitive (separatormenuitem1, FALSE);

	save_picture = gtk_image_menu_item_new_with_label (_("Save Picture"));
	save_picture_image =
		gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
	gtk_widget_show (save_picture_image);
	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (save_picture),
				       save_picture_image);
	gtk_widget_show (save_picture);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), save_picture);

	xsane = gtk_menu_item_new_with_label (_("Xsane"));
	gtk_widget_show (xsane);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), xsane);
	
	separatormenuitem2 = gtk_separator_menu_item_new ();
	gtk_widget_show (separatormenuitem2);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), separatormenuitem2);
	gtk_widget_set_sensitive (separatormenuitem2, FALSE);

	quit = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
	gtk_widget_show (quit);
	gtk_container_add (GTK_CONTAINER (menuitem1_menu), quit);

	menuitem2 = gtk_menu_item_new_with_mnemonic (_("_Edit"));
	gtk_widget_show (menuitem2);
	gtk_container_add (GTK_CONTAINER (menubar1), menuitem2);

	menuitem2_menu = gtk_menu_new ();
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem2), menuitem2_menu);

	font = gtk_image_menu_item_new_from_stock ("gtk-select-font",
						   accel_group);
	gtk_widget_show (font);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), font);

	separator2 = gtk_separator_menu_item_new ();
	gtk_widget_show (separator2);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), separator2);
	gtk_widget_set_sensitive (separator2, FALSE);

#ifdef WITH_GTKSPELL
	spell_check =
		gtk_image_menu_item_new_from_stock ("gtk-spell-check",
						    accel_group);
	gtk_widget_show (spell_check);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), spell_check);

	separator3 = gtk_separator_menu_item_new ();
	gtk_widget_show (separator3);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), separator3);
	gtk_widget_set_sensitive (separator3, FALSE);
#endif

	color_text_box =
		gtk_check_menu_item_new_with_mnemonic (_("Color boxes"));
	gtk_widget_show (color_text_box);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), color_text_box);
	gtk_tooltips_set_tip (tooltips, color_text_box, _("Color text boxes"),
			      NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (color_text_box),
					TRUE);

	color_misread =
		gtk_check_menu_item_new_with_mnemonic (_("Color misread"));
	gtk_widget_show (color_misread);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), color_misread);
	gtk_tooltips_set_tip (tooltips, color_misread, _("Color misread fonts"),
			      NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (color_misread),
					TRUE);

	clear_text = gtk_check_menu_item_new_with_mnemonic (_("Clear"));
	gtk_widget_show (clear_text);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), clear_text);
	gtk_tooltips_set_tip (tooltips, clear_text,
			      _("Clear text each time you ocr new scan"), NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (clear_text), TRUE);

	ocr = gtk_check_menu_item_new_with_mnemonic (_("Ocr"));
	gtk_widget_show (ocr);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), ocr);
	gtk_tooltips_set_tip (tooltips, ocr,
			      _("Try to recognize fonts in scaned text"), NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (ocr), TRUE);

	use_dict = gtk_check_menu_item_new_with_mnemonic (_("Use dictionary"));
	gtk_widget_show (use_dict);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), use_dict);
	gtk_tooltips_set_tip (tooltips, use_dict,
			      _
			      ("Try to guess unrecognized fonts in scaned text using internal dictionary"),
			      NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (use_dict), FALSE);

	use_nikud = gtk_check_menu_item_new_with_mnemonic (_("Use nikud"));
	gtk_widget_show (use_nikud);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), use_nikud);
	gtk_tooltips_set_tip (tooltips, use_nikud,
			      _("Try to guess nikud"), NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (use_nikud), TRUE);

	use_spaces = gtk_check_menu_item_new_with_mnemonic (_("Use spaces"));
	gtk_widget_show (use_spaces);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), use_spaces);
	gtk_tooltips_set_tip (tooltips, use_spaces,
			      _("Use spaces for tabs"), NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (use_spaces),
					FALSE);

	use_indent =
		gtk_check_menu_item_new_with_mnemonic (_("Use indentation"));
	gtk_widget_show (use_indent);
	gtk_container_add (GTK_CONTAINER (menuitem2_menu), use_indent);
	gtk_tooltips_set_tip (tooltips, use_indent,
			      _("Try to guess line indentation"), NULL);
	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (use_indent),
					FALSE);

	menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View"));
	gtk_widget_show (menuitem3);
	gtk_container_add (GTK_CONTAINER (menubar1), menuitem3);

	menuitem3_menu = gtk_menu_new ();
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem3), menuitem3_menu);

	zoom_in =
		gtk_image_menu_item_new_from_stock ("gtk-zoom-in", accel_group);
	gtk_widget_show (zoom_in);
	gtk_container_add (GTK_CONTAINER (menuitem3_menu), zoom_in);

	zoom_out =
		gtk_image_menu_item_new_from_stock ("gtk-zoom-out",
						    accel_group);
	gtk_widget_show (zoom_out);
	gtk_container_add (GTK_CONTAINER (menuitem3_menu), zoom_out);

	normal_size =
		gtk_image_menu_item_new_from_stock ("gtk-zoom-100",
						    accel_group);
	gtk_widget_show (normal_size);
	gtk_container_add (GTK_CONTAINER (menuitem3_menu), normal_size);

	menuitem4 = gtk_menu_item_new_with_mnemonic (_("_Help"));
	gtk_widget_show (menuitem4);
	gtk_container_add (GTK_CONTAINER (menubar1), menuitem4);

	menuitem4_menu = gtk_menu_new ();
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);

	about = gtk_menu_item_new_with_mnemonic (_("_About"));
	gtk_widget_show (about);
	gtk_container_add (GTK_CONTAINER (menuitem4_menu), about);

	/* toolbar */
	toolbar = gtk_toolbar_new ();
	gtk_widget_show (toolbar);
	gtk_box_pack_start (GTK_BOX (vbox1), toolbar, FALSE, FALSE, 0);
	gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
	tmp_toolbar_icon_size =
		gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar));

	toolbutton_open =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-open");
	gtk_widget_show (toolbutton_open);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_open);
	gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton_open), tooltips,
				   _("Open a new picture for the OCR"), NULL);

	toolbutton_apply =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-apply");
	gtk_widget_show (toolbutton_apply);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_apply);
	gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton_apply), tooltips,
				   _("Convert picture to text"), NULL);

	toolbutton_save =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-save");
	gtk_widget_show (toolbutton_save);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_save);
	gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton_save), tooltips,
				   _("Save the text created by the OCR"), NULL);

	toolitem1 = (GtkWidget *) gtk_tool_item_new ();
	gtk_widget_show (toolitem1);
	gtk_container_add (GTK_CONTAINER (toolbar), toolitem1);
	vseparator1 = gtk_vseparator_new ();
	gtk_widget_show (vseparator1);
	gtk_container_add (GTK_CONTAINER (toolitem1), vseparator1);

#ifdef WITH_GTKSPELL
	toolbutton_spell =
		(GtkWidget *)
		gtk_tool_button_new_from_stock ("gtk-spell-check");
	gtk_widget_show (toolbutton_spell);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_spell);
	gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton_spell), tooltips,
				   _("Spell check the text"), NULL);

	toolitem2 = (GtkWidget *) gtk_tool_item_new ();
	gtk_widget_show (toolitem2);
	gtk_container_add (GTK_CONTAINER (toolbar), toolitem2);
	vseparator2 = gtk_vseparator_new ();
	gtk_widget_show (vseparator2);
	gtk_container_add (GTK_CONTAINER (toolitem2), vseparator2);
#endif

	toolbutton_zoom_in =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-zoom-in");
	gtk_widget_show (toolbutton_zoom_in);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_zoom_in);

	toolbutton_zoom_out =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-zoom-out");
	gtk_widget_show (toolbutton_zoom_out);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_zoom_out);

	toolbutton_zoom_fit =
		(GtkWidget *) gtk_tool_button_new_from_stock ("gtk-zoom-fit");
	gtk_widget_show (toolbutton_zoom_fit);
	gtk_container_add (GTK_CONTAINER (toolbar), toolbutton_zoom_fit);

	/* image */
	vpaned1 = gtk_vpaned_new ();
	gtk_widget_show (vpaned1);
	gtk_container_add (GTK_CONTAINER (vbox1), vpaned1);

	scrolledwindow_image = gtk_scrolled_window_new (NULL, NULL);
	gtk_scrolled_window_set_policy ((GtkScrolledWindow *)
					scrolledwindow_image,
					GTK_POLICY_AUTOMATIC,
					GTK_POLICY_AUTOMATIC);
	gtk_widget_show (scrolledwindow_image);
	gtk_container_add (GTK_CONTAINER (vpaned1), scrolledwindow_image);

	viewport1 = gtk_viewport_new (NULL, NULL);
	gtk_widget_show (viewport1);
	gtk_container_add (GTK_CONTAINER (scrolledwindow_image), viewport1);

	image = gtk_image_new ();
	gtk_widget_show (image);
	gtk_container_add (GTK_CONTAINER (viewport1), image);

	/* text */
	scrolledwindow_text = gtk_scrolled_window_new (NULL, NULL);
	gtk_scrolled_window_set_policy ((GtkScrolledWindow *)
					scrolledwindow_text,
					GTK_POLICY_AUTOMATIC,
					GTK_POLICY_AUTOMATIC);
	gtk_widget_show (scrolledwindow_text);
	gtk_container_add (GTK_CONTAINER (vpaned1), scrolledwindow_text);
	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW
					     (scrolledwindow_text),
					     GTK_SHADOW_IN);

	textview = gtk_text_view_new ();
	gtk_widget_show (textview);
	gtk_container_add (GTK_CONTAINER (scrolledwindow_text), textview);
	font_desc = pango_font_description_from_string (font_name);
	gtk_widget_modify_font (textview, font_desc);

	font_name = g_strdup (TEXT_FONT_NAME);

	/* progress bar */
	hbox2 = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox2);
	gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0);

	pbar = gtk_progress_bar_new ();
	gtk_widget_show (pbar);
	gtk_box_pack_start (GTK_BOX (hbox2), pbar, FALSE, FALSE, 0);
	gtk_widget_set_size_request (pbar, 100, -1);

	statusbar1 = gtk_statusbar_new ();
	gtk_widget_show (statusbar1);
	gtk_box_pack_start (GTK_BOX (hbox2), statusbar1, TRUE, TRUE, 0);

	/* main window */
	g_signal_connect ((gpointer) window1, "delete_event",
			  G_CALLBACK (on_window1_delete_event), NULL);

	/* toolbar */
	g_signal_connect ((gpointer) toolbutton_open, "clicked",
			  G_CALLBACK (on_toolbutton_open_clicked), NULL);
	g_signal_connect ((gpointer) toolbutton_apply, "clicked",
			  G_CALLBACK (on_toolbutton_apply_clicked), NULL);
	g_signal_connect ((gpointer) toolbutton_save, "clicked",
			  G_CALLBACK (on_toolbutton_save_clicked), NULL);

	g_signal_connect ((gpointer) toolbutton_zoom_in, "clicked",
			  G_CALLBACK (on_toolbutton_zoom_in_clicked), NULL);
	g_signal_connect ((gpointer) toolbutton_zoom_out, "clicked",
			  G_CALLBACK (on_toolbutton_zoom_out_clicked), NULL);
	g_signal_connect ((gpointer) toolbutton_zoom_fit, "clicked",
			  G_CALLBACK (on_toolbutton_zoom_fit_clicked), NULL);

#ifdef WITH_GTKSPELL
	g_signal_connect ((gpointer) toolbutton_spell, "clicked",
			  G_CALLBACK (on_toolbutton_spell_clicked), NULL);
#endif

	/* menu */
	g_signal_connect ((gpointer) open, "activate",
			  G_CALLBACK (on_open_activate), NULL);
	g_signal_connect ((gpointer) apply, "activate",
			  G_CALLBACK (on_apply_activate), NULL);
	g_signal_connect ((gpointer) save, "activate",
			  G_CALLBACK (on_save_activate), NULL);
	g_signal_connect ((gpointer) save_picture, "activate",
			  G_CALLBACK (on_save_picture_activate), NULL);
	g_signal_connect ((gpointer) xsane, "activate",
			  G_CALLBACK (on_xsane_activate), NULL);
	g_signal_connect ((gpointer) quit, "activate",
			  G_CALLBACK (on_quit_activate), NULL);
	g_signal_connect ((gpointer) font, "activate",
			  G_CALLBACK (on_font_activate), NULL);
#ifdef WITH_GTKSPELL
	g_signal_connect ((gpointer) spell_check, "activate",
			  G_CALLBACK (on_spell_check_activate), NULL);
#endif
	g_signal_connect ((gpointer) zoom_in, "activate",
			  G_CALLBACK (on_zoom_in_activate), NULL);
	g_signal_connect ((gpointer) zoom_out, "activate",
			  G_CALLBACK (on_zoom_out_activate), NULL);
	g_signal_connect ((gpointer) normal_size, "activate",
			  G_CALLBACK (on_normal_size_activate), NULL);
	g_signal_connect ((gpointer) about, "activate",
			  G_CALLBACK (on_about_activate), NULL);

	gtk_window_add_accel_group (GTK_WINDOW (window1), accel_group);

	return window1;
}
Beispiel #6
0
int l_nahud_p(class l_nahud_rek *datap,GtkWidget *wpredok)
{
l_nahud_p_data data;
data.poi=datap;

char strsql[512];

data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

sprintf(strsql,"%s %s",name_system,gettext("Поиск"));
gtk_window_set_title (GTK_WINDOW (data.window),strsql);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_nahud_p_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }


GtkWidget *label=gtk_label_new(gettext("Поиск"));

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
  hbox[i] = gtk_hbox_new (FALSE, 0);

GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);

for(int i=0; i < KOLENTER; i++)
  gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);

gtk_container_add (GTK_CONTAINER (vbox), hboxknop);

GtkTooltips *tooltips_enter[KOLENTER];

sprintf(strsql,"%s (,,)",gettext("Код подразделения"));
data.knopka_enter[E_PODR]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_PODR]), data.knopka_enter[E_PODR], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_PODR]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_PODR]),(gpointer)E_PODR);
tooltips_enter[E_PODR]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_PODR],data.knopka_enter[E_PODR],gettext("Выбор подразделения"),NULL);

data.entry[E_PODR] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_PODR]), data.entry[E_PODR], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_PODR]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_PODR]),data.poi->podr.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_PODR]),(gpointer)E_PODR);


sprintf(strsql,"%s (,,)",gettext("Табельный номер"));
data.knopka_enter[E_TABNOM]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.knopka_enter[E_TABNOM], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_TABNOM]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_TABNOM]),(gpointer)E_TABNOM);
tooltips_enter[E_TABNOM]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_TABNOM],data.knopka_enter[E_TABNOM],gettext("Выбор табельного номера"),NULL);

data.entry[E_TABNOM] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.entry[E_TABNOM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_TABNOM]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_TABNOM]),data.poi->tabnom.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_TABNOM]),(gpointer)E_TABNOM);


sprintf(strsql,"%s",gettext("Фамилия"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_FIO]), label, FALSE, FALSE, 0);

data.entry[E_FIO] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_FIO]), data.entry[E_FIO], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_FIO]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_FIO]),data.poi->fio.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_FIO]),(gpointer)E_FIO);


sprintf(strsql,"%s (%s)",gettext("Дата просмотра"),gettext("м.г"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DATA_PROS]), label, FALSE, FALSE, 0);

data.entry[E_DATA_PROS] = gtk_entry_new_with_max_length(7);
gtk_box_pack_start (GTK_BOX (hbox[E_DATA_PROS]), data.entry[E_DATA_PROS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DATA_PROS]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DATA_PROS]),data.poi->mes_god_pros.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DATA_PROS]),(gpointer)E_DATA_PROS);


sprintf(strsql,"%s",gettext("День начала"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DEN_N_PROS]), label, FALSE, FALSE, 0);

data.entry[E_DEN_N_PROS] = gtk_entry_new_with_max_length(2);
gtk_box_pack_start (GTK_BOX (hbox[E_DEN_N_PROS]), data.entry[E_DEN_N_PROS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DEN_N_PROS]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DEN_N_PROS]),data.poi->den_n_pros.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DEN_N_PROS]),(gpointer)E_DEN_N_PROS);


sprintf(strsql,"%s",gettext("День конца"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DEN_K_PROS]), label, FALSE, FALSE, 0);

data.entry[E_DEN_K_PROS] = gtk_entry_new_with_max_length(2);
gtk_box_pack_start (GTK_BOX (hbox[E_DEN_K_PROS]), data.entry[E_DEN_K_PROS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DEN_K_PROS]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DEN_K_PROS]),data.poi->den_k_pros.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DEN_K_PROS]),(gpointer)E_DEN_K_PROS);


sprintf(strsql,"%s (,,)",gettext("Категория"));
data.knopka_enter[E_KATEG]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_KATEG]), data.knopka_enter[E_KATEG], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KATEG]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KATEG]),(gpointer)E_KATEG);
tooltips_enter[E_KATEG]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KATEG],data.knopka_enter[E_KATEG],gettext("Выбор категории"),NULL);

data.entry[E_KATEG] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KATEG]), data.entry[E_KATEG], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KATEG]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KATEG]),data.poi->kateg.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KATEG]),(gpointer)E_KATEG);


sprintf(strsql,"%s (,,)",gettext("Счёт"));
data.knopka_enter[E_SHET]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_SHET]), data.knopka_enter[E_SHET], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_SHET]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_SHET]),(gpointer)E_SHET);
tooltips_enter[E_SHET]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_SHET],data.knopka_enter[E_SHET],gettext("Выбор счёта в плане счетов"),NULL);

data.entry[E_SHET] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_SHET]), data.entry[E_SHET], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_SHET]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_SHET]),data.poi->shet.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_SHET]),(gpointer)E_SHET);


sprintf(strsql,"%s (%s)",gettext("В счёт какого месяца"),gettext("м.г"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_VKM]), label, FALSE, FALSE, 0);

data.entry[E_VKM] = gtk_entry_new_with_max_length(7);
gtk_box_pack_start (GTK_BOX (hbox[E_VKM]), data.entry[E_VKM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_VKM]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_VKM]),data.poi->vkm.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_VKM]),(gpointer)E_VKM);


sprintf(strsql,"%s",gettext("Коментарий"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KOMENT]), label, FALSE, FALSE, 0);

data.entry[E_KOMENT] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KOMENT]), data.entry[E_KOMENT], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOMENT]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOMENT]),data.poi->koment.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOMENT]),(gpointer)E_KOMENT);


sprintf(strsql,"%s (,,)",gettext("Код группы подразделения"));
data.knopka_enter[E_GRUP_PODR]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_GRUP_PODR]), data.knopka_enter[E_GRUP_PODR], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_GRUP_PODR]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_GRUP_PODR]),(gpointer)E_GRUP_PODR);
tooltips_enter[E_GRUP_PODR]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_GRUP_PODR],data.knopka_enter[E_GRUP_PODR],gettext("Выбор группы подразделения"),NULL);

data.entry[E_GRUP_PODR] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_GRUP_PODR]), data.entry[E_GRUP_PODR], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_GRUP_PODR]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_GRUP_PODR]),data.poi->grup_podr.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_GRUP_PODR]),(gpointer)E_GRUP_PODR);


sprintf(strsql,"%s (+/-)",gettext("Карт-счёт"));
label=gtk_label_new(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_MNKS]), label, FALSE, FALSE, 0);

data.entry[E_MNKS] = gtk_entry_new_with_max_length(1);
gtk_box_pack_start (GTK_BOX (hbox[E_MNKS]), data.entry[E_MNKS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_MNKS]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_MNKS]),data.poi->mnks.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_MNKS]),(gpointer)E_MNKS);


sprintf(strsql,"%s (,,)",gettext("Код банка"));
data.knopka_enter[E_KODBANKA]=gtk_button_new_with_label(strsql);
gtk_box_pack_start (GTK_BOX (hbox[E_KODBANKA]), data.knopka_enter[E_KODBANKA], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KODBANKA]),"clicked",GTK_SIGNAL_FUNC(l_nahud_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KODBANKA]),(gpointer)E_KODBANKA);
tooltips_enter[E_KODBANKA]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KODBANKA],data.knopka_enter[E_KODBANKA],gettext("Выбор банка"),NULL);

data.entry[E_KODBANKA] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KODBANKA]), data.entry[E_KODBANKA], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KODBANKA]), "activate",GTK_SIGNAL_FUNC(l_nahud_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KODBANKA]),data.poi->kodbanka.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KODBANKA]),(gpointer)E_KODBANKA);

GtkTooltips *tooltips[KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Поиск"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Начать поиск нужных записей"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(l_nahud_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F4 %s",gettext("Очистить"));
data.knopka[FK4]=gtk_button_new_with_label(strsql);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Очистить меню от введенной информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]),"clicked",GTK_SIGNAL_FUNC(l_nahud_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK4], TRUE, TRUE, 0);


sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(l_nahud_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);


gtk_main();
//printf("l_l_nahud_p-metka_poi=%d\n",data.poi->metka_poi);
if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.voz);
}
GtkWidget *
sp_find_dialog_old (void)
{
    if  (!dlg)
    {
        gchar title[500];
        sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_FIND), title);
        Inkscape::Preferences *prefs = Inkscape::Preferences::get();

        dlg = sp_window_new (title, TRUE);
        if (x == -1000 || y == -1000) {
            x = prefs->getInt(prefs_path + "x", -1000);
            y = prefs->getInt(prefs_path + "y", -1000);
        }
        if (w ==0 || h == 0) {
            w = prefs->getInt(prefs_path + "w", 0);
            h = prefs->getInt(prefs_path + "h", 0);
        }
        
//        if (x<0) x=0;
//        if (y<0) y=0;

        if (w && h)
            gtk_window_resize ((GtkWindow *) dlg, w, h);
        if (x >= 0 && y >= 0 && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE))) {
            gtk_window_move ((GtkWindow *) dlg, x, y);
        } else {
            gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
        }

        sp_transientize (dlg);
        wd.win = dlg;
        wd.stop = 0;
        g_signal_connect   ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd );

        gtk_signal_connect ( GTK_OBJECT (dlg), "event", GTK_SIGNAL_FUNC (sp_dialog_event_handler), dlg);

        gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (sp_find_dialog_destroy), NULL );
        gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", G_CALLBACK (sp_find_dialog_delete), dlg);
        g_signal_connect   ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (sp_find_dialog_delete), dlg);

        g_signal_connect   ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg);
        g_signal_connect   ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg);

        GtkTooltips *tt = gtk_tooltips_new ();

        gtk_container_set_border_width (GTK_CONTAINER (dlg), 4);

        /* Toplevel vbox */
        GtkWidget *vb = gtk_vbox_new (FALSE, 0);
        gtk_container_add (GTK_CONTAINER (dlg), vb);

        sp_find_new_searchfield (dlg, vb, _("_Text: "), "text", tt, _("Find objects by their text content (exact or partial match)"));
        sp_find_new_searchfield (dlg, vb, _("_ID: "), "id", tt, _("Find objects by the value of the id attribute (exact or partial match)"));
        sp_find_new_searchfield (dlg, vb, _("_Style: "), "style", tt, _("Find objects by the value of the style attribute (exact or partial match)"));
        sp_find_new_searchfield (dlg, vb, _("_Attribute: "), "attr", tt ,_("Find objects by the name of an attribute (exact or partial match)"));

        gtk_widget_show_all (vb);

        GtkWidget *types = sp_find_types ();
        gtk_object_set_data (GTK_OBJECT (dlg), "types", types);
        gtk_box_pack_start (GTK_BOX (vb), types, FALSE, FALSE, 0);

        {
            GtkWidget *w = gtk_hseparator_new ();
            gtk_widget_show (w);
            gtk_box_pack_start (GTK_BOX (vb), w, FALSE, FALSE, 3);

            {
            GtkWidget *b  = gtk_check_button_new_with_mnemonic (_("Search in s_election"));
            gtk_widget_show (b);
            gtk_toggle_button_set_active ((GtkToggleButton *) b, FALSE);
            gtk_object_set_data (GTK_OBJECT (dlg), "inselection", b);
            gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Limit search to the current selection"), NULL);
            gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
            }

            {
            GtkWidget *b  = gtk_check_button_new_with_mnemonic (_("Search in current _layer"));
            gtk_widget_show (b);
            gtk_toggle_button_set_active ((GtkToggleButton *) b, FALSE);
            gtk_object_set_data (GTK_OBJECT (dlg), "inlayer", b);
            gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Limit search to the current layer"), NULL);
            gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
            }

            {
            GtkWidget *b  = gtk_check_button_new_with_mnemonic (_("Include _hidden"));
            gtk_widget_show (b);
            gtk_toggle_button_set_active ((GtkToggleButton *) b, FALSE);
            gtk_object_set_data (GTK_OBJECT (dlg), "includehidden", b);
            gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Include hidden objects in search"), NULL);
            gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
            }

            {
            GtkWidget *b  = gtk_check_button_new_with_mnemonic (_("Include l_ocked"));
            gtk_widget_show (b);
            gtk_toggle_button_set_active ((GtkToggleButton *) b, FALSE);
            gtk_object_set_data (GTK_OBJECT (dlg), "includelocked", b);
            gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Include locked objects in search"), NULL);
            gtk_box_pack_start (GTK_BOX (vb), b, FALSE, FALSE, 0);
            }
        }

        {
            GtkWidget *hb = gtk_hbox_new (FALSE, 0);
            gtk_widget_show (hb);
            gtk_box_pack_start (GTK_BOX (vb), hb, FALSE, FALSE, 0);

            // TRANSLATORS: "Clear" is a verb here
            sp_find_new_button (dlg, hb, _("_Clear"), tt, _("Clear values"), sp_find_dialog_reset);
            sp_find_new_button (dlg, hb, _("_Find"), tt, _("Select objects matching all of the fields you filled in"), sp_find_dialog_find);
        }
    }

    gtk_widget_show((GtkWidget *) dlg);
    gtk_window_present ((GtkWindow *) dlg);
    sp_find_dialog_reset (NULL, G_OBJECT (dlg));

    return dlg;
}
Beispiel #8
0
int l_zarkateg_p(class l_zarkateg_rek *rek_poi,GtkWidget *wpredok)
{
class l_zarkateg_p_data data;
char strsql[512];
data.rk=rek_poi;


data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);
sprintf(strsql,"%s %s",name_system,gettext("Поиск"));

gtk_window_set_title(GTK_WINDOW(data.window),strsql);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_zarkateg_p_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
 }
//Закрыть окно если окно предок удалено
gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);



GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
 hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
for(int i=0; i < KOLENTER; i++)
  gtk_box_pack_start (GTK_BOX (vbox),hbox[i], TRUE, TRUE, 0);
 gtk_box_pack_start (GTK_BOX (vbox), hboxknop, TRUE, TRUE, 0);


GtkWidget *label=gtk_label_new(gettext("Код"));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), label, FALSE, FALSE, 0);

data.entry[E_KOD] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), data.entry[E_KOD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD]), "activate",GTK_SIGNAL_FUNC(l_zarkateg_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD]),data.rk->kod.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD]),(gpointer)E_KOD);

label=gtk_label_new(gettext("Наименование"));
gtk_box_pack_start (GTK_BOX (hbox[E_NAIM]), label, FALSE, FALSE, 0);

data.entry[E_NAIM] = gtk_entry_new_with_max_length (80);
gtk_box_pack_start (GTK_BOX (hbox[E_NAIM]), data.entry[E_NAIM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_NAIM]), "activate",GTK_SIGNAL_FUNC(l_zarkateg_p_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_NAIM]),data.rk->naim.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_NAIM]),(gpointer)E_NAIM);


GtkTooltips *tooltips[KOL_FK];

sprintf(strsql,"F2 %s",gettext("Поиск"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Начать поиск нужных записей"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(l_zarkateg_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F4 %s",gettext("Очистить"));
data.knopka[FK4]=gtk_button_new_with_label(strsql);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Очистить меню от введеноой информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]),"clicked",GTK_SIGNAL_FUNC(l_zarkateg_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK4], TRUE, TRUE, 0);


sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Поиск не выполнять"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(l_zarkateg_p_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);

gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.voz);

}
Beispiel #9
0
int l_taxikz_v(class iceb_u_str *kod_gr,GtkWidget *wpredok)
{

class l_taxikz_v_data data;
char strsql[300];
iceb_u_str kikz;
data.kod_gr.new_plus(kod_gr->ravno());

data.rk.clear_data();

if(data.kod_gr.getdlinna() >  1)
 {
  data.rk.kod.new_plus(data.kod_gr.ravno());
  sprintf(strsql,"select * from Taxikzz where kod=%s",data.kod_gr.ravno());
  SQL_str row;
  SQLCURSOR cur;
  if(iceb_sql_readkey(strsql,&row,&cur,wpredok) < 1)
   {
    iceb_menu_soob(gettext("Не найдена запись для корректировки !"),wpredok);
    return(1);
   }

  data.rk.naim.new_plus(row[1]);
  kikz.plus(iceb_kikz(row[2],row[3],wpredok));
  
 }
else
 {
  sprintf(strsql,"%d",iceb_get_new_kod("Taxikzz",0,wpredok));
  data.rk.kod.new_plus(strsql);
 } 
data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

GtkWidget *label=NULL;

if(data.kod_gr.getdlinna() <= 1)
 {
  sprintf(strsql,"%s %s",name_system,gettext("Ввод новой записи"));
  label=gtk_label_new(gettext("Ввод новой записи"));
 }
else
 {
  sprintf(strsql,"%s %s",name_system,gettext("Корректировка записи"));
  iceb_u_str repl;
  repl.plus(gettext("Корректировка записи"));
  repl.ps_plus(kikz.ravno());
  label=gtk_label_new(repl.ravno_toutf());
 }

gtk_window_set_title(GTK_WINDOW(data.window),strsql);
gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_taxikz_v_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
 hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0; i < KOLENTER; i++)
 gtk_box_pack_start (GTK_BOX (vbox),hbox[i], TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),hboxknop, TRUE, TRUE, 0);


label=gtk_label_new(gettext("Код"));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), label, FALSE, FALSE, 0);

data.entry[E_KOD] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), data.entry[E_KOD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD]), "activate",GTK_SIGNAL_FUNC(l_taxikz_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD]),data.rk.kod.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD]),(gpointer)E_KOD);

label=gtk_label_new(gettext("Наименование"));
gtk_box_pack_start (GTK_BOX (hbox[E_NAIM]), label, FALSE, FALSE, 0);

data.entry[E_NAIM] = gtk_entry_new_with_max_length (60);
gtk_box_pack_start (GTK_BOX (hbox[E_NAIM]), data.entry[E_NAIM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_NAIM]), "activate",GTK_SIGNAL_FUNC(l_taxikz_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_NAIM]),data.rk.naim.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_NAIM]),(gpointer)E_NAIM);

GtkTooltips *tooltips[KOL_FK];

sprintf(strsql,"F2 %s",gettext("Запись"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Запись введеной в меню информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(l_taxikz_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы с меню без записи введенной информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(l_taxikz_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[1]);

gtk_widget_show_all (data.window);

gtk_main();
if(data.voz == 0)
 kod_gr->new_plus(data.rk.kod.ravno());

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));


return(data.voz);
}
Beispiel #10
0
/*
 * Create and display the column selection widgets.
 * Called as part of the creation of the Preferences notebook ( Edit ! Preferences )
 */
GtkWidget *
column_prefs_show(GtkWidget *prefs_window) {
    GtkWidget         *main_vb, *bottom_hb, *column_l, *add_bt, *tb, *lb;
    GtkWidget         *list_vb, *list_lb, *list_sc;
    GtkWidget         *add_remove_vb;
    GtkWidget         *props_fr, *props_hb;
    GList             *clp;
    fmt_data          *cfmt;
    gint               i;
    gchar             *fmt;
    gint               cur_fmt;
    const gchar       *column_titles[] = {"Title", "Field type"};
    GtkListStore      *store;
    GtkCellRenderer   *renderer;
    GtkTreeViewColumn *column;
    GtkTreeSelection  *sel;
    GtkTreeIter        iter;
    GtkTreeIter        first_iter;
    gint               first_row = TRUE;

    GtkTooltips   *tooltips = gtk_tooltips_new();

    /* Container for each row of widgets */
    main_vb = gtk_vbox_new(FALSE, 5);
    gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
    gtk_widget_show(main_vb);

    list_vb = gtk_vbox_new (FALSE, 0);
    gtk_container_set_border_width  (GTK_CONTAINER (list_vb), 5);
    gtk_widget_show (list_vb);
    gtk_box_pack_start (GTK_BOX (main_vb), list_vb, TRUE, TRUE, 0);

    list_lb = gtk_label_new (("[The first list entry will be displayed as the leftmost column]"));
    gtk_widget_show (list_lb);
    gtk_box_pack_start (GTK_BOX (list_vb), list_lb, FALSE, FALSE, 0);

    list_sc = scrolled_window_new(NULL, NULL);
    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(list_sc), GTK_SHADOW_IN);
    gtk_container_add(GTK_CONTAINER(list_vb), list_sc);
    gtk_widget_show(list_sc);

    store = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
    column_row_deleted_handler_id = 
        g_signal_connect(GTK_TREE_MODEL(store), "row-deleted", G_CALLBACK(column_dnd_row_deleted_cb), NULL);

    column_l = tree_view_new(GTK_TREE_MODEL(store));
    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(column_l), TRUE);
    gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(column_l), FALSE);
    gtk_tree_view_set_reorderable(GTK_TREE_VIEW(column_l), TRUE);
    gtk_tooltips_set_tip (tooltips, column_l, 
        "Click on a title to change its name.\nDrag an item to change its order.", NULL);

    renderer = gtk_cell_renderer_text_new();
    g_object_set(G_OBJECT(renderer), "editable", TRUE, NULL);
    g_signal_connect (renderer, "edited", G_CALLBACK(column_title_changed_cb), GTK_TREE_MODEL(store));
    column = gtk_tree_view_column_new_with_attributes(column_titles[0], renderer, "text", 0, NULL);
    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
    gtk_tree_view_append_column(GTK_TREE_VIEW(column_l), column);

    renderer = gtk_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(column_titles[1], renderer, "text", 1, NULL);
    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
    gtk_tree_view_append_column(GTK_TREE_VIEW(column_l), column);

    /* XXX - make this match the packet list prefs? */
    sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(column_l));
    gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
    g_signal_connect(sel, "changed", G_CALLBACK(column_list_select_cb), NULL);

    gtk_container_add(GTK_CONTAINER(list_sc), column_l);
    gtk_widget_show(column_l);

    clp = g_list_first(prefs.col_list);
    while (clp) {
        cfmt    = (fmt_data *) clp->data;
        cur_fmt = get_column_format_from_str(cfmt->fmt);
        if (cur_fmt == COL_CUSTOM) {
            fmt = g_strdup_printf("%s (%s)", col_format_desc(cur_fmt), cfmt->custom_field);
        } else {
            if (cfmt->custom_field) {
                /* Delete custom_field from previous changes */
                g_free (cfmt->custom_field);
                cfmt->custom_field = NULL;
            }
            fmt = g_strdup_printf("%s", col_format_desc(cur_fmt));
        }
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter, 0, cfmt->title, 1, fmt, 2, clp, -1);
        if (first_row) {
            first_iter = iter;
            first_row = FALSE;
        }
        clp = clp->next;
        g_free (fmt);
    }
    g_object_unref(G_OBJECT(store));

    /* Bottom row: Add/remove buttons and properties */
    bottom_hb = gtk_hbox_new(FALSE, 5);
    gtk_box_pack_start (GTK_BOX (main_vb), bottom_hb, FALSE, TRUE, 0);
    gtk_widget_show(bottom_hb);

    /* Add / remove buttons */
    add_remove_vb = gtk_vbox_new (TRUE, 0);
    gtk_container_set_border_width (GTK_CONTAINER (add_remove_vb), 5);
    gtk_box_pack_start (GTK_BOX (bottom_hb), add_remove_vb, FALSE, FALSE, 0);
    gtk_widget_show(add_remove_vb);

    add_bt = gtk_button_new_from_stock(GTK_STOCK_ADD);
    g_signal_connect(add_bt, "clicked", G_CALLBACK(column_list_new_cb), column_l);
    gtk_box_pack_start (GTK_BOX (add_remove_vb), add_bt, FALSE, FALSE, 0);
    gtk_tooltips_set_tip (tooltips, add_bt,
                          "Add a new column at the end of the list.", NULL);
    gtk_widget_show(add_bt);

    remove_bt = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
    gtk_widget_set_sensitive(remove_bt, FALSE);
    g_signal_connect(remove_bt, "clicked", G_CALLBACK(column_list_delete_cb), column_l);
    gtk_box_pack_start (GTK_BOX (add_remove_vb), remove_bt, FALSE, FALSE, 0);
    gtk_tooltips_set_tip (tooltips, remove_bt,
                          "Remove the selected column.", NULL);
    gtk_widget_show(remove_bt);
  
    /* properties frame */
    props_fr = gtk_frame_new("Properties");
    gtk_box_pack_start (GTK_BOX (bottom_hb), props_fr, TRUE, TRUE, 0);
    gtk_widget_show(props_fr);

    /* Column name entry and format selection */
    tb = gtk_table_new(2, 2, FALSE);
    gtk_container_set_border_width(GTK_CONTAINER(tb), 5);
    gtk_container_add(GTK_CONTAINER(props_fr), tb);
    gtk_table_set_row_spacings(GTK_TABLE(tb), 10);
    gtk_table_set_col_spacings(GTK_TABLE(tb), 15);
    gtk_widget_show(tb);

    lb = gtk_label_new("Field type:");
    gtk_misc_set_alignment(GTK_MISC(lb), 1.0f, 0.5f);
    gtk_table_attach_defaults(GTK_TABLE(tb), lb, 0, 1, 0, 1);
    gtk_tooltips_set_tip (tooltips, lb,
                          "Select which packet information to present in the column.", NULL);
    gtk_widget_show(lb);

    props_hb = gtk_hbox_new(FALSE, 5);
    gtk_table_attach(GTK_TABLE(tb), props_hb, 1, 2, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0);
    gtk_tooltips_set_tip (tooltips, props_hb,
                          "Select which packet information to present in the column.", NULL);
    gtk_widget_show(props_hb);

    field_lb = gtk_label_new("Field name:");
    gtk_misc_set_alignment(GTK_MISC(field_lb), 1.0f, 0.5f);
    gtk_table_attach_defaults(GTK_TABLE(tb), field_lb, 0, 1, 1, 2);
    gtk_widget_set_sensitive(field_lb, FALSE);
    gtk_tooltips_set_tip (tooltips, field_lb,
                          "Field name used when field type is \"Custom\". "
                          "This string has the same syntax as a display filter string.", NULL);
    gtk_widget_show(field_lb);

    field_te = gtk_entry_new();
    g_object_set_data (G_OBJECT(field_te), E_FILT_FIELD_NAME_ONLY_KEY, "");
    g_signal_connect(field_te, "changed", G_CALLBACK(filter_te_syntax_check_cb), NULL);

    /* XXX: column_field_changed_cb will be called for every character entered in the entry box.      */
    /*       Consider Changing logic so that the field is "accepted" only when a return is entered ?? */
    /*       Also: entry shouldn't be accepted if it's not a valid filter ?                           */
    column_field_changed_handler_id = 
        g_signal_connect(field_te, "changed", G_CALLBACK(column_field_changed_cb), column_l);

    g_object_set_data(G_OBJECT(main_vb), E_FILT_AUTOCOMP_PTR_KEY, NULL);
    g_signal_connect(field_te, "key-press-event", G_CALLBACK (filter_string_te_key_pressed_cb), NULL);
    g_signal_connect(prefs_window, "key-press-event", G_CALLBACK (filter_parent_dlg_key_pressed_cb), NULL);
    colorize_filter_te_as_empty(field_te);
    gtk_table_attach_defaults(GTK_TABLE(tb), field_te, 1, 2, 1, 2);
    gtk_widget_set_sensitive(field_te, FALSE);
    gtk_tooltips_set_tip (tooltips, field_te,
                          "Field name used when field type is \"Custom\". "
                          "This string has the same syntax as a display filter string.", NULL);
    gtk_widget_show(field_te);

    fmt_cmb = gtk_combo_box_new_text();

    for (i = 0; i < NUM_COL_FMTS; i++)
        gtk_combo_box_append_text(GTK_COMBO_BOX(fmt_cmb), col_format_desc(i));

    column_menu_changed_handler_id = g_signal_connect(fmt_cmb, "changed", G_CALLBACK(column_menu_changed_cb), column_l);

    gtk_widget_set_sensitive(fmt_cmb, FALSE);
    gtk_box_pack_start(GTK_BOX(props_hb), fmt_cmb, FALSE, FALSE, 0);
    gtk_widget_show(fmt_cmb);

    /* select the first menu list row.             */
    /*  Triggers call to column_list_select_cb().  */
    gtk_tree_selection_select_iter(sel, &first_iter);

    return(main_vb);
}
Beispiel #11
0
void create_PreferencesDialog(void)
{
  GtkWidget *PreferencesDialog;
  GtkWidget *dialog_vbox9;
  GtkWidget *notebook1;
  GtkWidget *GenericTable;
  GtkWidget *label173;
  GtkObject *LogLevelSpinner_adj;
  GtkWidget *LogLevelSpinner;
  GtkWidget *DebugCheckButton;
  GtkWidget *label174;
  GtkWidget *StreamDirectoryHbox;
  GtkWidget *StreamDirectory;
  GtkWidget *StreamDirectoryButton;
  GtkWidget *alignment24;
  GtkWidget *hbox84;
  GtkWidget *image24;
  GtkWidget *label175;
  GtkWidget *label176;
  GtkWidget *ProfileDirectoryHbox;
  GtkWidget *ProfileDirectory;
  GtkWidget *ProfileDirectoryButton;
  GtkWidget *alignment25;
  GtkWidget *hbox86;
  GtkWidget *image25;
  GtkWidget *label177;
  GtkWidget *label169;
  GtkWidget *NetworkVbox;
  GtkWidget *NetworkTable;
  GtkWidget *label178;
  GtkWidget *label179;
  GtkWidget *MulticastTtlMenu;
  GtkWidget *menu16;
  GtkWidget *ttl_lan;
  GtkWidget *ttl_organization;
  GtkWidget *ttl_regional;
  GtkWidget *ttl_worldwide;
  GtkObject *MtuSpinButton_adj;
  GtkWidget *MtuSpinButton;
  GtkWidget *vbox39;
  GtkWidget *hbox89;
  GtkWidget *AllowRtcpCheck;
  GtkWidget *hbox87;
  GtkWidget *AllowSSMCheck;
  GtkWidget *label170;
  GtkWidget *MP4FileSettingsVbox;
  GtkWidget *FileStatusFrame;
  GtkWidget *FileStatusVbox;
  GtkWidget *hbox90;
  GtkWidget *FileStatus1;
  GSList *FileStatus1_group = NULL;
  GtkWidget *hbox91;
  GtkWidget *FileStatus2;
  GtkWidget *hbox92;
  GtkWidget *FileStatus3;
  GtkWidget *label180;
  GtkWidget *hbox93;
  GtkWidget *RecordHintTrackButton;
  GtkWidget *hbox94;
  GtkWidget *OptimizeMP4FileButton;
  GtkWidget *hbox95;
  GtkWidget *RecordRawDataButton;
  GtkWidget *RawFileName;
  GtkWidget *RawFileNameBrowse;
  GtkWidget *alignment26;
  GtkWidget *hbox96;
  GtkWidget *image26;
  GtkWidget *label181;
  GtkWidget *label171;
  GtkWidget *dialog_action_area8;
  GtkWidget *cancelbutton6;
  GtkWidget *okbutton8;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new();

  PreferencesDialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(PreferencesDialog), _("Preferences"));
  gtk_window_set_modal(GTK_WINDOW(PreferencesDialog), TRUE);
  gtk_window_set_resizable(GTK_WINDOW(PreferencesDialog), FALSE);
  gtk_window_set_transient_for(GTK_WINDOW(PreferencesDialog), 
			       GTK_WINDOW(MainWindow));

  dialog_vbox9 = GTK_DIALOG(PreferencesDialog)->vbox;
  gtk_widget_show(dialog_vbox9);

  notebook1 = gtk_notebook_new();
  gtk_widget_show(notebook1);
  gtk_box_pack_start(GTK_BOX(dialog_vbox9), notebook1, TRUE, TRUE, 0);

  GenericTable = gtk_table_new(4, 2, FALSE);
  gtk_widget_show(GenericTable);
  gtk_container_add(GTK_CONTAINER(notebook1), GenericTable);
  gtk_table_set_row_spacings(GTK_TABLE(GenericTable), 9);
  gtk_table_set_col_spacings(GTK_TABLE(GenericTable), 36);

  label173 = gtk_label_new(_("Log Level"));
  gtk_widget_show(label173);
  gtk_table_attach(GTK_TABLE(GenericTable), label173, 0, 1, 1, 2,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label173), 0, 0.5);

  LogLevelSpinner_adj = gtk_adjustment_new(MyConfig->GetIntegerValue(CONFIG_APP_LOGLEVEL),
					    0, 7, 1, 10, 10);
  LogLevelSpinner = gtk_spin_button_new(GTK_ADJUSTMENT(LogLevelSpinner_adj), 1, 0);
  gtk_widget_show(LogLevelSpinner);
  gtk_table_attach(GTK_TABLE(GenericTable), LogLevelSpinner, 1, 2, 1, 2,
                   (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);

  DebugCheckButton = gtk_check_button_new_with_mnemonic(_("Debug"));
  gtk_widget_show(DebugCheckButton);
  gtk_table_attach(GTK_TABLE(GenericTable), DebugCheckButton, 0, 2, 0, 1,
                   (GtkAttachOptions)(0),
                   (GtkAttachOptions)(0), 0, 0);

  label174 = gtk_label_new(_("Stream Directory"));
  gtk_widget_show(label174);
  gtk_table_attach(GTK_TABLE(GenericTable), label174, 0, 1, 2, 3,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label174), 0, 0.5);

  StreamDirectoryHbox = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(StreamDirectoryHbox);
  gtk_table_attach(GTK_TABLE(GenericTable), StreamDirectoryHbox, 1, 2, 2, 3,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(GTK_FILL), 0, 0);

  StreamDirectory = gtk_entry_new();
  gtk_widget_show(StreamDirectory);
  gtk_box_pack_start(GTK_BOX(StreamDirectoryHbox), StreamDirectory, TRUE, TRUE, 0);

  StreamDirectoryButton = gtk_button_new();
  gtk_widget_show(StreamDirectoryButton);
  gtk_box_pack_start(GTK_BOX(StreamDirectoryHbox), StreamDirectoryButton, FALSE, FALSE, 0);

  alignment24 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment24);
  gtk_container_add(GTK_CONTAINER(StreamDirectoryButton), alignment24);

  hbox84 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox84);
  gtk_container_add(GTK_CONTAINER(alignment24), hbox84);

  image24 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image24);
  gtk_box_pack_start(GTK_BOX(hbox84), image24, FALSE, FALSE, 0);

  label175 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label175);
  gtk_box_pack_start(GTK_BOX(hbox84), label175, FALSE, FALSE, 0);

  label176 = gtk_label_new(_("Profiles Directory"));
  gtk_widget_show(label176);
  gtk_table_attach(GTK_TABLE(GenericTable), label176, 0, 1, 3, 4,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label176), 0, 0.5);

  ProfileDirectoryHbox = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(ProfileDirectoryHbox);
  gtk_table_attach(GTK_TABLE(GenericTable), ProfileDirectoryHbox, 1, 2, 3, 4,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(GTK_FILL), 0, 0);

  ProfileDirectory = gtk_entry_new();
  gtk_widget_show(ProfileDirectory);
  gtk_box_pack_start(GTK_BOX(ProfileDirectoryHbox), ProfileDirectory, TRUE, TRUE, 0);

  ProfileDirectoryButton = gtk_button_new();
  gtk_widget_show(ProfileDirectoryButton);
  gtk_box_pack_start(GTK_BOX(ProfileDirectoryHbox), ProfileDirectoryButton, FALSE, FALSE, 0);

  alignment25 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment25);
  gtk_container_add(GTK_CONTAINER(ProfileDirectoryButton), alignment25);

  hbox86 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox86);
  gtk_container_add(GTK_CONTAINER(alignment25), hbox86);

  image25 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image25);
  gtk_box_pack_start(GTK_BOX(hbox86), image25, FALSE, FALSE, 0);

  label177 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label177);
  gtk_box_pack_start(GTK_BOX(hbox86), label177, FALSE, FALSE, 0);

  label169 = gtk_label_new(_("Generic"));
  gtk_widget_show(label169);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 0), label169);

  NetworkVbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(NetworkVbox);
  gtk_container_add(GTK_CONTAINER(notebook1), NetworkVbox);

  NetworkTable = gtk_table_new(2, 2, TRUE);
  gtk_widget_show(NetworkTable);
  gtk_box_pack_start(GTK_BOX(NetworkVbox), NetworkTable, FALSE, TRUE, 6);
  gtk_table_set_row_spacings(GTK_TABLE(NetworkTable), 7);

  label178 = gtk_label_new(_("Multicast TTL"));
  gtk_widget_show(label178);
  gtk_table_attach(GTK_TABLE(NetworkTable), label178, 0, 1, 0, 1,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label178), 0, 0.5);

  label179 = gtk_label_new(_("MTU"));
  gtk_widget_show(label179);
  gtk_table_attach(GTK_TABLE(NetworkTable), label179, 0, 1, 1, 2,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label179), 0, 0.5);

  MulticastTtlMenu = gtk_option_menu_new();
  gtk_widget_show(MulticastTtlMenu);
  gtk_table_attach(GTK_TABLE(NetworkTable), MulticastTtlMenu, 1, 2, 0, 1,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);

  menu16 = gtk_menu_new();

  ttl_lan = gtk_menu_item_new_with_mnemonic(_("LAN - 1"));
  gtk_widget_show(ttl_lan);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_lan);

  ttl_organization = gtk_menu_item_new_with_mnemonic(_("Organization - 15"));
  gtk_widget_show(ttl_organization);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_organization);

  ttl_regional = gtk_menu_item_new_with_mnemonic(_("Regional - 63"));
  gtk_widget_show(ttl_regional);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_regional);

  ttl_worldwide = gtk_menu_item_new_with_mnemonic(_("Worldwide -127"));
  gtk_widget_show(ttl_worldwide);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_worldwide);

  gtk_option_menu_set_menu(GTK_OPTION_MENU(MulticastTtlMenu), menu16);

  MtuSpinButton_adj = 
    gtk_adjustment_new(MyConfig->GetIntegerValue(CONFIG_RTP_PAYLOAD_SIZE), 
		       256, 65535, 1, 100, 100);
  MtuSpinButton = gtk_spin_button_new(GTK_ADJUSTMENT (MtuSpinButton_adj), 1, 0);
  gtk_widget_show(MtuSpinButton);
  gtk_table_attach(GTK_TABLE (NetworkTable), MtuSpinButton, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (MtuSpinButton), TRUE);

  vbox39 = gtk_vbox_new(FALSE, 4);
  gtk_widget_show(vbox39);
  gtk_box_pack_start(GTK_BOX(NetworkVbox), vbox39, FALSE, FALSE, 5);

  hbox89 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox89);
  gtk_box_pack_start(GTK_BOX(vbox39), hbox89, TRUE, TRUE, 4);

  AllowRtcpCheck = gtk_check_button_new_with_mnemonic(_("Allow Clients to Send RTCP"));
  gtk_widget_show(AllowRtcpCheck);
  gtk_box_pack_start(GTK_BOX(hbox89), AllowRtcpCheck, FALSE, FALSE, 94);
  gtk_tooltips_set_tip(tooltips, AllowRtcpCheck, _("Allow clients to send RTCP - default off"), NULL);

  hbox87 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox87);
  gtk_box_pack_start(GTK_BOX(vbox39), hbox87, TRUE, TRUE, 0);

  AllowSSMCheck = gtk_check_button_new_with_mnemonic(_("Use Single Source Multicast"));
  gtk_widget_show(AllowSSMCheck);
  gtk_box_pack_start(GTK_BOX(hbox87), AllowSSMCheck, TRUE, FALSE, 0);
  gtk_widget_set_sensitive(AllowSSMCheck, FALSE);

  label170 = gtk_label_new(_("Network Settings"));
  gtk_widget_show(label170);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 1), label170);

  MP4FileSettingsVbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(MP4FileSettingsVbox);
  gtk_container_add(GTK_CONTAINER(notebook1), MP4FileSettingsVbox);
  gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(notebook1), MP4FileSettingsVbox,
                                      FALSE, FALSE, GTK_PACK_START);

  FileStatusFrame = gtk_frame_new(NULL);
  gtk_widget_show(FileStatusFrame);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), FileStatusFrame, TRUE, TRUE, 0);

  FileStatusVbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(FileStatusVbox);
  gtk_container_add(GTK_CONTAINER(FileStatusFrame), FileStatusVbox);

  hbox90 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox90);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox90, TRUE, TRUE, 0);

  FileStatus1 = gtk_radio_button_new_with_mnemonic(NULL, _("Always overwrite existing file"));
  gtk_widget_show(FileStatus1);
  gtk_box_pack_start(GTK_BOX(hbox90), FileStatus1, TRUE, TRUE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus1), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus1));

  hbox91 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox91);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox91, FALSE, FALSE, 0);

  FileStatus2 = gtk_radio_button_new_with_mnemonic(NULL, _("Append to file"));
  gtk_widget_show(FileStatus2);
  gtk_box_pack_start(GTK_BOX(hbox91), FileStatus2, TRUE, TRUE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus2), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus2));

  hbox92 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox92);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox92, FALSE, FALSE, 0);

  FileStatus3 = gtk_radio_button_new_with_mnemonic(NULL, _("Create new file based on name"));
  gtk_widget_show(FileStatus3);
  gtk_box_pack_start(GTK_BOX(hbox92), FileStatus3, FALSE, FALSE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus3), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus3));

  label180 = gtk_label_new(_("File Status"));
  gtk_widget_show(label180);
  gtk_frame_set_label_widget(GTK_FRAME(FileStatusFrame), label180);

  hbox93 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox93);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox93, TRUE, TRUE, 4);

  RecordHintTrackButton = gtk_check_button_new_with_mnemonic(_("Record Hint Tracks when Finished"));
  gtk_widget_show(RecordHintTrackButton);
  gtk_box_pack_start(GTK_BOX(hbox93), RecordHintTrackButton, TRUE, FALSE, 0);
  gtk_tooltips_set_tip(tooltips, RecordHintTrackButton, _("If set, this can cause application to appear to freeze when finished"), NULL);

  hbox94 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox94);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox94, TRUE, TRUE, 4);

  OptimizeMP4FileButton = gtk_check_button_new_with_mnemonic(_("Optimize When Finished"));
  gtk_widget_show(OptimizeMP4FileButton);
  gtk_box_pack_start(GTK_BOX(hbox94), OptimizeMP4FileButton, FALSE, FALSE, 79);

  hbox95 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox95);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox95, TRUE, TRUE, 0);

  RecordRawDataButton = gtk_check_button_new_with_mnemonic(_("Record Raw Data "));
  gtk_widget_show(RecordRawDataButton);
  gtk_box_pack_start(GTK_BOX(hbox95), RecordRawDataButton, FALSE, FALSE, 0);

  RawFileName = gtk_entry_new();
  gtk_widget_show(RawFileName);
  gtk_box_pack_start(GTK_BOX(hbox95), RawFileName, TRUE, TRUE, 0);
  gtk_tooltips_set_tip(tooltips, RawFileName, _("Raw Data MP4 File Name"), NULL);

  RawFileNameBrowse = gtk_button_new();
  gtk_widget_show(RawFileNameBrowse);
  gtk_box_pack_start(GTK_BOX(hbox95), RawFileNameBrowse, FALSE, FALSE, 0);

  alignment26 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment26);
  gtk_container_add(GTK_CONTAINER(RawFileNameBrowse), alignment26);

  hbox96 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox96);
  gtk_container_add(GTK_CONTAINER(alignment26), hbox96);

  image26 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image26);
  gtk_box_pack_start(GTK_BOX(hbox96), image26, FALSE, FALSE, 0);

  label181 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label181);
  gtk_box_pack_start(GTK_BOX(hbox96), label181, FALSE, FALSE, 0);

  label171 = gtk_label_new(_("MP4 File Settings"));
  gtk_widget_show(label171);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 2), label171);

  dialog_action_area8 = GTK_DIALOG(PreferencesDialog)->action_area;
  gtk_widget_show(dialog_action_area8);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area8), GTK_BUTTONBOX_END);

  cancelbutton6 = gtk_button_new_from_stock("gtk-cancel");
  gtk_widget_show(cancelbutton6);
  gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), cancelbutton6, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS(cancelbutton6, GTK_CAN_DEFAULT);

  okbutton8 = gtk_button_new_from_stock("gtk-ok");
  gtk_widget_show(okbutton8);
  gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), okbutton8, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS(okbutton8, GTK_CAN_DEFAULT);

  g_signal_connect((gpointer) PreferencesDialog, "response",
                    G_CALLBACK(on_PreferencesDialog_response),
                    NULL);
  g_signal_connect((gpointer)StreamDirectoryButton, "clicked",
		   G_CALLBACK(on_stream_directory_clicked), 
		   PreferencesDialog);
  g_signal_connect((gpointer)ProfileDirectoryButton, "clicked",
		   G_CALLBACK(on_profile_directory_clicked), 
		   PreferencesDialog);

  g_signal_connect((gpointer)RawFileNameBrowse, "clicked",
		   G_CALLBACK(on_raw_file_clicked),
		   PreferencesDialog);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, PreferencesDialog, "PreferencesDialog");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_vbox9, "dialog_vbox9");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, GenericTable, "GenericTable");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label173, "label173");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, LogLevelSpinner, "LogLevelSpinner");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, DebugCheckButton, "DebugCheckButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label174, "label174");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryHbox, "StreamDirectoryHbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectory, "StreamDirectory");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryButton, "StreamDirectoryButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment24, "alignment24");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox84, "hbox84");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image24, "image24");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label175, "label175");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label176, "label176");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryHbox, "ProfileDirectoryHbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectory, "ProfileDirectory");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryButton, "ProfileDirectoryButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment25, "alignment25");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox86, "hbox86");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image25, "image25");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label177, "label177");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label169, "label169");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkVbox, "NetworkVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkTable, "NetworkTable");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label178, "label178");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label179, "label179");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, MulticastTtlMenu, "MulticastTtlMenu");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, menu16, "menu16");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_lan, "ttl_lan");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_organization, "ttl_organization");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_regional, "ttl_regional");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_worldwide, "ttl_worldwide");
  GLADE_HOOKUP_OBJECT (PreferencesDialog, MtuSpinButton, "MtuSpinButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, vbox39, "vbox39");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox89, "hbox89");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowRtcpCheck, "AllowRtcpCheck");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox87, "hbox87");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowSSMCheck, "AllowSSMCheck");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label170, "label170");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, MP4FileSettingsVbox, "MP4FileSettingsVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusFrame, "FileStatusFrame");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusVbox, "FileStatusVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox90, "hbox90");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus1, "FileStatus1");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox91, "hbox91");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus2, "FileStatus2");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox92, "hbox92");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus3, "FileStatus3");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label180, "label180");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox93, "hbox93");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordHintTrackButton, "RecordHintTrackButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox94, "hbox94");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, OptimizeMP4FileButton, "OptimizeMP4FileButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox95, "hbox95");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordRawDataButton, "RecordRawDataButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileName, "RawFileName");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileNameBrowse, "RawFileNameBrowse");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment26, "alignment26");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox96, "hbox96");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image26, "image26");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label181, "label181");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label171, "label171");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_action_area8, "dialog_action_area8");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, cancelbutton6, "cancelbutton6");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, okbutton8, "okbutton8");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, tooltips, "tooltips");

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(DebugCheckButton),
			       MyConfig->GetBoolValue(CONFIG_APP_DEBUG));

  const char *dir;
  char dirname[PATH_MAX];
  dir = MyConfig->GetStringValue(CONFIG_APP_STREAM_DIRECTORY);
  if (dir != NULL) {
    gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dir);
  } else {
    GetHomeDirectory(dirname);
    strcat(dirname, ".mp4live_d/Streams/");
    gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dirname);
  }
  dir = MyConfig->GetStringValue(CONFIG_APP_PROFILE_DIRECTORY);
  if (dir != NULL) {
    gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dir);
  } else {
    GetHomeDirectory(dirname);
    strcat(dirname, ".mp4live_d/");
    gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dirname);
  }

  uint ttl = MyConfig->GetIntegerValue(CONFIG_RTP_MCAST_TTL);
  uint index;
  if (ttl <= 1) {
    index = 0;
  } else if (ttl <= 15) {
    index = 1;
  } else if (ttl <= 64) {
    index = 2;
  } else 
    index = 3;
  gtk_option_menu_set_history(GTK_OPTION_MENU(MulticastTtlMenu), index);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowRtcpCheck),
			       MyConfig->GetBoolValue(CONFIG_RTP_NO_B_RR_0));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowSSMCheck),
			       MyConfig->GetBoolValue(CONFIG_RTP_USE_SSM));

  uint fstatus = MyConfig->GetIntegerValue(CONFIG_RECORD_MP4_FILE_STATUS);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus1),
			       fstatus == FILE_MP4_OVERWRITE);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus2),
			       fstatus == FILE_MP4_APPEND);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus3),
			       fstatus == FILE_MP4_CREATE_NEW);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordHintTrackButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_MP4_HINT_TRACKS));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OptimizeMP4FileButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_MP4_OPTIMIZE));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordRawDataButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_RAW_IN_MP4));
  gtk_entry_set_text(GTK_ENTRY(RawFileName), 
		     MyConfig->GetStringValue(CONFIG_RECORD_RAW_MP4_FILE_NAME));

  gtk_widget_show(PreferencesDialog);
}
Beispiel #12
0
int l_uslopp(int metka, //0-воод и корректировка 1-выбор
iceb_u_str *kod,iceb_u_str *naimk,GtkWidget *wpredok)
{
uslopp_data data;
char bros[512];
GdkColor color;
data.metka_rr=metka;

data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

//gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
//gdk_color_parse("black",&color);
//gtk_widget_modify_bg(data.window,GTK_STATE_NORMAL,&color);


sprintf(bros,"%s %s",name_system,gettext("Список приходных операций"));

gtk_window_set_title (GTK_WINDOW (data.window),bros);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(uslopp_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

data.label_kolstr=gtk_label_new (gettext("Список приходных операций"));


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.label_poisk=gtk_label_new ("");
/************
PangoFontDescription *font_pango=pango_font_description_from_string(shrift_ravnohir.ravno());
gtk_widget_modify_font(GTK_WIDGET(data.label_ost),font_pango);
pango_font_description_free(font_pango);
***************/

gdk_color_parse("red",&color);
gtk_widget_modify_fg(data.label_poisk,GTK_STATE_NORMAL,&color);

gtk_box_pack_start (GTK_BOX (vbox2),data.label_poisk,FALSE, FALSE, 0);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),-1,200);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_widget_show (data.sw);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];


sprintf(bros,"F2 %s",gettext("Ввести"));
data.knopka[FK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Ввод новой записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);

sprintf(bros,"%sF2 %s",RFK,gettext("Корректировать"));
data.knopka[SFK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK2],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK2]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[SFK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK2],data.knopka[SFK2],gettext("Корректировка выбранной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK2]),(gpointer)SFK2);
gtk_widget_show(data.knopka[SFK2]);

sprintf(bros,"F3 %s",gettext("Удалить"));
data.knopka[FK3]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK3],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK3]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[FK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK3],data.knopka[FK3],gettext("Удалить выбранную запись"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK3]),(gpointer)FK3);
gtk_widget_show(data.knopka[FK3]);

sprintf(bros,"%sF3 %s",RFK,gettext("Удалить"));
data.knopka[SFK3]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK3],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK3]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[SFK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK3],data.knopka[SFK3],gettext("Удалить неиспользуемые коды операций"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK3]),(gpointer)SFK3);
gtk_widget_show(data.knopka[SFK3]);

sprintf(bros,"F4 %s",gettext("Поиск"));
data.knopka[FK4]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK4],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Поиск нужных записей"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_widget_show(data.knopka[FK4]);

sprintf(bros,"F5 %s",gettext("Печать"));
data.knopka[FK5]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK5],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK5]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
tooltips[FK5]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK5],data.knopka[FK5],gettext("Распечатка записей"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK5]),(gpointer)FK5);
gtk_widget_show(data.knopka[FK5]);


sprintf(bros,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(uslopp_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);


gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));

gtk_widget_grab_focus(data.knopka[FK10]);

uslopp_create_list(&data);
gtk_widget_show(data.window);

if(metka == 0)
  gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));


gtk_main();


printf("l_uslopp end\n");
if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));
if(data.metka_voz == 0)
 if(metka == 1)
  {
   kod->new_plus(data.kodv.ravno());
   naimk->new_plus(data.naimv.ravno());
  }
return(data.metka_voz);

}
Beispiel #13
0
int l_klientr_bl(class iceb_u_str *databl,class iceb_u_str *grupa,GtkWidget *wpredok)
{
char strsql[500];
class l_klientr_bl_data data;


data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);


gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
//gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_widget_destroyed),&data.window);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_klientr_bl_key_press),&data);

if(wpredok->window != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *label;
sprintf(strsql,"%s",gettext("Блокировка карточек, по которым не было входов/выходов начиная с заданной даты"));

label=gtk_label_new(iceb_u_toutf(strsql));

sprintf(strsql,"%s %s",name_system,gettext("Блокировка неактивных карточек"));

gtk_window_set_title(GTK_WINDOW(data.window),strsql);

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[G_KOLENTER+1];
for(int i=0 ; i < G_KOLENTER+1; i++)
  hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0 ; i < G_KOLENTER+1; i++)
 gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);
gtk_container_add (GTK_CONTAINER (vbox), hboxknop);

GtkTooltips *tooltips_enter[G_KOLENTER];

sprintf(strsql,"%s",gettext("Дата"));
data.knopka_enter[E_DATABL]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_DATABL]), data.knopka_enter[E_DATABL], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_DATABL]),"clicked",GTK_SIGNAL_FUNC(l_klientr_bl_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_DATABL]),(gpointer)E_DATABL);
tooltips_enter[E_DATABL]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_DATABL],data.knopka_enter[E_DATABL],gettext("Выбор даты"),NULL);

data.entry[E_DATABL] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_DATABL]), data.entry[E_DATABL], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_DATABL]), "activate",GTK_SIGNAL_FUNC(l_klientr_bl_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_DATABL]),data.databl.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_DATABL]),(gpointer)E_DATABL);


sprintf(strsql,"%s (,,)",gettext("Коды групп, карточки которых блокировать ненадо"));
data.knopka_enter[E_KODGR]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KODGR]), data.knopka_enter[E_KODGR], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KODGR]),"clicked",GTK_SIGNAL_FUNC(l_klientr_bl_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KODGR]),(gpointer)E_KODGR);
tooltips_enter[E_KODGR]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KODGR],data.knopka_enter[E_KODGR],gettext("Выбор группы"),NULL);

data.entry[E_KODGR] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox[E_KODGR]), data.entry[E_KODGR], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KODGR]), "activate",GTK_SIGNAL_FUNC(l_klientr_bl_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KODGR]),data.kodgr.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KODGR]),(gpointer)E_KODGR);




GtkTooltips *tooltips[G_KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Блокировка"));
data.knopka[GFK2]=gtk_button_new_with_label(strsql);
tooltips[GFK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[GFK2],data.knopka[GFK2],gettext("Начать блокировку"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[GFK2]),"clicked",GTK_SIGNAL_FUNC(l_klientr_bl_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[GFK2]),(gpointer)GFK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[GFK2], TRUE, TRUE, 0);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[GFK10]=gtk_button_new_with_label(strsql);
tooltips[GFK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[GFK10],data.knopka[GFK10],gettext("Завершение работы с меню"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[GFK10]),"clicked",GTK_SIGNAL_FUNC(l_klientr_bl_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[GFK10]),(gpointer)GFK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[GFK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);

gtk_main();

if(wpredok->window != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

if(data.voz == 0)
 {
  databl->new_plus(data.databl.ravno());
  grupa->new_plus(data.kodgr.ravno());
 }
return(data.voz);
}
Beispiel #14
0
int kzvmu2(short dd,short md,short gd,int skl,
const char *nomdok,int kodm,int nk,
int sklad1,
const char *nomdokp,
GtkWidget *wpredok)
{
char strsql[512];
class kzvmu2_data data;
iceb_u_str kikz;
iceb_u_str naim_mat;
SQLCURSOR cur;
SQL_str   row;
iceb_u_str repl;
//char bros[512];

//iceb_poldan("Н.Д.С.",bros,"matnast.alx",wpredok);
//float pnds=iceb_u_atof(bros);
float pnds=iceb_pnds(dd,md,gd,wpredok);

data.dd=dd;
data.md=md;
data.gd=gd;
data.sklad=skl;
data.kodm=kodm;
data.nom_kar=nk;
data.nomdok.plus(nomdok);
data.sklad1=sklad1;
data.nomdokp.plus(nomdokp);
naim_mat.plus("");

sprintf(strsql,"select naimat from Material where kodm=%d",kodm);
if(iceb_sql_readkey(strsql,&row,&cur,wpredok) == 1)
  naim_mat.new_plus(row[0]); 


sprintf(strsql,"select kolih,cena,shet,nomz,ktoi,vrem,nomkarp from Dokummat1 where \
sklad=%d and nomd='%s' and kodm=%d and nomkar=%d and datd='%04d-%02d-%02d' \
and tipz=2",skl,nomdok,kodm,nk,gd,md,dd);
if(iceb_sql_readkey(strsql,&row,&cur,wpredok) < 1)
 {
  repl.new_plus(gettext("Не найдена запись для корректировки !"));
  repl.ps_plus(strsql);
  iceb_menu_soob(&repl,wpredok);
  return(1);
 }

data.kolihz=atof(row[0]);
sprintf(strsql,"%.10g",data.kolihz);

data.kolih.plus(strsql);

data.shet.plus(row[2]);
data.nomerzak.plus(row[3]);
double cena=atof(row[1]);
sprintf(strsql,"%.10g",cena);

data.cenabnds.plus(strsql);

cena=cena+cena*pnds/100.;
cena=iceb_u_okrug(cena,okrg1);
sprintf(strsql,"%.10g",cena);
data.cenasnds.plus(strsql);

kikz.plus(iceb_kikz(row[4],row[5],wpredok));   
data.nomkarp=atoi(row[6]);



data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);


sprintf(strsql,"%s %s",name_system,gettext("Корректировка выбранной записи"));

gtk_window_set_title (GTK_WINDOW (data.window),strsql);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(kzvmu2_v_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }
repl.new_plus(gettext("Корректировка выбранной записи"));

repl.ps_plus(gettext("Материал"));
repl.plus(":");
repl.plus(kodm);
repl.plus(" ");
repl.plus(naim_mat.ravno());
if(kikz.getdlinna() > 1)
 repl.ps_plus(kikz.ravno());

GtkWidget *label=gtk_label_new(repl.ravno_toutf());


GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
  hbox[i] = gtk_hbox_new (FALSE, 0);

GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);


gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);

for(int i=0; i < KOLENTER; i++)
  gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);

gtk_container_add (GTK_CONTAINER (vbox), hboxknop);

sprintf(strsql,"%s",gettext("Количество"));
label=gtk_label_new(iceb_u_toutf(strsql));
data.entry[E_KOLIH] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_KOLIH]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_KOLIH]), data.entry[E_KOLIH], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOLIH]), "activate",GTK_SIGNAL_FUNC(kzvmu2_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOLIH]),data.kolih.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOLIH]),(gpointer)E_KOLIH);

sprintf(strsql,"%s",gettext("Цена с НДС"));
label=gtk_label_new(iceb_u_toutf(strsql));
data.entry[E_CENASNDS] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_CENASNDS]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_CENASNDS]), data.entry[E_CENASNDS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_CENASNDS]), "activate",GTK_SIGNAL_FUNC(kzvmu2_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_CENASNDS]),data.cenasnds.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_CENASNDS]),(gpointer)E_CENASNDS);


sprintf(strsql,"%s",gettext("Цена без НДС"));
label=gtk_label_new(iceb_u_toutf(strsql));
data.entry[E_CENABNDS] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_CENABNDS]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_CENABNDS]), data.entry[E_CENABNDS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_CENABNDS]), "activate",GTK_SIGNAL_FUNC(kzvmu2_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_CENABNDS]),data.cenabnds.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_CENABNDS]),(gpointer)E_CENABNDS);

sprintf(strsql,"%s",gettext("Счёт"));
label=gtk_label_new(iceb_u_toutf(strsql));
data.entry[E_SHET] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_SHET]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_SHET]), data.entry[E_SHET], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_SHET]), "activate",GTK_SIGNAL_FUNC(kzvmu2_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_SHET]),data.shet.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_SHET]),(gpointer)E_SHET);

sprintf(strsql,"%s",gettext("Номер заказа"));
label=gtk_label_new(iceb_u_toutf(strsql));
data.entry[E_NOMERZAK] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_NOMERZAK]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_NOMERZAK]), data.entry[E_NOMERZAK], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_NOMERZAK]), "activate",GTK_SIGNAL_FUNC(kzvmu2_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_NOMERZAK]),data.nomerzak.ravno_toutf());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_NOMERZAK]),(gpointer)E_NOMERZAK);

GtkTooltips *tooltips[KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Записать"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Записать введенную в меню информацию"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(kzvmu2_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(kzvmu2_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);


gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.voz);
}
Beispiel #15
0
static void messageview_show_cb(GObject *obj, gpointer msgview,
				MsgInfo *msginfo, gboolean all_headers)
{
  MessageView *messageview;
  HeaderView *headerview;
  GtkWidget *hbox;
  gchar *msg_path;
  GtkWidget *copy_btn;
  GdkPixbuf* pbuf;
  GtkWidget* image;
  GtkTooltips *tip;
  GList* wl;
  gint i;
  gboolean bfound = FALSE;
  gpointer gdata;

  
#if DEBUG
  g_print("[DEBUG] test: %p: messageview_show (%p), all_headers: %d: %s\n",
	  obj, msgview, all_headers,
	  msginfo && msginfo->subject ? msginfo->subject : "");
#endif
  
  if (!msgview) {
    g_print("[DEBUG] msgview is NULL\n");
    return;
  }

  messageview = (MessageView*)msgview;
  if (!messageview) {
    g_print("[DEBUG] messageview is NULL\n");
    return;
  }

  headerview = messageview->headerview;
  if (!headerview) {
    g_print("[DEBUG] headerview is NULL\n");
    return;
  }
  
  hbox = headerview->hbox;
  if (!hbox) {
    g_print("[DEBUG] hbox is NULL\n");
    return;
  }

  wl = gtk_container_get_children(GTK_CONTAINER(hbox));

  i = g_list_length(wl)-1;

  /* search recently added GtkImage */
  while (i >= 0) {
    gdata = g_list_nth_data(wl, i);
    if (GTK_IS_BUTTON(gdata) && gdata != headerview->image) {
      /* remove from hbox */
      g_print("[DEBUG] GTK_IS_BUTTON %p\n", gdata);
#if DEBUG
      g_print("[DEBUG] remove button: %p\n", gicon);
#endif
      gtk_container_remove(GTK_CONTAINER(hbox), GTK_WIDGET(gdata));
    }
    i--;
  }


  msg_path = procmsg_get_message_file_path(msginfo);
                    

  debug_print("[DEBUG] msg_path:%s\n", msg_path);


  if (bfound != TRUE){
    copy_btn = gtk_button_new_from_stock(GTK_STOCK_FILE);
    gtk_box_pack_end(GTK_BOX(hbox), copy_btn, FALSE, FALSE, 0);

    pbuf = gdk_pixbuf_new_from_xpm_data((const char**)page_save);
    image = gtk_image_new_from_pixbuf(pbuf);
    
    gtk_button_set_image(GTK_BUTTON(copy_btn), image);
    gtk_button_set_label(GTK_BUTTON(copy_btn), "");

    tip = gtk_tooltips_new();
    gtk_tooltips_set_tip(tip, copy_btn, _("Copy this mail to clipboard."), NULL);

    g_signal_connect(G_OBJECT(copy_btn), "clicked",
		     G_CALLBACK(copy_btn_clicked), msginfo);
    
    gtk_widget_show(image);
    gtk_widget_show_all(copy_btn);

    debug_print("[DEBUG] copy mail to clipboard icon: %p\n", copy_btn);

  }

}
Beispiel #16
0
int vvod_tabnom(class iceb_u_str *tabnom,GtkWidget *wpredok)
{
char strsql[512];
class vvod_tabnom_data data;

//printf("vvod_tabnom\n");
    
data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);
gtk_window_set_resizable(GTK_WINDOW(data.window),FALSE); /*запрет на изменение размеров окна*/


gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
//gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_widget_destroyed),&data.window);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(vvod_tabnom_key_press),&data);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *label;
sprintf(strsql,"%s %s",name_system,gettext("Ввод табельного номера"));
gtk_window_set_title(GTK_WINDOW(data.window),strsql);

label=gtk_label_new(gettext("Введите табельный номер"));


GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER+1];
for(int i=0 ; i < KOLENTER+1; i++)
  hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0 ; i < KOLENTER+1; i++)
 gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);
gtk_container_add (GTK_CONTAINER (vbox), hboxknop);


data.knopka_enter[E_TABNOM]=gtk_button_new_with_label(gettext("Табельный номер"));
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.knopka_enter[E_TABNOM], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_TABNOM]),"clicked",GTK_SIGNAL_FUNC(vvod_tabnom_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_TABNOM]),(gpointer)E_TABNOM);
GtkTooltips *tooltips_k=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_k,data.knopka_enter[E_TABNOM],gettext("Выбор табельного номера."),NULL);


data.entry[E_TABNOM] = gtk_entry_new_with_max_length (11);
gtk_box_pack_start (GTK_BOX (hbox[E_TABNOM]), data.entry[E_TABNOM], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_TABNOM]), "activate",GTK_SIGNAL_FUNC(vvod_tabnom_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_TABNOM]),"");
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_TABNOM]),(gpointer)E_TABNOM);



GtkTooltips *tooltips[KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Ввод"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Запись введеной в меню информации."),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(vvod_tabnom_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK2], TRUE, TRUE, 0);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы с меню без записи введенной информации."),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(vvod_tabnom_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);

gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

if(data.voz == 0)
 tabnom->new_plus(data.tabnom.ravno());

return(data.voz);
}
Beispiel #17
0
void l_prov_usl(short dd,short md,short gd,
int podr,
int tipz,
const char *nomdok,
const char *nomdokp,
const char *kontr,
const char *kodop,
int lnds,
double sumad,//Сумма по документа
double sumkor, //Сумма корректировки к документа
float pnds,
GtkWidget *wpredok)
{
class prov_usl_data data;
char strsql[512];
SQL_str row;
SQLCURSOR cur;
iceb_u_str shet_suma;
sprintf(data.imaf_prot,"uslpr%d.tmp",getpid());

prosprusw(1,podr,dd,md,gd,nomdok,tipz,lnds,kodop,pnds,NULL,wpredok);
prosprusw(2,podr,dd,md,gd,nomdok,tipz,lnds,kodop,pnds,&shet_suma,wpredok);

data.tipz=tipz;
data.dd=dd;
data.md=md;
data.gd=gd;
data.nomdok.plus(nomdok);
data.podr=podr;
strcpy(data.metkasys,gettext("УСЛ"));
data.kontr.plus(kontr);
data.kodop.plus(kodop);
data.lnds=lnds;
data.nomdokp.plus(nomdokp);
data.sumkor=sumkor;
data.pnds=pnds;

//Читаем наименование склада
sprintf(strsql,"select naik from Sklad where kod=%d",podr);
if(iceb_sql_readkey(strsql,&row,&cur,wpredok) == 1)
 data.naim_podr.new_plus(row[0]);

//Читаем наименование операции
if(tipz == 1)
  sprintf(strsql,"select naik from Usloper1 where kod='%s'",kodop);
if(tipz == 2)
  sprintf(strsql,"select naik from Usloper2 where kod='%s'",kodop);
if(iceb_sql_readkey(strsql,&row,&cur,wpredok) == 1)
 data.naim_kodop.new_plus(row[0]);

//Читаем наименование контрагента
sprintf(strsql,"select naikon from Kontragent where kodkon='%s'",kontr);
if(iceb_sql_readkey(strsql,&row,&cur,wpredok) == 1)
 data.naim_kontr.new_plus(row[0]);


data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

sprintf(strsql,"%s %s",name_system,
gettext("Работа с проводками (учёт услуг)"));

gtk_window_set_title (GTK_WINDOW (data.window),iceb_u_toutf(strsql));
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(prov_usl_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

data.label_sheta=gtk_label_new (shet_suma.ravno_toutf());
PangoFontDescription *font_pango=pango_font_description_from_string(shrift_ravnohir.ravno());
gtk_widget_modify_font(GTK_WIDGET(data.label_sheta),font_pango);
pango_font_description_free(font_pango);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),data.label_sheta,FALSE, FALSE, 0);
gtk_widget_show_all(hbox);

data.label_kolstr=gtk_label_new ("");

iceb_u_str stroka;

prov_usl_sapka_menu(&data);



gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);


data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

GtkWidget *hboxradio = gtk_hbox_new (TRUE, 0);

//Вставляем радиокнопки
GSList *group;

data.radiobutton[0]=gtk_radio_button_new_with_label(NULL,gettext("Дебет"));
//  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data.radiobutton[0]),TRUE); //Устанавливем активной кнопку
gtk_box_pack_start (GTK_BOX (hboxradio),data.radiobutton[0], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.radiobutton[0]), "clicked",GTK_SIGNAL_FUNC(prov_usl_radio0),&data);
//gtk_object_set_user_data(GTK_OBJECT(data.radiobutton0),(gpointer)"0");

group=gtk_radio_button_group(GTK_RADIO_BUTTON(data.radiobutton[0]));

sprintf(strsql,"%s",gettext("Кредит"));
data.radiobutton[1]=gtk_radio_button_new_with_label(group,strsql);
//  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data.radiobutton[1]),TRUE); //Устанавливем активной кнопку
gtk_signal_connect(GTK_OBJECT(data.radiobutton[1]), "clicked",GTK_SIGNAL_FUNC(prov_usl_radio1),&data);
gtk_box_pack_start (GTK_BOX (hboxradio),data.radiobutton[1], TRUE, TRUE, 0);

group=gtk_radio_button_group(GTK_RADIO_BUTTON(data.radiobutton[1]));

sprintf(strsql,"%s",gettext("Все"));
data.radiobutton[2]=gtk_radio_button_new_with_label(group,strsql);
//  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data.radiobutton[2]),TRUE); //Устанавливем активной кнопку
gtk_signal_connect(GTK_OBJECT(data.radiobutton[2]), "clicked",GTK_SIGNAL_FUNC(prov_usl_radio2),&data);
gtk_box_pack_start (GTK_BOX (hboxradio),data.radiobutton[2], TRUE, TRUE, 0);

gtk_box_pack_start(GTK_BOX (vbox2), hboxradio, FALSE,FALSE, 0);
gtk_widget_show_all(hboxradio);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];

sprintf(strsql,"F2 %s",gettext("Ввести"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2],TRUE,TRUE, 0);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Ввод новой проводки"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);

sprintf(strsql,"%sF2 %s",RFK,gettext("Корректировать"));
data.knopka[SFK2]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK2]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK2],TRUE,TRUE, 0);
tooltips[SFK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK2],data.knopka[SFK2],gettext("Корректировка выбранной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK2]),(gpointer)SFK2);
gtk_widget_show(data.knopka[SFK2]);

sprintf(strsql,"F3 %s",gettext("Удалить"));
data.knopka[FK3]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK3]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK3],TRUE,TRUE, 0);
tooltips[FK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK3],data.knopka[FK3],gettext("Удалить выбранную запись"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK3]),(gpointer)FK3);
gtk_widget_show(data.knopka[FK3]);

sprintf(strsql,"%sF3 %s",RFK,gettext("Удалить"));
data.knopka[SFK3]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK3]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK3],TRUE,TRUE, 0);
tooltips[SFK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK3],data.knopka[SFK3],gettext("Удалить все проводки"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK3]),(gpointer)SFK3);
gtk_widget_show(data.knopka[SFK3]);

sprintf(strsql,"F4 %s",gettext("Проводки"));
data.knopka[FK4]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK4],TRUE,TRUE, 0);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Автоматическое выполнение проводок с использованием табличной настройки"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_widget_show(data.knopka[FK4]);

sprintf(strsql,"%sF4 %s",RFK,gettext("Просмотр"));
data.knopka[SFK4]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK4]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK4],TRUE,TRUE, 0);
tooltips[SFK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK4],data.knopka[SFK4],gettext("Просмотр протокола хода автоматичного виконання проводок"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK4]),(gpointer)SFK4);
gtk_widget_show(data.knopka[SFK4]);

sprintf(strsql,"F5 %s",gettext("Настройка"));
data.knopka[FK5]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK5],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK5]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
tooltips[FK5]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK5],data.knopka[FK5],gettext("Насторойка автоматического выполнения проводок"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK5]),(gpointer)FK5);
gtk_widget_show(data.knopka[FK5]);

sprintf(strsql,"%sF5 %s",RFK,gettext("Печать"));
data.knopka[SFK5]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK5],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK5]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
tooltips[SFK5]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK5],data.knopka[SFK5],gettext("Распечатка проводок"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK5]),(gpointer)SFK5);
gtk_widget_show(data.knopka[SFK5]);

sprintf(strsql,"F6 %s",gettext("Проводки"));
data.knopka[FK6]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK6]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK6],TRUE,TRUE, 0);
tooltips[FK6]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK6],data.knopka[FK6],gettext("Автоматическое выполнение проводок с использованием списка настройки"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK6]),(gpointer)FK6);
gtk_widget_show(data.knopka[FK6]);

sprintf(strsql,"F9 %s",gettext("Оплата"));
data.knopka[FK9]=gtk_button_new_with_label(strsql);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK9]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK9],TRUE,TRUE, 0);
tooltips[FK9]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK9],data.knopka[FK9],gettext("Переход в режим ввода и корректировки оплат к документу"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK9]),(gpointer)FK9);
gtk_widget_show(data.knopka[FK9]);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(prov_usl_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);

gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));

gtk_widget_grab_focus(data.knopka[FK10]);

prov_usl_create_list(&data);

//gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));
gtk_widget_show(data.window);


gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));


}
Beispiel #18
0
ConfigDialog *config_dialog_new(void)
{
	ConfigDialog *config_win;
	GtkTooltips *tooltips;

	GtkWidget *window_main;
	GtkWidget *vbox_main;
	GtkWidget *label_scale_factor;
	GtkWidget *hscale_scale_factor;
	GtkWidget *frame_general;
	GtkWidget *table_general;
	GtkWidget *label_effect;
	GtkWidget *label_palette;
	GtkWidget *label_fps;
	GtkWidget *checkbutton_show_title;
	GtkWidget *hscale_effect;
	GtkWidget *hscale_palette;
	GtkObject *spinbutton_fps_adj;
	GtkWidget *spinbutton_fps;
	GtkWidget *hbuttonbox_main;
	GtkWidget *button_ok;
	GtkWidget *button_cancel;
	GtkWidget *button_apply;

#if ENABLE_NLS
	setlocale(LC_MESSAGES, "");
	bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
	textdomain(GETTEXT_PACKAGE);
#endif

	window_main = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_object_set_data(GTK_OBJECT(window_main), "window_main", window_main);
	gtk_window_set_title(GTK_WINDOW(window_main), _("Infinity Configuration"));
	gtk_window_set_type_hint(GTK_WINDOW(window_main), GDK_WINDOW_TYPE_HINT_DIALOG);

	vbox_main = gtk_vbox_new(FALSE, 0);
	gtk_widget_ref(vbox_main);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "vbox_main", vbox_main,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(vbox_main);
	gtk_container_add(GTK_CONTAINER(window_main), vbox_main);
	gtk_container_set_border_width(GTK_CONTAINER(vbox_main), 2);

	frame_general = gtk_frame_new(_("Parameters"));
	gtk_widget_ref(frame_general);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "frame_general", frame_general,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(frame_general);
	gtk_box_pack_start(GTK_BOX(vbox_main), frame_general, TRUE, TRUE, 0);
	gtk_container_set_border_width(GTK_CONTAINER(frame_general), 2);

	table_general = gtk_table_new(5, 3, FALSE);
	gtk_widget_ref(table_general);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "table_general", table_general,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(table_general);
	gtk_container_add(GTK_CONTAINER(frame_general), table_general);
	gtk_container_set_border_width(GTK_CONTAINER(table_general), 2);
	gtk_table_set_row_spacings(GTK_TABLE(table_general), 2);
	gtk_table_set_col_spacings(GTK_TABLE(table_general), 2);

	label_effect = gtk_label_new(_("Effect period:"));
	gtk_widget_ref(label_effect);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "label_effect", label_effect,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(label_effect);
	gtk_table_attach(GTK_TABLE(table_general), label_effect, 0, 1, 0, 1,
			 (GtkAttachOptions)(GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label_effect), 0, 0.5);
	gtk_misc_set_padding(GTK_MISC(label_effect), 1, 0);

	label_palette = gtk_label_new(_("Palette period:"));
	gtk_widget_ref(label_palette);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "label_palette", label_palette,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(label_palette);
	gtk_table_attach(GTK_TABLE(table_general), label_palette, 0, 1, 1, 2,
			 (GtkAttachOptions)(GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label_palette), 0, 0.5);
	gtk_misc_set_padding(GTK_MISC(label_palette), 1, 0);

	label_scale_factor = gtk_label_new(_("Scale Factor"));
	gtk_widget_ref(label_scale_factor);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "label_scale_factor", label_scale_factor,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(label_scale_factor);
	gtk_table_attach(GTK_TABLE(table_general), label_scale_factor, 0, 1, 2, 3,
			 (GtkAttachOptions)(GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label_scale_factor), 0, 0.5);
	gtk_misc_set_padding(GTK_MISC(label_scale_factor), 1, 0);

	label_fps = gtk_label_new(_("Maximum Frames per Second:"));
	gtk_widget_ref(label_fps);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "label_fps", label_fps,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(label_fps);
	gtk_table_attach(GTK_TABLE(table_general), label_fps, 0, 1, 3, 4,
			 (GtkAttachOptions)(GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label_fps), 0, 0.5);
	gtk_misc_set_padding(GTK_MISC(label_fps), 1, 0);

	checkbutton_show_title = gtk_check_button_new_with_label(_("Show current play title"));
	gtk_widget_ref(checkbutton_show_title);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "checkbutton_show_title", checkbutton_show_title,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(checkbutton_show_title);
	gtk_table_attach(GTK_TABLE(table_general), checkbutton_show_title, 0, 1, 4, 5,
			 (GtkAttachOptions)(GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);

	tooltips = gtk_tooltips_new();
	gtk_tooltips_set_tip(tooltips, checkbutton_show_title,
			     _("Check it if you want to see the current play "
			       "title on the Infinity's title bar"), NULL);

	//spinbutton_fps_adj = gtk_adjustment_new (30, 5, 150, 1, 10, 0);
	spinbutton_fps_adj = gtk_adjustment_new(config_get_fps(), 5, 150, 1, 10, 0);
	spinbutton_fps = gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_fps_adj), 1, 0);
	gtk_widget_ref(spinbutton_fps);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "spinbutton_fps", spinbutton_fps,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(spinbutton_fps);
	gtk_table_attach(GTK_TABLE(table_general), spinbutton_fps, 2, 3, 3, 4,
			 (GtkAttachOptions)(0),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spinbutton_fps), GTK_UPDATE_IF_VALID);

	hscale_effect = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(100, 50, 400, 0, 0, 0)));
	gtk_widget_ref(hscale_effect);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "hscale_effect", hscale_effect,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(hscale_effect);
	gtk_table_attach(GTK_TABLE(table_general), hscale_effect, 1, 3, 0, 1,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_scale_set_value_pos(GTK_SCALE(hscale_effect), GTK_POS_LEFT);
	gtk_scale_set_digits(GTK_SCALE(hscale_effect), 0);

	gtk_tooltips_set_tip(tooltips, hscale_effect,
			     _("Time to change between an effect and the "
			       "next one, in milliseconds."), NULL);

	hscale_palette = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(100, 50, 400, 0, 0, 0)));
	gtk_widget_ref(hscale_palette);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "hscale_palette", hscale_palette,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(hscale_palette);
	gtk_table_attach(GTK_TABLE(table_general), hscale_palette, 1, 3, 1, 2,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_scale_set_value_pos(GTK_SCALE(hscale_palette), GTK_POS_LEFT);
	gtk_scale_set_digits(GTK_SCALE(hscale_palette), 0);

	gtk_tooltips_set_tip(tooltips, hscale_palette,
			     _("Time to change between a color and the "
			       "next one, in milliseconds."), NULL);

	hscale_scale_factor = gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(1, 1, 2, 0, 0, 0)));
	gtk_widget_ref(hscale_scale_factor);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "hscale_scale_factor", hscale_scale_factor,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(hscale_scale_factor);
	gtk_table_attach(GTK_TABLE(table_general), hscale_scale_factor, 1, 3, 2, 3,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)(0), 0, 0);
	gtk_scale_set_value_pos(GTK_SCALE(hscale_scale_factor), GTK_POS_LEFT);
	gtk_scale_set_digits(GTK_SCALE(hscale_scale_factor), 0);

	gtk_tooltips_set_tip(tooltips, hscale_scale_factor,
			     _("Change only if the system doesn't have "
			       "enough power to show the screen at "
			       "a reasonably speed/size relation."), NULL);

	hbuttonbox_main = gtk_hbutton_box_new();
	gtk_widget_ref(hbuttonbox_main);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "hbuttonbox_main", hbuttonbox_main,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(hbuttonbox_main);
	gtk_box_pack_start(GTK_BOX(vbox_main), hbuttonbox_main, FALSE, TRUE, 0);
	gtk_container_set_border_width(GTK_CONTAINER(hbuttonbox_main), 2);
	gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox_main), GTK_BUTTONBOX_END);

	button_ok = gtk_button_new_with_label(_("Ok"));
	gtk_widget_ref(button_ok);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "button_ok", button_ok,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(button_ok);
	gtk_container_add(GTK_CONTAINER(hbuttonbox_main), button_ok);
	GTK_WIDGET_SET_FLAGS(button_ok, GTK_CAN_DEFAULT);

	gtk_tooltips_set_tip(tooltips, button_ok,
			     _("For to toggle to fullscreen mode, select "
			       "the Infinity plugin window, and press "
			       "the Tab key. Pressing Tab again will return "
			       "to window mode."), NULL);

	button_cancel = gtk_button_new_with_label(_("Cancel"));
	gtk_widget_ref(button_cancel);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "button_cancel", button_cancel,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(button_cancel);
	gtk_container_add(GTK_CONTAINER(hbuttonbox_main), button_cancel);
	GTK_WIDGET_SET_FLAGS(button_cancel, GTK_CAN_DEFAULT);

	button_apply = gtk_button_new_with_label(_("Apply"));
	gtk_widget_ref(button_apply);
	gtk_object_set_data_full(GTK_OBJECT(window_main), "button_apply", button_apply,
				 (GtkDestroyNotify)gtk_widget_unref);
	gtk_widget_show(button_apply);
	gtk_container_add(GTK_CONTAINER(hbuttonbox_main), button_apply);
	GTK_WIDGET_SET_FLAGS(button_apply, GTK_CAN_DEFAULT);

	gtk_widget_grab_default(button_cancel);

	config_win = g_new0(ConfigDialog, 1);

	config_win->window_main = window_main;

	config_win->hscale_effect = hscale_effect;
	config_win->hscale_palette = hscale_palette;
	config_win->hscale_scale_factor = hscale_scale_factor;
	config_win->spinbutton_fps = spinbutton_fps;
	config_win->checkbutton_show_title = checkbutton_show_title;

	config_win->button_ok = button_ok;
	config_win->button_cancel = button_cancel;
	config_win->button_apply = button_apply;

	gtk_tooltips_enable(tooltips);

	return config_win;
}
GtkWidget *
sp_find_types ()
{
    GtkTooltips *tt = gtk_tooltips_new ();

    GtkWidget *vb = gtk_vbox_new (FALSE, 4);
    gtk_widget_show (vb);

    {
        GtkWidget *hb = gtk_hbox_new (FALSE, 0);
        gtk_widget_show (hb);

        {
            GtkWidget *l = gtk_label_new_with_mnemonic (_("T_ype: "));
            gtk_widget_show (l);
            gtk_widget_set_size_request (l, FIND_LABELWIDTH, -1);
            gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5);
            gtk_box_pack_start (GTK_BOX (hb), l, FALSE, FALSE, 0);
        }

        GtkWidget *alltypes = sp_find_types_checkbox (vb, "all", TRUE, tt, _("Search in all object types"), _("All types"), toggle_alltypes);
        gtk_box_pack_start (GTK_BOX (hb), alltypes, FALSE, FALSE, 0);

        gtk_box_pack_start (GTK_BOX (vb), hb, FALSE, FALSE, 0);
    }

    {
        GtkWidget *vb_all = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vb_all);

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "shapes", FALSE, tt, _("Search all shapes"), _("All shapes"), toggle_shapes, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }


        {
            GtkWidget *hb = gtk_hbox_new (FALSE, 0);
            gtk_widget_show (hb);

            { // empty label for alignment
                GtkWidget *l = gtk_label_new ("");
                gtk_widget_show (l);
                gtk_widget_set_size_request (l, FIND_LABELWIDTH + 20, -1);
                gtk_box_pack_start (GTK_BOX (hb), l, FALSE, FALSE, 0);
            }

            {
                GtkWidget *c = sp_find_types_checkbox (vb, "rects", FALSE, tt, _("Search rectangles"), _("Rectangles"), NULL);
                gtk_box_pack_start (GTK_BOX (hb), c, FALSE, FALSE, 0);
            }

            {
                GtkWidget *c = sp_find_types_checkbox (vb, "ellipses", FALSE, tt, _("Search ellipses, arcs, circles"), _("Ellipses"), NULL);
                gtk_box_pack_start (GTK_BOX (hb), c, FALSE, FALSE, 0);
            }

            {
                GtkWidget *c = sp_find_types_checkbox (vb, "stars", FALSE, tt, _("Search stars and polygons"), _("Stars"), NULL);
                gtk_box_pack_start (GTK_BOX (hb), c, FALSE, FALSE, 0);
            }

            {
                GtkWidget *c = sp_find_types_checkbox (vb, "spirals", FALSE, tt, _("Search spirals"), _("Spirals"), NULL);
                gtk_box_pack_start (GTK_BOX (hb), c, FALSE, FALSE, 0);
            }

            gtk_object_set_data (GTK_OBJECT (vb), "shapes-pane", hb);

            gtk_box_pack_start (GTK_BOX (vb_all), hb, FALSE, FALSE, 0);
            gtk_widget_hide_all (hb);
        }

        {
            // TRANSLATORS: polyline is a set of connected straight line segments
            // http://www.w3.org/TR/SVG11/shapes.html#PolylineElement
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "paths", TRUE, tt, _("Search paths, lines, polylines"), _("Paths"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "texts", TRUE, tt, _("Search text objects"), _("Texts"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "groups", TRUE, tt, _("Search groups"), _("Groups"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "clones", TRUE, tt, _("Search clones"),
            		//TRANSLATORS: Translate the word "Clones" only. A noun indicating type of object to find
            		Q_("find|Clones"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "images", TRUE, tt, _("Search images"), _("Images"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        {
            GtkWidget *c = sp_find_types_checkbox_indented (vb, "offsets", TRUE, tt, _("Search offset objects"), _("Offsets"), NULL, 10);
            gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
        }

        gtk_box_pack_start (GTK_BOX (vb), vb_all, FALSE, FALSE, 0);
        gtk_object_set_data (GTK_OBJECT (vb), "all-pane", vb_all);
        gtk_widget_hide_all (vb_all);
    }

    return vb;
}
Beispiel #20
0
static GtkWidget *
create_window (int confirm_mode)
{
  GtkWidget *w;
  GtkWidget *win, *box;
  GtkWidget *wvbox, *chbox, *bbox;
  GtkAccelGroup *acc;
  gchar *msg;

  tooltips = gtk_tooltips_new ();

  /* FIXME: check the grabbing code against the one we used with the
     old gpg-agent */
  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  acc = gtk_accel_group_new ();

  g_signal_connect (G_OBJECT (win), "delete_event",
		    G_CALLBACK (delete_event), NULL);

#if 0
  g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (gtk_main_quit),
		    NULL);
#endif
  g_signal_connect (G_OBJECT (win), "size-request",
		    G_CALLBACK (constrain_size), NULL);
  if (!confirm_mode)
    {
      if (pinentry->grab)
	g_signal_connect (G_OBJECT (win),
			  "realize", G_CALLBACK (make_transient), NULL);

      /* We need to grab the keyboard when its visible! not when its
         mapped (there is a difference)  */
      g_object_set (G_OBJECT(win), "events",
                    GDK_VISIBILITY_NOTIFY_MASK | GDK_STRUCTURE_MASK, NULL);

      g_signal_connect (G_OBJECT (win),
			pinentry->grab
                        ? "visibility-notify-event"
                        : "focus-in-event",
			G_CALLBACK (grab_keyboard), NULL);
      g_signal_connect (G_OBJECT (win),
			pinentry->grab ? "unmap-event" : "focus-out-event",
			G_CALLBACK (ungrab_keyboard), NULL);
    }
  gtk_window_add_accel_group (GTK_WINDOW (win), acc);

  wvbox = gtk_vbox_new (FALSE, HIG_LARGE * 2);
  gtk_container_add (GTK_CONTAINER (win), wvbox);
  gtk_container_set_border_width (GTK_CONTAINER (wvbox), HIG_LARGE);

  chbox = gtk_hbox_new (FALSE, HIG_LARGE);
  gtk_box_pack_start (GTK_BOX (wvbox), chbox, FALSE, FALSE, 0);

  w = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
					       GTK_ICON_SIZE_DIALOG);
  gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.0);
  gtk_box_pack_start (GTK_BOX (chbox), w, FALSE, FALSE, 0);

  box = gtk_vbox_new (FALSE, HIG_SMALL);
  gtk_box_pack_start (GTK_BOX (chbox), box, TRUE, TRUE, 0);

  if (pinentry->title)
    {
      msg = pinentry_utf8_validate (pinentry->title);
      gtk_window_set_title (GTK_WINDOW(win), msg);
    }
  if (pinentry->description)
    {
      msg = pinentry_utf8_validate (pinentry->description);
      w = gtk_label_new (msg);
      g_free (msg);
      gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
      gtk_label_set_line_wrap (GTK_LABEL (w), TRUE);
      gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0);
    }
  if (pinentry->error && !confirm_mode)
    {
      GdkColor color = { 0, 0xffff, 0, 0 };

      msg = pinentry_utf8_validate (pinentry->error);
      w = gtk_label_new (msg);
      g_free (msg);
      gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
      gtk_label_set_line_wrap (GTK_LABEL (w), TRUE);
      gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0);
      gtk_widget_modify_fg (w, GTK_STATE_NORMAL, &color);
    }

  qualitybar = NULL;

  if (!confirm_mode)
    {
      GtkWidget* table = gtk_table_new (pinentry->quality_bar ? 2 : 1, 2,
					FALSE);
      gtk_box_pack_start (GTK_BOX (box), table, FALSE, FALSE, 0);

      if (pinentry->prompt)
	{
	  msg = pinentry_utf8_validate (pinentry->prompt);
	  w = gtk_label_new_with_mnemonic (msg);
	  g_free (msg);
	  gtk_misc_set_alignment (GTK_MISC (w), 1.0, 0.5);
	  gtk_table_attach (GTK_TABLE (table), w, 0, 1, 0, 1,
			    GTK_FILL, GTK_FILL, 4, 0);
	}

      entry = gtk_secure_entry_new ();
      gtk_widget_set_size_request (entry, 200, -1);
      g_signal_connect (G_OBJECT (entry), "activate",
			G_CALLBACK (enter_callback), entry);
      g_signal_connect (G_OBJECT (entry), "changed",
                        G_CALLBACK (changed_text_handler), entry);
      gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1,
                        GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
      gtk_widget_grab_focus (entry);
      gtk_widget_show (entry);

      if (pinentry->quality_bar)
	{
          msg = pinentry_utf8_validate (pinentry->quality_bar);
	  w = gtk_label_new (msg);
          g_free (msg);
	  gtk_misc_set_alignment (GTK_MISC (w), 1.0, 0.5);
	  gtk_table_attach (GTK_TABLE (table), w, 0, 1, 1, 2,
			    GTK_FILL, GTK_FILL, 4, 0);
	  qualitybar = gtk_progress_bar_new();
	  gtk_widget_add_events (qualitybar,
				 GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
	  gtk_progress_bar_set_text (GTK_PROGRESS_BAR (qualitybar),
				     QUALITYBAR_EMPTY_TEXT);
	  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar), 0.0);
          if (pinentry->quality_bar_tt)
            gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), qualitybar,
                                  pinentry->quality_bar_tt, "");
	  gtk_table_attach (GTK_TABLE (table), qualitybar, 1, 2, 1, 2,
	  		    GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
	}

#ifdef ENABLE_ENHANCED
      if (pinentry->enhanced)
	{
	  GtkWidget *sbox = gtk_hbox_new (FALSE, HIG_SMALL);
	  gtk_box_pack_start (GTK_BOX (box), sbox, FALSE, FALSE, 0);

	  w = gtk_label_new ("Forget secret after");
	  gtk_box_pack_start (GTK_BOX (sbox), w, FALSE, FALSE, 0);
	  gtk_widget_show (w);

	  time_out = gtk_spin_button_new
	    (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, HUGE_VAL, 1, 60, 60)),
	     2, 0);
	  gtk_box_pack_start (GTK_BOX (sbox), time_out, FALSE, FALSE, 0);
	  gtk_widget_show (time_out);

	  w = gtk_label_new ("seconds");
	  gtk_box_pack_start (GTK_BOX (sbox), w, FALSE, FALSE, 0);
	  gtk_widget_show (w);
	  gtk_widget_show (sbox);

	  insure = gtk_check_button_new_with_label ("ask before giving out "
						    "secret");
	  gtk_box_pack_start (GTK_BOX (box), insure, FALSE, FALSE, 0);
	  gtk_widget_show (insure);
	}
#endif
    }

  bbox = gtk_hbutton_box_new ();
  gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
  gtk_box_set_spacing (GTK_BOX (bbox), 6);
  gtk_box_pack_start (GTK_BOX (wvbox), bbox, TRUE, FALSE, 0);

  if (!pinentry->one_button)
    {
      if (pinentry->cancel)
        {
          msg = pinentry_utf8_validate (pinentry->cancel);
          w = gtk_button_new_with_mnemonic (msg);
          g_free (msg);
        }
      else if (pinentry->default_cancel)
        {
          GtkWidget *image;

          msg = pinentry_utf8_validate (pinentry->default_cancel);
          w = gtk_button_new_with_mnemonic (msg);
          g_free (msg);
          image = gtk_image_new_from_stock (GTK_STOCK_CANCEL,
                                            GTK_ICON_SIZE_BUTTON);
          if (image)
            gtk_button_set_image (GTK_BUTTON (w), image);
        }
      else
          w = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
      gtk_container_add (GTK_CONTAINER (bbox), w);
      g_signal_connect (G_OBJECT (w), "clicked",
                        G_CALLBACK (confirm_mode ? confirm_button_clicked
                                    : button_clicked),
			(gpointer) CONFIRM_CANCEL);
      GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    }

  if (confirm_mode && !pinentry->one_button && pinentry->notok)
    {
      msg = pinentry_utf8_validate (pinentry->notok);
      w = gtk_button_new_with_mnemonic (msg);
      g_free (msg);

      gtk_container_add (GTK_CONTAINER (bbox), w);
      g_signal_connect (G_OBJECT (w), "clicked",
                        G_CALLBACK (confirm_button_clicked),
			(gpointer) CONFIRM_NOTOK);
      GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    }

  if (pinentry->ok)
    {
      msg = pinentry_utf8_validate (pinentry->ok);
      w = gtk_button_new_with_mnemonic (msg);
      g_free (msg);
    }
  else if (pinentry->default_ok)
    {
      GtkWidget *image;

      msg = pinentry_utf8_validate (pinentry->default_ok);
      w = gtk_button_new_with_mnemonic (msg);
      g_free (msg);
      image = gtk_image_new_from_stock (GTK_STOCK_OK,
                                        GTK_ICON_SIZE_BUTTON);
      if (image)
        gtk_button_set_image (GTK_BUTTON (w), image);
    }
  else
    w = gtk_button_new_from_stock (GTK_STOCK_OK);
  gtk_container_add (GTK_CONTAINER(bbox), w);
  if (!confirm_mode)
    {
      g_signal_connect (G_OBJECT (w), "clicked",
			G_CALLBACK (button_clicked), "ok");
      GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
      gtk_widget_grab_default (w);
      g_signal_connect_object (G_OBJECT (entry), "focus_in_event",
				G_CALLBACK (gtk_widget_grab_default),
			       G_OBJECT (w), 0);
    }
  else
    {
      g_signal_connect (G_OBJECT (w), "clicked",
			G_CALLBACK(confirm_button_clicked),
			(gpointer) CONFIRM_OK);
      GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    }

  gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER);
  gtk_window_set_keep_above (GTK_WINDOW (win), TRUE);
  gtk_widget_show_all (win);
  gtk_window_present (GTK_WINDOW (win));  /* Make sure it has the focus.  */

  return win;
}
Beispiel #21
0
void wxTaskBarIcon::Private::SetIcon()
{
#if GTK_CHECK_VERSION(2,10,0)
    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,10,0) == NULL)
    {
        if (m_statusIcon)
            gtk_status_icon_set_from_pixbuf(m_statusIcon, m_bitmap.GetPixbuf());
        else
        {
            m_statusIcon = gtk_status_icon_new_from_pixbuf(m_bitmap.GetPixbuf());
            g_signal_connect(m_statusIcon, "activate",
                G_CALLBACK(icon_activate), m_taskBarIcon);
            g_signal_connect(m_statusIcon, "popup_menu",
                G_CALLBACK(status_icon_popup_menu), m_taskBarIcon);
        }
    }
    else
#endif
    {
#ifndef __WXGTK3__
        m_size = 0;
        if (m_eggTrayIcon)
        {
            GtkWidget* image = gtk_bin_get_child(GTK_BIN(m_eggTrayIcon));
            gtk_image_set_from_pixbuf(GTK_IMAGE(image), m_bitmap.GetPixbuf());
        }
        else
        {
            m_eggTrayIcon = GTK_WIDGET(egg_tray_icon_new("wxTaskBarIcon"));
            gtk_widget_add_events(m_eggTrayIcon, GDK_BUTTON_PRESS_MASK);
            g_signal_connect(m_eggTrayIcon, "size_allocate",
                G_CALLBACK(icon_size_allocate), this);
            g_signal_connect(m_eggTrayIcon, "destroy",
                G_CALLBACK(icon_destroy), this);
            g_signal_connect(m_eggTrayIcon, "button_press_event",
                G_CALLBACK(icon_button_press_event), m_taskBarIcon);
            g_signal_connect(m_eggTrayIcon, "popup_menu",
                G_CALLBACK(icon_popup_menu), m_taskBarIcon);
            GtkWidget* image = gtk_image_new_from_pixbuf(m_bitmap.GetPixbuf());
            gtk_container_add(GTK_CONTAINER(m_eggTrayIcon), image);
            gtk_widget_show_all(m_eggTrayIcon);
        }
#endif
    }
#if wxUSE_TOOLTIPS
    const char *tip_text = NULL;
    if (!m_tipText.empty())
        tip_text = m_tipText.utf8_str();

#if GTK_CHECK_VERSION(2,10,0)
    if (m_statusIcon)
    {
#if GTK_CHECK_VERSION(2,16,0)
        if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,16,0) == NULL)
            gtk_status_icon_set_tooltip_text(m_statusIcon, tip_text);
        else
#endif
        {
#ifndef __WXGTK3__
            gtk_status_icon_set_tooltip(m_statusIcon, tip_text);
#endif
        }
    }
    else
#endif // GTK_CHECK_VERSION(2,10,0)
    {
#ifndef __WXGTK3__
        if (tip_text && m_tooltips == NULL)
        {
            m_tooltips = gtk_tooltips_new();
            g_object_ref(m_tooltips);
            gtk_object_sink(GTK_OBJECT(m_tooltips));
        }
        if (m_tooltips)
            gtk_tooltips_set_tip(m_tooltips, m_eggTrayIcon, tip_text, "");
#endif
    }
#endif // wxUSE_TOOLTIPS
}
Beispiel #22
0
int l_dover(const char *datadov,const char *nomerdov,GtkWidget *wpredok)
{
l_dover_data data;
char bros[512];
GdkColor color;

data.datdov.new_plus(datadov);
data.nomdov.new_plus(nomerdov);
data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

//gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
//gdk_color_parse("black",&color);
//gtk_widget_modify_bg(data.window,GTK_STATE_NORMAL,&color);


sprintf(bros,"%s %s",name_system,gettext("Доверенность"));

gtk_window_set_title (GTK_WINDOW (data.window),bros);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_dover_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

data.label_kolstr=gtk_label_new (gettext("Доверенность"));
//gdk_color_parse("green",&color);
//gtk_widget_modify_fg(data.label_kolstr,GTK_STATE_NORMAL,&color);


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.label_poisk=gtk_label_new ("");
gdk_color_parse("red",&color);
gtk_widget_modify_fg(data.label_poisk,GTK_STATE_NORMAL,&color);

gtk_box_pack_start (GTK_BOX (vbox2),data.label_poisk,FALSE, FALSE, 0);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];

sprintf(bros,"%sF1 %s",RFK,gettext("Шапка"));
data.knopka[SFK1]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK1], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK1]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[SFK1]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK1],data.knopka[SFK1],gettext("Просмотр шапки документа"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK1]),(gpointer)SFK1);
gtk_widget_show(data.knopka[SFK1]);

sprintf(bros,"F2 %s",gettext("Запись"));
data.knopka[FK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Ввод новой записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);

sprintf(bros,"%sF2 %s",RFK,gettext("Корректировать"));
data.knopka[SFK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK2],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK2]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[SFK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK2],data.knopka[SFK2],gettext("Корректировка выбранной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK2]),(gpointer)SFK2);
gtk_widget_show(data.knopka[SFK2]);


sprintf(bros,"F3 %s",gettext("Удалить"));
data.knopka[FK3]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK3],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK3]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[FK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK3],data.knopka[FK3],gettext("Удаление выбранной записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK3]),(gpointer)FK3);
gtk_widget_show(data.knopka[FK3]);

sprintf(bros,"%sF3 %s",RFK,gettext("Удалить документ"));
data.knopka[SFK3]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[SFK3],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[SFK3]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[SFK3]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[SFK3],data.knopka[SFK3],gettext("Удалить документ"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[SFK3]),(gpointer)SFK3);
gtk_widget_show(data.knopka[SFK3]);


sprintf(bros,"F5 %s",gettext("Печать"));
data.knopka[FK5]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK5],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK5]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
tooltips[FK5]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK5],data.knopka[FK5],gettext("Распечатка записей"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK5]),(gpointer)FK5);
gtk_widget_show(data.knopka[FK5]);

sprintf(bros,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(l_dover_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);


gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));

gtk_widget_grab_focus(data.knopka[FK10]);

l_dover_create_list(&data);

gtk_widget_show(data.window);
//if(metka_rr == 0)
  gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));


gtk_main();


if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.metka_voz);

}
Beispiel #23
0
int main(int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *button_clear, *button_azel, *button_freq, *button_offset;
    GtkWidget *button_help;
    GdkColor color;
    int i, ii;
    int yr, da, hr, mn, sc;
    double secstart;
    char buf[64];
    GdkGeometry geometry;
    GdkWindowHints geo_mask;
//    GdkRectangle update_rect;
    sprintf(d1.catnam, "srt.cat");
    sprintf(d1.hlpnam, "srt.hlp");
    for (i = 0; i < argc - 1; i++) {
        sscanf(argv[i], "%63s", buf);
        if (strstr(buf, "-c") && strlen(buf) == 2)
            sscanf(argv[i + 1], "%63s", d1.catnam);
        if (strstr(buf, "-h") && strlen(buf) == 2)
            sscanf(argv[i + 1], "%63s", d1.hlpnam);
    }
//    d1.azelport = 0x3f8;        // com1 default for old SRT 
    d1.ver = 4;  // SRT software version
    d1.secs = readclock();
    d1.run = 1;
    d1.record = 0;
    d1.entry1 = d1.entry2 = d1.entry3 = d1.entry5 = d1.entry6 = d1.entry8 = d1.helpwindow = d1.vwindow = 0;
    d1.plot = 0;
    d1.start_time = 0.0;
    d1.start_sec = 0.0;
    d1.speed_up = 0;
    d1.ppos = 0;
    d1.printout = 1;
    d1.debug = 0;
    d1.freq = 1420.4;           // default
    d1.bw = 0;                  // set to 2.4 for TV dongle 10 MHz for ADC card in init
    d1.fbw = 0;                 // set in init or srt.cat
    d1.nblk = 5;                // number of blocks in vspectra
    d1.record_int_sec = 0;
    d1.freqcorr = 0;            // frequency correction for L.O. may be needed for TV dongle
    d1.freqchng = 0;
    d1.clearint = 0;
    d1.record_clearint = 0;
    d1.noclearint = 0;
    d1.nfreq = NSPEC;
    d1.plotsec = 1;
    d1.displ = 1;
    d1.noisecal = 0;
//    used for old SRT mount and controller
//    d1.ptoler = 1;
//    d1.countperstep = 10000;    // default large number for no stepping 
//    d1.elcounts_per_deg = (52.0 * 27.0 / 120.0); // default for H-180
//    d1.azcounts_per_deg = 8.0 * 32.0 * 60.0 / (360.0 * 9.0); // default for CASSIMOUNT
//    d1.rod = 1;                 // default to rod as on CASSIMOUNT
//    d1.rod1 = 14.25;            // rigid arm length
//    d1.rod2 = 16.5;             // distance from pushrod upper joint to el axis
//    d1.rod3 = 2.0;              // pushrod collar offset
//    d1.rod4 = 110.0;            // angle at horizon
//    d1.rod5 = 30.0;             // pushrod counts per inch
    d1.azelsim = d1.radiosim = d1.fftsim = 0;
    d1.mainten = 0;
    d1.stowatlim = 1;
    d1.rms = -1;                // display max not rms 
    d1.calcons = 1.0;
    d1.caldone = 0;
    d1.nrfi = 0;
    d1.rfisigma = 6;            // level for RFI reporting to screen
    d1.tload = 300.0;
    d1.tspill = 20.0;
    d1.beamw = 5.0;
    d1.comerr = 0;
    d1.limiterr = 0;
    d1.restfreq = 1420.406;     /* H-line restfreq */
    d1.delay = 0;
    d1.azoff = 0.0;
    d1.eloff = 0.0;
    d1.drift = 0;
    d1.tstart = 0;
    d1.tsys = 100.0;            // expected on cold sky
    d1.pwroff = 0.0;
    d1.tant = 100.0;
    d1.calpwr = 0;
    d1.yfac = 0;
    d1.calon = 0;
    d1.calmode = 0;
    d1.docal = 0;
    d1.tcal = 290;              // absorber or bushes
    d1.sourn = 0;
    d1.track = 0;
    d1.scan = 0;
    d1.bsw = 0;
    d1.nbsw = 1;
    d1.obsn = 0;
    d1.stopproc = 0;
    d1.fstatus = 0;
    d1.cmdfl = 0;
    d1.south = 1;
    d1.hgt = 0;
    d1.dongle = 0;              // set to zero initially - set to 1 in Init_Device if dongle
    d1.npoly = 25;              // number of terms in polynomial fit of bandpass
    pwrst = pwrprev = 0.0;
    soutrack[0] = 0;
    sprintf(d1.cmdfnam, "cmd.txt");
    sprintf(d1.datadir, "./");  // default to local directory

    if (!catfile())
        return 0;
    d1.foutstatus = 0;
// to get permission su root chown root srtn then chmod u+s srtn then exit 
    if (!d1.azelsim) {
        if (d1.printout)
            printf("initializing antenna controller\n");
        i = rot2(&d1.aznow, &d1.elnow, -1, buf); // initialize
        i = rot2(&d1.aznow, &d1.elnow, 1, buf); // read
        if (i < 0) {
            printf("Couldn't talk to antenna controller\n");
            return 0;
        }
    } else {
        if (d1.stowatlim) {
            d1.azprev = d1.azlim1;
            d1.elprev = d1.ellim1;
        } else {
            d1.azprev = d1.stowaz;
            d1.elprev = d1.stowel;
        }
    }
    setgid(getgid());
    setuid(getuid());
    if (d1.mainten == 0) {
        if (d1.stowatlim) {
            d1.azcmd = d1.azlim1;
            d1.elcmd = d1.ellim1;
        } else {
            d1.azcmd = d1.stowaz;
            d1.elcmd = d1.stowel;
        }
        d1.azcount = 0;
        d1.elcount = 0;
        d1.stow = 1;
    }
    if (d1.azlim1 > d1.azlim2) {
        d1.south = 0;           // dish pointing North for southern hemisphere
        if (d1.azlim2 < 360.0)
            d1.azlim2 += 360.0;
    }

    if (!d1.radiosim)
        Init_Device(0);

    if (d1.displ) {
        gtk_init(&argc, &argv);
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        geometry.min_width = 500;
        geometry.min_height = 300;
        geo_mask = GDK_HINT_MIN_SIZE;
        gtk_window_set_geometry_hints(GTK_WINDOW(window), window, &geometry, geo_mask);
        //Table size determines number of buttons across the top
        table = gtk_table_new(30, NUMBUTTONS, TRUE);

        drawing_area = gtk_drawing_area_new();
        gtk_window_set_default_size(GTK_WINDOW(window), 800, 600);
        color.red = 0xffff;
        color.blue = 0xffff;
        color.green = 0xffff;
        gtk_widget_show(drawing_area);
        gtk_table_attach_defaults(GTK_TABLE(table), drawing_area, 0, NUMBUTTONS, 3, 30);

        g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(quit), NULL);

        gtk_container_add(GTK_CONTAINER(window), table);

        g_signal_connect(G_OBJECT(drawing_area), "expose_event", (GtkSignalFunc) expose_event, NULL);
        g_signal_connect(G_OBJECT(drawing_area), "configure_event", (GtkSignalFunc) configure_event, NULL);

        g_signal_connect(G_OBJECT(drawing_area), "button_press_event",
                         (GtkSignalFunc) button_press_event, NULL);

        gtk_widget_set_events(drawing_area, GDK_EXPOSURE_MASK
                              | GDK_LEAVE_NOTIFY_MASK
                              | GDK_BUTTON_PRESS_MASK
                              | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK);


        button_clear = gtk_button_new_with_label("clear");
        button_stow = gtk_button_new_with_label("stow");
        button_azel = gtk_button_new_with_label("azel");
        button_npoint = gtk_button_new_with_label("npoint");
        button_bsw = gtk_button_new_with_label("beamsw");
        button_freq = gtk_button_new_with_label("freq");
        button_offset = gtk_button_new_with_label("offset");
        button_record = gtk_button_new_with_label("record");
        button_cmdfl = gtk_button_new_with_label("cmdfl");
        button_cal = gtk_button_new_with_label("cal");
        button_help = gtk_button_new_with_label("help");
        button_exit = gtk_button_new_with_label("exit");

        g_signal_connect(G_OBJECT(button_clear), "clicked", G_CALLBACK(button_clear_clicked), NULL);
        g_signal_connect(G_OBJECT(button_stow), "clicked", G_CALLBACK(button_stow_clicked), NULL);
        g_signal_connect(G_OBJECT(button_azel), "clicked", G_CALLBACK(button_azel_clicked), NULL);
        g_signal_connect(G_OBJECT(button_npoint), "clicked", G_CALLBACK(button_npoint_clicked), NULL);
        g_signal_connect(G_OBJECT(button_bsw), "clicked", G_CALLBACK(button_bsw_clicked), NULL);
        g_signal_connect(G_OBJECT(button_freq), "clicked", G_CALLBACK(button_freq_clicked), NULL);
        g_signal_connect(G_OBJECT(button_offset), "clicked", G_CALLBACK(button_offset_clicked), NULL);
        g_signal_connect(G_OBJECT(button_record), "clicked", G_CALLBACK(button_record_clicked), NULL);
        g_signal_connect(G_OBJECT(button_cmdfl), "clicked", G_CALLBACK(button_cmdfl_clicked), NULL);
        g_signal_connect(G_OBJECT(button_cal), "clicked", G_CALLBACK(button_cal_clicked), NULL);
        g_signal_connect(G_OBJECT(button_help), "clicked", G_CALLBACK(button_help_clicked), NULL);
        g_signal_connect(G_OBJECT(button_exit), "clicked", G_CALLBACK(button_exit_clicked), NULL);

        // test setting up tooltips instead of the "enter"/"leave" used below
        tooltips = gtk_tooltips_new();
        gtk_tooltips_set_tip(tooltips, button_clear,
                             "click to clear integration and reset time plot to 1/4-scale", NULL);
        gtk_tooltips_set_tip(tooltips, button_stow, "click to stow antenna", NULL);
        gtk_tooltips_set_tip(tooltips, button_azel, "click to enter az el coordinates", NULL);
        gtk_tooltips_set_tip(tooltips, button_npoint, "click to start npoint scan", NULL);
        gtk_tooltips_set_tip(tooltips, button_bsw, "click to start beam switch", NULL);
        gtk_tooltips_set_tip(tooltips, button_freq, "click to enter new frequency in MHz [bandwidth] [nfreq]",
                             NULL);
        gtk_tooltips_set_tip(tooltips, button_offset, "click to enter offsets", NULL);
        if (!d1.cmdfl)
            gtk_tooltips_set_tip(tooltips, button_cmdfl, "click to start cmd file", NULL);
        else
            gtk_tooltips_set_tip(tooltips, button_cmdfl, "click to stop cmd file", NULL);

        gtk_tooltips_set_tip(tooltips, button_cal, "click to start calibration", NULL);
        gtk_tooltips_set_tip(tooltips, button_help, "click to open help window", NULL);
        record_tooltip();


        gtk_table_attach(GTK_TABLE(table), button_clear, 0, 1, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_stow, 1, 2, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_azel, 2, 3, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_npoint, 3, 4, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_bsw, 4, 5, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_freq, 5, 6, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_offset, 6, 7, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_record, 7, 8, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_cmdfl, 8, 9, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_cal, 9, 10, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_help, 10, 11, 0, 2, GTK_FILL, GTK_FILL, 0, 0);
        gtk_table_attach(GTK_TABLE(table), button_exit, 11, 12, 0, 2, GTK_FILL, GTK_FILL, 0, 0);



        gtk_widget_show(button_clear);
        gtk_widget_show(button_stow);
        gtk_widget_show(button_azel);
        gtk_widget_show(button_npoint);
        gtk_widget_show(button_bsw);
        gtk_widget_show(button_freq);
        gtk_widget_show(button_offset);
        gtk_widget_show(button_record);
        gtk_widget_show(button_cmdfl);
        gtk_widget_show(button_cal);
        gtk_widget_show(button_help);
        gtk_widget_show(button_exit);


        gtk_widget_show(table);
        gtk_widget_show(window);
        clearpaint();
    }
    ii = 0;
    if (d1.printout) {
        toyrday(d1.secs, &yr, &da, &hr, &mn, &sc);
        printf("%4d:%03d:%02d:%02d:%02d %3s ", yr, da, hr, mn, sc, d1.timsource);
    }
    zerospectra(0);
    for (i = 0; i < d1.nfreq; i++)
        bspec[i] = 1;
    secstart = d1.nsecstart = -1;
    d1.secs = readclock();
    while (d1.run) {
        zerospectra(1);
        if (d1.clearint) {
            if (d1.displ)
                cleararea();
            zerospectra(0);
            d1.clearint = 0;
        }
        if (d1.freqchng) {
            if (d1.dongle)
                Init_Device(1);
            if (d1.printout) {
                toyrday(d1.secs, &yr, &da, &hr, &mn, &sc);
                printf("%4d:%03d:%02d:%02d:%02d %3s ", yr, da, hr, mn, sc, d1.timsource);
            }
            if (!d1.radiosim) {
                sleep(1);
            }
            zerospectra(0);
            d1.freqchng = 0;
        }
        if (d1.docal) {
            if (d1.docal == 1) {
                sprintf(d1.recnote, "* calibration started\n");
                outfile(d1.recnote);
            }
            if (d1.bsw) {
                d1.bsw = 0;
                d1.azoff = 0.0;
            }
            if (d1.scan) {
                d1.scan = 0;
                d1.eloff = d1.azoff = 0.0;
            }
            if (d1.slew)
                d1.slew = 0;
            if (d1.docal == 1)
                cal(0);
            d1.docal = 2;
            cal(1);
            if (d1.integ >= NCAL) {
                cal(2);
                d1.docal = 0;
            }
        }

        if (d1.displ)
            cleararea();
        azel(d1.azcmd, d1.elcmd); // allow time after cal 
        if (d1.comerr == -1)
            return 0;
        if (!d1.slew) {
            pwr = 0.0;
        }
        if (!d1.slew)
            vspectra();
        d1.secs = readclock();
        aver();
        d1.integ2++;
        if (d1.record_int_sec && d1.integ2 >= d1.record_int_sec) {
            outfile(" ");
            if (d1.record_clearint && d1.track && !d1.bsw && !d1.scan)
                d1.clearint = 1;
            d1.integ2 = 0;
        }
        if (d1.displ) {
            if (!d1.plot)
                Repaint();
            while (gtk_events_pending() || d1.stopproc == 1) {
                gtk_main_iteration();
                d1.plot = 0;
            }
        }
        if (!d1.displ && d1.domap)
            scanplot();
    }
    return 0;
}
Beispiel #24
0
int l_klient_imp(const char *imaf,
GtkWidget *wpredok)
{
char strsql[500];
iceb_u_spisok repl_s;
class l_klient_imp_data data;

data.imafz.new_plus(imaf);

data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
sprintf(strsql,"%s %s",name_system,gettext("Импорт карточек из файла"));

gtk_window_set_title(GTK_WINDOW(data.window),strsql);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_klient_imp_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *vbox=gtk_vbox_new(FALSE, 2);

gtk_container_add(GTK_CONTAINER(data.window), vbox);

data.label=gtk_label_new(gettext("Ждите !!!"));

gtk_box_pack_start(GTK_BOX(vbox),data.label,FALSE,FALSE,0);

GtkWidget *label=NULL;

label=gtk_label_new(gettext("Импорт карточек из файла"));
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);

data.view=gtk_text_view_new();
gtk_widget_set_usize(GTK_WIDGET(data.view),450,300);

gtk_text_view_set_editable(GTK_TEXT_VIEW(data.view),FALSE); //Запрет на редактирование текста
//PangoFontDescription *font_pango=pango_font_description_from_string("Nimbus Mono L, Bold 12");
PangoFontDescription *font_pango=pango_font_description_from_string(shrift_ravnohir.ravno());
gtk_widget_modify_font(GTK_WIDGET(data.view),font_pango);
pango_font_description_free(font_pango);

data.buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(data.view));

GtkWidget *sw=gtk_scrolled_window_new(NULL,NULL);
//gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),GTK_POLICY_ALWAYS,GTK_POLICY_ALWAYS);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_container_add(GTK_CONTAINER(sw),data.view);

data.bar=gtk_progress_bar_new();

gtk_progress_bar_set_bar_style(GTK_PROGRESS_BAR(data.bar),GTK_PROGRESS_CONTINUOUS);

gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(data.bar),GTK_PROGRESS_LEFT_TO_RIGHT);

gtk_box_pack_start (GTK_BOX (vbox), data.bar, FALSE, FALSE, 2);



sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka=gtk_button_new_with_label(strsql);
GtkTooltips *tooltops=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltops,data.knopka,gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka),"clicked",GTK_SIGNAL_FUNC(l_klient_imp_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka),(gpointer)0);
gtk_box_pack_start (GTK_BOX (vbox), data.knopka, FALSE, FALSE, 2);

gtk_widget_set_sensitive(GTK_WIDGET(data.knopka),FALSE);//Недоступна

gtk_widget_show_all(data.window);


//gtk_window_set_decorated(GTK_WINDOW(data.window),FALSE); //Убирает рамку вокруг окна

//gtk_widget_set_sensitive(GTK_WIDGET(data.knopka),FALSE);//Недоступна

gtk_idle_add((GtkFunction)l_klient_imp1,&data);

gtk_main();

if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.voz);
}
Beispiel #25
0
void  l_poiuosdok(const char *nomdok,GtkWidget *wpredok)
{
char strsql[512];
iceb_u_str soob;
class poiuosdok_data data;
data.nomdok_p.new_plus(nomdok);

data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

sprintf(strsql,"%s %s",name_system,gettext("Поиск документа по номеру"));

gtk_window_set_title (GTK_WINDOW (data.window),strsql);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(poiuosdok_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

soob.new_plus("");

data.label_kolstr=gtk_label_new (soob.ravno_toutf());


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];


sprintf(strsql,"F2 %s",gettext("Просмотр"));
data.knopka[FK2]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(poiuosdok_knopka),&data);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Просмотр выбранного документа"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(strsql);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(poiuosdok_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);


gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));

gtk_widget_grab_focus(data.knopka[FK10]);

poiuosdok_create_list(&data);

gtk_widget_show(data.window);

gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));

gtk_main();


printf("l_poiuosdok end\n");
if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));


}
Beispiel #26
0
int   l_mater1(iceb_u_str *kod,iceb_u_str *naim,
int skl_poi, // склад
const char *grup,
int metka_skl, //0-все 1-только материалы карточки которых есть на складе
int metka_cen, //0-с нулевой ценой не выбирать 1-выбирать с любой ценой
GtkWidget *wpredok)
{
printf("l_mater1-%s\n",naim->ravno());

class mater1_data data;
char bros[512];
GdkColor color;

data.poisk.clear_zero();

data.skl_poi=skl_poi;
data.metka_skl=metka_skl;
data.poisk.grupa.new_plus(grup);
data.metka_cen=metka_cen;

if(naim->getdlinna() > 1)
 {
  data.poisk.metka_poi=1;
  data.poisk.naim.new_plus(naim->ravno());
 }
data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

//gtk_window_set_default_size (GTK_WINDOW  (data.window),400,-1);
//gdk_color_parse("black",&color);
//gtk_widget_modify_bg(data.window,GTK_STATE_NORMAL,&color);


sprintf(bros,"%s %s",name_system,gettext("Список материаллов"));

gtk_window_set_title (GTK_WINDOW (data.window),bros);
gtk_container_set_border_width (GTK_CONTAINER (data.window), 5);

gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);


if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(mater1_key_press),&data);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_release_event",GTK_SIGNAL_FUNC(iceb_key_release),&data.kl_shift);

GtkWidget *hbox = gtk_hbox_new (FALSE, 1);
gtk_container_add (GTK_CONTAINER (data.window), hbox);

GtkWidget *vbox1 = gtk_vbox_new (FALSE, 1);
GtkWidget *vbox2 = gtk_vbox_new (FALSE, 1);

gtk_box_pack_start (GTK_BOX (hbox), vbox1, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox);

data.label_kolstr=gtk_label_new (gettext("Список материалов"));
//gdk_color_parse("green",&color);
//gtk_widget_modify_fg(data.label_kolstr,GTK_STATE_NORMAL,&color);


gtk_box_pack_start (GTK_BOX (vbox2),data.label_kolstr,FALSE, FALSE, 0);

gtk_widget_show(vbox1);
gtk_widget_show(vbox2);

data.label_sklad=gtk_label_new ("");
data.label_poisk=gtk_label_new ("");
gdk_color_parse("red",&color);
gtk_widget_modify_fg(data.label_poisk,GTK_STATE_NORMAL,&color);
gtk_widget_modify_fg(data.label_sklad,GTK_STATE_NORMAL,&color);

gtk_box_pack_start (GTK_BOX (vbox2),data.label_sklad,FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2),data.label_poisk,FALSE, FALSE, 0);

data.sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize(GTK_WIDGET(data.sw),400,300);

gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (data.sw),GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data.sw),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
//gtk_box_pack_start (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox2), data.sw, TRUE, TRUE, 0);

//Кнопки
GtkTooltips *tooltips[KOL_F_KL];

sprintf(bros,"F2 %s",gettext("Запись"));
data.knopka[FK2]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK2], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK2]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
tooltips[FK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK2],data.knopka[FK2],gettext("Ввод новой записи"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK2]),(gpointer)FK2);
gtk_widget_show(data.knopka[FK2]);


sprintf(bros,"F4 %s",gettext("Поиск"));
data.knopka[FK4]=gtk_button_new_with_label(bros);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK4]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK4],TRUE,TRUE, 0);
tooltips[FK4]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK4],data.knopka[FK4],gettext("Поиск нужных записей"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK4]),(gpointer)FK4);
gtk_widget_show(data.knopka[FK4]);

sprintf(bros,"F5 %s",gettext("Печать"));
data.knopka[FK5]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK5],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK5]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
tooltips[FK5]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK5],data.knopka[FK5],gettext("Распечатка записей"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK5]),(gpointer)FK5);
gtk_widget_show(data.knopka[FK5]);


sprintf(bros,"F7 %s",gettext("Остаток"));
data.knopka[FK7]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1), data.knopka[FK7],TRUE,TRUE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK7]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
tooltips[FK7]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK7],data.knopka[FK7],gettext("Включить/выключить показ записей с остатками"),NULL);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK7]),(gpointer)FK7);
gtk_widget_show(data.knopka[FK7]);


sprintf(bros,"F10 %s",gettext("Выход"));
data.knopka[FK10]=gtk_button_new_with_label(bros);
gtk_box_pack_start(GTK_BOX(vbox1),data.knopka[FK10],TRUE,TRUE, 0);
tooltips[FK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[FK10],data.knopka[FK10],gettext("Завершение работы в этом окне"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[FK10]), "clicked",GTK_SIGNAL_FUNC(mater1_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[FK10]),(gpointer)FK10);
gtk_widget_show(data.knopka[FK10]);


gtk_widget_realize(data.window);
gdk_window_set_cursor(data.window->window,gdk_cursor_new(ICEB_CURSOR));


mater1_create_list(&data);

gtk_widget_grab_focus(data.knopka[FK10]);
gtk_widget_show(data.window);

// gtk_window_maximize(GTK_WINDOW(data.window));
//gtk_window_fullscreen(GTK_WINDOW(data.window));


gtk_main();

if(data.metka_voz == 0 )
 {
  kod->new_plus(data.kodv.ravno());
  naim->new_plus(data.naimv.ravno());
 }

printf("l_mater1 end\n");
if(wpredok != NULL)
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR));

return(data.metka_voz);

}
GtkWidget*
create_Calculator (void)
{
  GtkWidget *Calculator;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *frame1;
  GtkWidget *table2;
  GtkWidget *hbox5;
  GtkWidget *labelDOO;
  GtkWidget *labelDuration;
  GtkWidget *hbox14;
  GtkWidget *label2;
  GtkWidget *hbox16;
  GtkWidget *label16;
  GtkWidget *entryCustom;
  GtkWidget *hbox21;
  GtkWidget *label14;
  GtkWidget *hbox18;
  GtkWidget *optionmenu2;
  GtkWidget *menu2;
  GtkWidget *avi1;
  GtkWidget *ogm1;
  GtkWidget *mpeg1;
  GtkWidget *hbox17;
  GtkWidget *optionmenu1;
  GtkWidget *menu1;
  GtkWidget *_1x80_cd1;
  GtkWidget *_2x80_cd1;
  GtkWidget *_1x74_cd1;
  GtkWidget *_2x74_cd1;
  GtkWidget *dvd1;
  GtkWidget *custom1;
  GtkWidget *label1;
  GtkWidget *frame2;
  GtkWidget *hbox11;
  GtkWidget *hbox12;
  GtkWidget *label6;
  GtkWidget *entry3;
  GtkWidget *hbox13;
  GtkWidget *label7;
  GtkWidget *entry4;
  GtkWidget *label4;
  GtkWidget *frame3;
  GtkWidget *hbox20;
  GtkWidget *table3;
  GtkWidget *label9;
  GtkWidget *labelAudio;
  GtkWidget *label11;
  GtkWidget *labelVideo;
  GtkWidget *label17;
  GtkWidget *labelTotal;
  GtkWidget *table4;
  GtkWidget *label12;
  GtkWidget *label15;
  GtkWidget *labelBitrate;
  GtkWidget *labelBPP;
  GtkWidget *label8;
  GtkWidget *dialog_action_area1;
  GtkWidget *doit;
  GtkWidget *button1;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  Calculator = gtk_dialog_new ();
  gtk_container_set_border_width (GTK_CONTAINER (Calculator), 6);
  gtk_window_set_title (GTK_WINDOW (Calculator), _("Bitrate Calculator"));
  gtk_window_set_resizable (GTK_WINDOW (Calculator), FALSE);

  dialog_vbox1 = GTK_DIALOG (Calculator)->vbox;
  gtk_widget_show (dialog_vbox1);

  vbox1 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (vbox1), frame1, FALSE, FALSE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  table2 = gtk_table_new (3, 4, FALSE);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (frame1), table2);
  gtk_container_set_border_width (GTK_CONTAINER (table2), 12);
  gtk_table_set_row_spacings (GTK_TABLE (table2), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table2), 12);

  hbox5 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox5);
  gtk_table_attach (GTK_TABLE (table2), hbox5, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  labelDOO = gtk_label_new (_("Duration:"));
  gtk_widget_show (labelDOO);
  gtk_box_pack_start (GTK_BOX (hbox5), labelDOO, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (labelDOO), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelDOO), 0, 0.5);

  labelDuration = gtk_label_new (_("00:00:00"));
  gtk_widget_show (labelDuration);
  gtk_table_attach (GTK_TABLE (table2), labelDuration, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelDuration), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelDuration), 0, 0.5);

  hbox14 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox14);
  gtk_table_attach (GTK_TABLE (table2), hbox14, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  label2 = gtk_label_new_with_mnemonic (_("_Medium:"));
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (hbox14), label2, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  hbox16 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox16);
  gtk_table_attach (GTK_TABLE (table2), hbox16, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  label16 = gtk_label_new_with_mnemonic (_("_Format:"));
  gtk_widget_show (label16);
  gtk_box_pack_start (GTK_BOX (hbox16), label16, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label16), 0, 0.5);

  entryCustom = gtk_entry_new ();
  gtk_widget_show (entryCustom);
  gtk_table_attach (GTK_TABLE (table2), entryCustom, 3, 4, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, entryCustom, _("Total size (custom)"), NULL);
  gtk_entry_set_max_length (GTK_ENTRY (entryCustom), 10);
  gtk_entry_set_width_chars (GTK_ENTRY (entryCustom), 6);

  hbox21 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox21);
  gtk_table_attach (GTK_TABLE (table2), hbox21, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  label14 = gtk_label_new_with_mnemonic (_("_Custom size (MB):"));
  gtk_widget_show (label14);
  gtk_box_pack_start (GTK_BOX (hbox21), label14, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_LEFT);

  hbox18 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox18);
  gtk_table_attach (GTK_TABLE (table2), hbox18, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  optionmenu2 = gtk_option_menu_new ();
  gtk_widget_show (optionmenu2);
  gtk_box_pack_start (GTK_BOX (hbox18), optionmenu2, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, optionmenu2, _("Output container format"), NULL);

  menu2 = gtk_menu_new ();

  avi1 = gtk_menu_item_new_with_mnemonic (_("AVI"));
  gtk_widget_show (avi1);
  gtk_container_add (GTK_CONTAINER (menu2), avi1);

  ogm1 = gtk_menu_item_new_with_mnemonic (_("OGM"));
  gtk_widget_show (ogm1);
  gtk_container_add (GTK_CONTAINER (menu2), ogm1);

  mpeg1 = gtk_menu_item_new_with_mnemonic (_("MPEG"));
  gtk_widget_show (mpeg1);
  gtk_container_add (GTK_CONTAINER (menu2), mpeg1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu2), menu2);

  hbox17 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox17);
  gtk_table_attach (GTK_TABLE (table2), hbox17, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  optionmenu1 = gtk_option_menu_new ();
  gtk_widget_show (optionmenu1);
  gtk_box_pack_start (GTK_BOX (hbox17), optionmenu1, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, optionmenu1, _("Total size"), NULL);

  menu1 = gtk_menu_new ();

  _1x80_cd1 = gtk_menu_item_new_with_mnemonic (_("1x 80 min. CD"));
  gtk_widget_show (_1x80_cd1);
  gtk_container_add (GTK_CONTAINER (menu1), _1x80_cd1);
  gtk_tooltips_set_tip (tooltips, _1x80_cd1, _("Total size (custom)"), NULL);

  _2x80_cd1 = gtk_menu_item_new_with_mnemonic (_("2x 80 min. CD"));
  gtk_widget_show (_2x80_cd1);
  gtk_container_add (GTK_CONTAINER (menu1), _2x80_cd1);

  _1x74_cd1 = gtk_menu_item_new_with_mnemonic (_("1x 74 min. CD"));
  gtk_widget_show (_1x74_cd1);
  gtk_container_add (GTK_CONTAINER (menu1), _1x74_cd1);

  _2x74_cd1 = gtk_menu_item_new_with_mnemonic (_("2x 74 min. CD"));
  gtk_widget_show (_2x74_cd1);
  gtk_container_add (GTK_CONTAINER (menu1), _2x74_cd1);

  dvd1 = gtk_menu_item_new_with_mnemonic (_("DVD5"));
  gtk_widget_show (dvd1);
  gtk_container_add (GTK_CONTAINER (menu1), dvd1);

  custom1 = gtk_menu_item_new_with_mnemonic (_("Custom"));
  gtk_widget_show (custom1);
  gtk_container_add (GTK_CONTAINER (menu1), custom1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1), menu1);

  label1 = gtk_label_new (_("<b>Target</b>"));
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);
  gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (vbox1), frame2, FALSE, FALSE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);

  hbox11 = gtk_hbox_new (TRUE, 12);
  gtk_widget_show (hbox11);
  gtk_container_add (GTK_CONTAINER (frame2), hbox11);
  gtk_container_set_border_width (GTK_CONTAINER (hbox11), 12);

  hbox12 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox12);
  gtk_box_pack_start (GTK_BOX (hbox11), hbox12, TRUE, TRUE, 0);

  label6 = gtk_label_new_with_mnemonic (_("Track _1:"));
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (hbox12), label6, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);

  entry3 = gtk_entry_new ();
  gtk_widget_show (entry3);
  gtk_box_pack_start (GTK_BOX (hbox12), entry3, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, entry3, _("Audio bitrate in kb/s for track 1 (0 for no audio)"), NULL);
  gtk_entry_set_max_length (GTK_ENTRY (entry3), 10);
  gtk_entry_set_width_chars (GTK_ENTRY (entry3), 6);

  hbox13 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox13);
  gtk_box_pack_start (GTK_BOX (hbox11), hbox13, TRUE, TRUE, 0);

  label7 = gtk_label_new_with_mnemonic (_("Track _2: "));
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (hbox13), label7, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);

  entry4 = gtk_entry_new ();
  gtk_widget_show (entry4);
  gtk_box_pack_start (GTK_BOX (hbox13), entry4, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, entry4, _("Audio bitrate in kb/s for track 2 (optional)"), NULL);
  gtk_entry_set_max_length (GTK_ENTRY (entry4), 10);
  gtk_entry_set_width_chars (GTK_ENTRY (entry4), 6);

  label4 = gtk_label_new (_("<b>Audio Bitrate</b>"));
  gtk_widget_show (label4);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
  gtk_label_set_use_markup (GTK_LABEL (label4), TRUE);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);

  frame3 = gtk_frame_new (NULL);
  gtk_widget_show (frame3);
  gtk_box_pack_start (GTK_BOX (vbox1), frame3, FALSE, FALSE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_NONE);

  hbox20 = gtk_hbox_new (TRUE, 12);
  gtk_widget_show (hbox20);
  gtk_container_add (GTK_CONTAINER (frame3), hbox20);
  gtk_container_set_border_width (GTK_CONTAINER (hbox20), 12);

  table3 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table3);
  gtk_box_pack_start (GTK_BOX (hbox20), table3, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table3), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table3), 6);

  label9 = gtk_label_new (_("Audio size (MB):"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  labelAudio = gtk_label_new (_("0"));
  gtk_widget_show (labelAudio);
  gtk_table_attach (GTK_TABLE (table3), labelAudio, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelAudio), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelAudio), 0, 0.5);

  label11 = gtk_label_new (_("Video size (MB):"));
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table3), label11, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);

  labelVideo = gtk_label_new (_("0"));
  gtk_widget_show (labelVideo);
  gtk_table_attach (GTK_TABLE (table3), labelVideo, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelVideo), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelVideo), 0, 0.5);

  label17 = gtk_label_new (_("Total size (MB):"));
  gtk_widget_show (label17);
  gtk_table_attach (GTK_TABLE (table3), label17, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);

  labelTotal = gtk_label_new (_("0"));
  gtk_widget_show (labelTotal);
  gtk_table_attach (GTK_TABLE (table3), labelTotal, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelTotal), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelTotal), 0, 0.5);

  table4 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table4);
  gtk_box_pack_start (GTK_BOX (hbox20), table4, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table4), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table4), 6);

  label12 = gtk_label_new (_("Video bitrate:"));
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table4), label12, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  label15 = gtk_label_new (_("Bits per pixel:"));
  gtk_widget_show (label15);
  gtk_table_attach (GTK_TABLE (table4), label15, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);

  labelBitrate = gtk_label_new (_("0"));
  gtk_widget_show (labelBitrate);
  gtk_table_attach (GTK_TABLE (table4), labelBitrate, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelBitrate), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelBitrate), 0, 0.5);

  labelBPP = gtk_label_new (_("0.0"));
  gtk_widget_show (labelBPP);
  gtk_table_attach (GTK_TABLE (table4), labelBPP, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (labelBPP), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (labelBPP), 0, 0.5);

  label8 = gtk_label_new (_("<b>Result</b>"));
  gtk_widget_show (label8);
  gtk_frame_set_label_widget (GTK_FRAME (frame3), label8);
  gtk_label_set_use_markup (GTK_LABEL (label8), TRUE);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_LEFT);

  dialog_action_area1 = GTK_DIALOG (Calculator)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  doit = gtk_button_new_from_stock ("gtk-apply");
  gtk_widget_show (doit);
  gtk_dialog_add_action_widget (GTK_DIALOG (Calculator), doit, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (doit, GTK_CAN_DEFAULT);

  button1 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button1);
  gtk_dialog_add_action_widget (GTK_DIALOG (Calculator), button1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label2), optionmenu1);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label16), optionmenu2);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label14), entryCustom);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label6), entry3);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label7), entry4);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (Calculator, Calculator, "Calculator");
  GLADE_HOOKUP_OBJECT_NO_REF (Calculator, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (Calculator, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (Calculator, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (Calculator, table2, "table2");
  GLADE_HOOKUP_OBJECT (Calculator, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (Calculator, labelDOO, "labelDOO");
  GLADE_HOOKUP_OBJECT (Calculator, labelDuration, "labelDuration");
  GLADE_HOOKUP_OBJECT (Calculator, hbox14, "hbox14");
  GLADE_HOOKUP_OBJECT (Calculator, label2, "label2");
  GLADE_HOOKUP_OBJECT (Calculator, hbox16, "hbox16");
  GLADE_HOOKUP_OBJECT (Calculator, label16, "label16");
  GLADE_HOOKUP_OBJECT (Calculator, entryCustom, "entryCustom");
  GLADE_HOOKUP_OBJECT (Calculator, hbox21, "hbox21");
  GLADE_HOOKUP_OBJECT (Calculator, label14, "label14");
  GLADE_HOOKUP_OBJECT (Calculator, hbox18, "hbox18");
  GLADE_HOOKUP_OBJECT (Calculator, optionmenu2, "optionmenu2");
  GLADE_HOOKUP_OBJECT (Calculator, menu2, "menu2");
  GLADE_HOOKUP_OBJECT (Calculator, avi1, "avi1");
  GLADE_HOOKUP_OBJECT (Calculator, ogm1, "ogm1");
  GLADE_HOOKUP_OBJECT (Calculator, mpeg1, "mpeg1");
  GLADE_HOOKUP_OBJECT (Calculator, hbox17, "hbox17");
  GLADE_HOOKUP_OBJECT (Calculator, optionmenu1, "optionmenu1");
  GLADE_HOOKUP_OBJECT (Calculator, menu1, "menu1");
  GLADE_HOOKUP_OBJECT (Calculator, _1x80_cd1, "_1x80_cd1");
  GLADE_HOOKUP_OBJECT (Calculator, _2x80_cd1, "_2x80_cd1");
  GLADE_HOOKUP_OBJECT (Calculator, _1x74_cd1, "_1x74_cd1");
  GLADE_HOOKUP_OBJECT (Calculator, _2x74_cd1, "_2x74_cd1");
  GLADE_HOOKUP_OBJECT (Calculator, dvd1, "dvd1");
  GLADE_HOOKUP_OBJECT (Calculator, custom1, "custom1");
  GLADE_HOOKUP_OBJECT (Calculator, label1, "label1");
  GLADE_HOOKUP_OBJECT (Calculator, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (Calculator, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (Calculator, hbox12, "hbox12");
  GLADE_HOOKUP_OBJECT (Calculator, label6, "label6");
  GLADE_HOOKUP_OBJECT (Calculator, entry3, "entry3");
  GLADE_HOOKUP_OBJECT (Calculator, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (Calculator, label7, "label7");
  GLADE_HOOKUP_OBJECT (Calculator, entry4, "entry4");
  GLADE_HOOKUP_OBJECT (Calculator, label4, "label4");
  GLADE_HOOKUP_OBJECT (Calculator, frame3, "frame3");
  GLADE_HOOKUP_OBJECT (Calculator, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (Calculator, table3, "table3");
  GLADE_HOOKUP_OBJECT (Calculator, label9, "label9");
  GLADE_HOOKUP_OBJECT (Calculator, labelAudio, "labelAudio");
  GLADE_HOOKUP_OBJECT (Calculator, label11, "label11");
  GLADE_HOOKUP_OBJECT (Calculator, labelVideo, "labelVideo");
  GLADE_HOOKUP_OBJECT (Calculator, label17, "label17");
  GLADE_HOOKUP_OBJECT (Calculator, labelTotal, "labelTotal");
  GLADE_HOOKUP_OBJECT (Calculator, table4, "table4");
  GLADE_HOOKUP_OBJECT (Calculator, label12, "label12");
  GLADE_HOOKUP_OBJECT (Calculator, label15, "label15");
  GLADE_HOOKUP_OBJECT (Calculator, labelBitrate, "labelBitrate");
  GLADE_HOOKUP_OBJECT (Calculator, labelBPP, "labelBPP");
  GLADE_HOOKUP_OBJECT (Calculator, label8, "label8");
  GLADE_HOOKUP_OBJECT_NO_REF (Calculator, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (Calculator, doit, "doit");
  GLADE_HOOKUP_OBJECT (Calculator, button1, "button1");
  GLADE_HOOKUP_OBJECT_NO_REF (Calculator, tooltips, "tooltips");

  gtk_widget_grab_focus (entry3);
  return Calculator;
}
Beispiel #28
0
void create_win_pho_gui_simple()
{
//  dbg("create_win_pho .....\n");

  if (top_bin)
    return;

  GtkWidget *vbox_top = gtk_vbox_new (FALSE, 0);
  gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox_top), GTK_ORIENTATION_VERTICAL);

  GtkWidget *event_box_pho;
  if (gtab_in_area_button)
	event_box_pho = gtk_button_new();
  else {
	event_box_pho = gtk_event_box_new();
	gtk_event_box_set_visible_window (GTK_EVENT_BOX(event_box_pho), FALSE);
  }

  gtk_container_set_border_width (GTK_CONTAINER (event_box_pho), 0);

  if (hime_inner_frame) {
    GtkWidget *frame = top_bin = gtk_frame_new(NULL);
    gtk_container_set_border_width (GTK_CONTAINER (frame), 0);
    gtk_container_add (GTK_CONTAINER(gwin_pho), frame);
    gtk_container_add (GTK_CONTAINER (frame), vbox_top);
    gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT);
  } else {
    gtk_container_add (GTK_CONTAINER(gwin_pho), vbox_top);
    top_bin = vbox_top;
  }


  GtkWidget *align = gtk_alignment_new (0, 0, 0, 0);
  label_pho_sele = gtk_label_new(NULL);

  if (!pho_in_row1) {
    gtk_box_pack_start (GTK_BOX (vbox_top), align, FALSE, FALSE, 0);
    gtk_container_add (GTK_CONTAINER (align), label_pho_sele);
  } else {
    GtkWidget *hbox_row1 = gtk_hbox_new (FALSE, 0);
    gtk_box_pack_start (GTK_BOX (vbox_top), hbox_row1, FALSE, FALSE, 0);
    gtk_box_pack_start (GTK_BOX (hbox_row1), event_box_pho, FALSE, FALSE, 0);

    gtk_box_pack_start (GTK_BOX (hbox_row1), align, FALSE, FALSE, 0);
    gtk_container_add (GTK_CONTAINER (align), label_pho_sele);
  }


  hbox_row2 = gtk_hbox_new (FALSE, 0);
  /* This packs the button into the gwin_pho (a gtk container). */
  gtk_container_add (GTK_CONTAINER (vbox_top), hbox_row2);
  label_full = gtk_label_new(_("全"));
  gtk_container_add (GTK_CONTAINER (hbox_row2), label_full);


  if (!pho_in_row1)
    gtk_box_pack_start (GTK_BOX (hbox_row2), event_box_pho, FALSE, FALSE, 0);

  g_signal_connect(G_OBJECT(event_box_pho),"button-press-event",
                   G_CALLBACK(mouse_button_callback), NULL);


  label_pho = gtk_label_new(NULL);

  GtkWidget *frame_pho;
  if (gtab_in_area_button) {
	gtk_container_add (GTK_CONTAINER (event_box_pho), label_pho);
  }
  else {
	frame_pho = gtk_frame_new(NULL);
	gtk_frame_set_shadow_type(GTK_FRAME(frame_pho), GTK_SHADOW_OUT);
	gtk_container_add (GTK_CONTAINER (event_box_pho), frame_pho);
	gtk_container_set_border_width (GTK_CONTAINER (frame_pho), 0);
	gtk_container_add (GTK_CONTAINER (frame_pho), label_pho);
  }

#if 0
  if (left_right_button_tips) {
#if GTK_CHECK_VERSION(2,12,0)
    gtk_widget_set_tooltip_text (event_box_pho, _("左鍵符號,右鍵設定"));
#else
    GtkTooltips *button_gtab_tips = gtk_tooltips_new ();
    gtk_tooltips_set_tip (GTK_TOOLTIPS (button_gtab_tips), event_box_pho, _("左鍵符號,右鍵設定"),NULL);
#endif
  }
#endif

  label_key_codes  = gtk_label_new(NULL);
  gtk_label_set_selectable(GTK_LABEL(label_key_codes), TRUE);
  gtk_box_pack_start (GTK_BOX (hbox_row2), label_key_codes, FALSE, FALSE, 2);

  change_pho_font_size();

  gtk_widget_show_all (gwin_pho);

  gtk_widget_hide(label_key_codes);

  gtk_widget_hide(label_full);
}
Beispiel #29
0
int l_kaskcnsl_v(class iceb_u_str *god,
class iceb_u_str *kas,
class iceb_u_str *kod_cn,
GtkWidget *wpredok)
{
class l_kaskcnsl_v_data data;
char strsql[512];
iceb_u_str kikz;

data.kod_cn_z.new_plus(kod_cn->ravno());
data.god_z.new_plus(god->ravno());
data.kas_z.new_plus(kas->ravno());


if(data.kod_cn_z.getdlinna() >  1)
 {
  data.kod.new_plus(kod_cn->ravno());
  data.god.new_plus(god->ravno());
  data.kas.new_plus(kas->ravno());

  sprintf(strsql,"select * from Kascnsl where god=%s and kod=%s and ks=%s",
  data.god_z.ravno(),
  data.kod_cn_z.ravno(),
  data.kas_z.ravno());
  
  SQL_str row;
  SQLCURSOR cur;
  
  if(iceb_sql_readkey(strsql,&row,&cur,wpredok) < 1)
   {
    iceb_menu_soob(gettext("Не найдена запись для корректировки !"),wpredok);
    return(1);
   }
  
  data.saldo.new_plus(row[3]);
  
  kikz.plus(iceb_kikz(row[4],row[5],wpredok));
  
 }
 
data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(data.window),ICEB_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(data.window),TRUE);

GtkWidget *label=NULL;

if(data.kod_cn_z.getdlinna() <= 1)
 {
  sprintf(strsql,"%s %s",name_system,gettext("Ввод новой записи"));
  label=gtk_label_new(gettext("Ввод новой записи"));
 }
else
 {
  sprintf(strsql,"%s %s",name_system,gettext("Корректировка записи"));
  iceb_u_str repl;
  repl.plus(gettext("Корректировка записи"));
  repl.ps_plus(kikz.ravno());
  label=gtk_label_new(repl.ravno_toutf());
 }

gtk_window_set_title(GTK_WINDOW(data.window),strsql);
gtk_signal_connect(GTK_OBJECT(data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);
gtk_signal_connect_after(GTK_OBJECT(data.window),"key_press_event",GTK_SIGNAL_FUNC(l_kaskcnsl_v_key_press),&data);

if(wpredok != NULL)
 {
  gdk_window_set_cursor(wpredok->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
  //Удерживать окно над породившем его окном всегда
  gtk_window_set_transient_for(GTK_WINDOW(data.window),GTK_WINDOW(wpredok));
  //Закрыть окно если окно предок удалено
  gtk_window_set_destroy_with_parent(GTK_WINDOW(data.window),TRUE);
 }

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox[KOLENTER];
for(int i=0; i < KOLENTER; i++)
 hbox[i] = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);
for(int i=0; i < KOLENTER; i++)
 gtk_container_add (GTK_CONTAINER (vbox), hbox[i]);
gtk_container_add (GTK_CONTAINER (vbox), hboxknop);


GtkTooltips *tooltips_enter[KOLENTER];

label=gtk_label_new(gettext("Год"));
data.entry[E_GOD] = gtk_entry_new_with_max_length (4);
gtk_box_pack_start (GTK_BOX (hbox[E_GOD]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_GOD]), data.entry[E_GOD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_GOD]), "activate",GTK_SIGNAL_FUNC(l_kaskcnsl_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_GOD]),data.god.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_GOD]),(gpointer)E_GOD);

//label=gtk_label_new(gettext("Код кассы"));
//gtk_box_pack_start (GTK_BOX (hbox[E_KAS]), label, FALSE, FALSE, 0);

sprintf(strsql,"%s",gettext("Код кассы"));
data.knopka_enter[E_KAS]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KAS]), data.knopka_enter[E_KAS], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KAS]),"clicked",GTK_SIGNAL_FUNC(kaskcnsl_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KAS]),(gpointer)E_KAS);
tooltips_enter[E_KAS]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KAS],data.knopka_enter[E_KAS],gettext("Выбор кассы"),NULL);

data.entry[E_KAS] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_KAS]), data.entry[E_KAS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KAS]), "activate",GTK_SIGNAL_FUNC(l_kaskcnsl_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KAS]),data.kas.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KAS]),(gpointer)E_KAS);


//label=gtk_label_new(gettext("Код"));
//gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), label, FALSE, FALSE, 0);
sprintf(strsql,"%s",gettext("Код целевого назначения"));
data.knopka_enter[E_KOD]=gtk_button_new_with_label(iceb_u_toutf(strsql));
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), data.knopka_enter[E_KOD], FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(data.knopka_enter[E_KOD]),"clicked",GTK_SIGNAL_FUNC(kaskcnsl_v_e_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka_enter[E_KOD]),(gpointer)E_KOD);
tooltips_enter[E_KOD]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips_enter[E_KOD],data.knopka_enter[E_KOD],gettext("Выбор кода целевого назначения"),NULL);

data.entry[E_KOD] = gtk_entry_new_with_max_length (10);
gtk_box_pack_start (GTK_BOX (hbox[E_KOD]), data.entry[E_KOD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_KOD]), "activate",GTK_SIGNAL_FUNC(l_kaskcnsl_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_KOD]),data.kod.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_KOD]),(gpointer)E_KOD);

label=gtk_label_new(gettext("Сальдо"));
data.entry[E_SALDO] = gtk_entry_new_with_max_length (20);
gtk_box_pack_start (GTK_BOX (hbox[E_SALDO]), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox[E_SALDO]), data.entry[E_SALDO], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (data.entry[E_SALDO]), "activate",GTK_SIGNAL_FUNC(l_kaskcnsl_v_vvod),&data);
gtk_entry_set_text(GTK_ENTRY(data.entry[E_SALDO]),data.saldo.ravno());
gtk_object_set_user_data(GTK_OBJECT(data.entry[E_SALDO]),(gpointer)E_SALDO);

GtkTooltips *tooltips[KOL_PFK];

sprintf(strsql,"F2 %s",gettext("Запись"));
data.knopka[PFK2]=gtk_button_new_with_label(strsql);
tooltips[PFK2]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[PFK2],data.knopka[PFK2],gettext("Запись введеной в меню информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[PFK2]),"clicked",GTK_SIGNAL_FUNC(l_kaskcnsl_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[PFK2]),(gpointer)PFK2);

sprintf(strsql,"F10 %s",gettext("Выход"));
data.knopka[PFK10]=gtk_button_new_with_label(strsql);
tooltips[PFK10]=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips[PFK10],data.knopka[PFK10],gettext("Завершение работы с меню без записи введенной информации"),NULL);
gtk_signal_connect(GTK_OBJECT(data.knopka[PFK10]),"clicked",GTK_SIGNAL_FUNC(l_kaskcnsl_v_knopka),&data);
gtk_object_set_user_data(GTK_OBJECT(data.knopka[PFK10]),(gpointer)PFK10);

gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[PFK2], TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hboxknop), data.knopka[PFK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(data.entry[0]);

gtk_widget_show_all (data.window);

gtk_main();
if(data.voz == 0)
 {
  kod_cn->new_plus(data.kod.ravno());
  god->new_plus(data.god.ravno());
  kas->new_plus(data.kas.ravno());
 }
return(data.voz);
}
Beispiel #30
0
void   lzaktaxiv(class lzaktaxi_data *gl_data)
{
class lzaktaxiv_data v_data;
v_data.zap_zaktaxi.clear_data();

char    strsql[300];
SQL_str row;
short d,m,g;
time_t vrem;
struct tm *bf;
int i=0;

v_data.metkavz=gl_data->metkavz;
v_data.metkarr=gl_data->metkarr;
v_data.metkazapisi=gl_data->metkazapisi;
 

time(&v_data.vremnz);

//v_data->zap_zaktaxi.clear_data();

v_data.zap_zaktaxi.suma.new_plus("1");

if(gl_data->metkazapisi == 1)
 {
  if(gl_data->metkavz == 0)
   return;

  v_data.vrem.new_plus(gl_data->rowv[16]);
  v_data.datz.new_plus(gl_data->rowv[8]);
  v_data.vremz.new_plus(gl_data->rowv[9]);

  SQLCURSOR cur;

  if(gl_data->rowv[0][0] != '\0')
   {
    sprintf(strsql,"select naik from Taxikzz where kod=%s",gl_data->rowv[0]);
    if(iceb_sql_readkey(strsql,&row,&cur,gl_data->window) == 1)
     {
      sprintf(strsql,"%s %s",gl_data->rowv[0],row[0]);
      v_data.zap_zaktaxi.kodzav.new_plus(strsql);

     }
   }


  v_data.zap_zaktaxi.kodk.new_plus(gl_data->rowv[1]);
  if(gl_data->rowv[2][0] != '\0')
   {
    sprintf(strsql,"select fio,gosn from Taxivod where kod='%s'",gl_data->rowv[2]);
    if(sql_readkey(&bd,strsql,&row,&cur) == 1)
     {    
      sprintf(strsql,"%s %s %s",gl_data->rowv[2],row[0],row[1]);
      v_data.zap_zaktaxi.kv.new_plus(strsql);
     }
   }


  v_data.zap_zaktaxi.fio.new_plus(gl_data->rowv[3]);
  v_data.zap_zaktaxi.telef.new_plus(gl_data->rowv[4]);
  v_data.zap_zaktaxi.kolp.new_plus(gl_data->rowv[5]);

  v_data.zap_zaktaxi.datvz.new_plus(iceb_u_datzap(gl_data->rowv[6]));

  v_data.zap_zaktaxi.vremvz.new_plus(gl_data->rowv[7]);
  v_data.zap_zaktaxi.adreso.new_plus(gl_data->rowv[10]);
  v_data.zap_zaktaxi.adresk.new_plus(gl_data->rowv[11]);
  v_data.zap_zaktaxi.koment.new_plus(gl_data->rowv[12]);
  v_data.zap_zaktaxi.suma.new_plus(gl_data->rowv[13]);
  
 }

v_data.window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
//gtk_window_set_position( GTK_WINDOW(v_data.window),ICEB_POS_CENTER);
//gtk_widget_set_usize(GTK_WIDGET(v_data.window), 600,180);
//if(v_data.metkazapisi == 1)

gdk_window_set_cursor(gl_data->window->window,gdk_cursor_new(ICEB_CURSOR_GDITE));
//Удерживать окно над породившем его окном всегда
gtk_window_set_transient_for(GTK_WINDOW(v_data.window),GTK_WINDOW(gl_data->window));

gtk_window_set_modal( GTK_WINDOW(v_data.window) ,TRUE ); 

if(gl_data->metkazapisi == 0)
  sprintf(strsql,"%s %s",NAME_SYSTEM,iceb_u_toutf("Ввод новой записи"));
if(gl_data->metkazapisi == 1)
  sprintf(strsql,"%s %s",NAME_SYSTEM,iceb_u_toutf("Корректировка записи"));
gtk_window_set_title(GTK_WINDOW(v_data.window),strsql);

gtk_signal_connect(GTK_OBJECT(v_data.window),"delete_event",GTK_SIGNAL_FUNC(gtk_widget_destroy),NULL);
gtk_signal_connect(GTK_OBJECT(v_data.window),"destroy",GTK_SIGNAL_FUNC(gtk_main_quit),NULL);

gtk_signal_connect_after(GTK_OBJECT(v_data.window),"key_press_event",GTK_SIGNAL_FUNC(vzaktaxi_key_press),&v_data);
//gtk_signal_connect_after(GTK_OBJECT(v_data.window),"key_release_event",GTK_SIGNAL_FUNC(obr_klav_plansh_o),gl_data);

GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox1 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox2 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox3 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox4 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox5 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox6 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox7 = gtk_hbox_new (FALSE, 0);
GtkWidget *hbox8 = gtk_hbox_new (FALSE, 0);
GtkWidget *hboxknop = gtk_hbox_new (FALSE, 0);

gtk_container_add (GTK_CONTAINER (v_data.window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), hbox1); //Адрес подачи
gtk_container_add (GTK_CONTAINER (vbox), hbox2); //Адрес поездки
gtk_container_add (GTK_CONTAINER (vbox), hbox3); //Код водителя
gtk_container_add (GTK_CONTAINER (vbox), hbox5); //Код завершения
gtk_container_add (GTK_CONTAINER (vbox), hbox); //Телефон, код клиента
gtk_container_add (GTK_CONTAINER (vbox), hbox4); //Коментарий
gtk_container_add (GTK_CONTAINER (vbox), hbox6); //Сумма, количество пассажиров
gtk_container_add (GTK_CONTAINER (vbox), hbox7); //Фамилия клиента
gtk_container_add (GTK_CONTAINER (vbox), hbox8); //Дата , время выполнения заказа
gtk_container_add (GTK_CONTAINER (vbox), hboxknop);


GtkWidget *label=gtk_label_new(iceb_u_toutf("Телефон"));
v_data.entry[E_TELEF] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), v_data.entry[E_TELEF], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_TELEF]), "activate",GTK_SIGNAL_FUNC(get_telef),&v_data);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_TELEF]),v_data.zap_zaktaxi.telef.ravno_toutf());
//gtk_widget_set_usize(v_data.entry[E_TELEF],100,20);

label=gtk_label_new(iceb_u_toutf("Код клиента"));
v_data.entry[E_KODKL] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), v_data.entry[E_KODKL], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_KODKL]), "activate",GTK_SIGNAL_FUNC(kodkl_get),&v_data);
//gtk_widget_set_usize(v_data.entry[E_KODKL],60,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_KODKL]),v_data.zap_zaktaxi.kodk.ravno_toutf());


label=gtk_label_new(iceb_u_toutf("Адрес подачи"));
v_data.entry[E_ADRES_POD] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox1), v_data.entry[E_ADRES_POD], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_ADRES_POD]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.adreso);
//gtk_widget_set_usize(v_data.entry[E_ADRES_POD],200,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_ADRES_POD]),v_data.zap_zaktaxi.adreso.ravno_toutf());


label=gtk_label_new(iceb_u_toutf("Адрес поездки"));
v_data.entry[E_ADRES_POEZ] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox2), v_data.entry[E_ADRES_POEZ], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_ADRES_POEZ]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.adresk);
//gtk_widget_set_usize(v_data.entry[E_ADRES_POEZ],200,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_ADRES_POEZ]),v_data.zap_zaktaxi.adresk.ravno_toutf());



label=gtk_label_new(iceb_u_toutf("Код водителя"));
gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0);

//Создаем выбор водителя
GList *glist=NULL;

SQLCURSOR cur;
sprintf(strsql,"select kod,fio,gosn from Taxivod where sm=0 order by fio asc");
int kolstr=0;
if((kolstr=cur.make_cursor(&bd,strsql)) < 0)
  iceb_msql_error(&bd,gettext("Ошибка создания курсора !"),strsql,NULL);

iceb_u_spisok VOD;
while(cur.read_cursor(&row) != 0)
 {
  sprintf(strsql,"%s %s %s",row[0],row[1],row[2]);
  VOD.plus(iceb_u_toutf(strsql));
 }
if(kolstr == 0)
 VOD.plus(iceb_u_toutf("Не введен список водителей !!!"));

v_data.windowvoditel=gtk_combo_new();


for(i=0 ; i < kolstr; i++)
  glist=g_list_append(glist,(void*)VOD.ravno(i));

gtk_combo_set_popdown_strings(GTK_COMBO(v_data.windowvoditel),glist);
gtk_combo_disable_activate(GTK_COMBO(v_data.windowvoditel));
gtk_box_pack_start (GTK_BOX (hbox3), v_data.windowvoditel, TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (GTK_COMBO(v_data.windowvoditel)->entry), "activate",GTK_SIGNAL_FUNC(voditel_get),&v_data);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(v_data.windowvoditel)->entry),v_data.zap_zaktaxi.kv.ravno_toutf());

label=gtk_label_new(iceb_u_toutf("Коментарий"));
v_data.entry[E_KOMENT] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox4), v_data.entry[E_KOMENT], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_KOMENT]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.koment);
//gtk_widget_set_usize(v_data.entry[E_KOMENT],200,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_KOMENT]),v_data.zap_zaktaxi.koment.ravno_toutf());


label=gtk_label_new(iceb_u_toutf("Код завершения"));
gtk_box_pack_start (GTK_BOX (hbox5), label, FALSE, FALSE, 0);
//Создаем меню кодов завершения

glist=NULL;

sprintf(strsql,"select kod,naik from Taxikzz order by kod asc");
kolstr=0;
if((kolstr=cur.make_cursor(&bd,strsql)) < 0)
  iceb_msql_error(&bd,gettext("Ошибка создания курсора !"),strsql,NULL);

iceb_u_spisok KZV;
while(cur.read_cursor(&row) != 0)
 {
  sprintf(strsql,"%s %s",row[0],row[1]);
  KZV.plus(iceb_u_toutf(strsql));
 }
if(kolstr == 0)
  KZV.plus(iceb_u_toutf("Не введен список кодов завершения !!!"));

v_data.windowkodzav=gtk_combo_new();


for(i=0 ; i < kolstr; i++)
  glist=g_list_append(glist,(void*)KZV.ravno(i));

gtk_combo_set_popdown_strings(GTK_COMBO(v_data.windowkodzav),glist);
gtk_combo_disable_activate(GTK_COMBO(v_data.windowkodzav));
gtk_box_pack_start (GTK_BOX (hbox5), v_data.windowkodzav, TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (GTK_COMBO(v_data.windowkodzav)->entry), "activate",GTK_SIGNAL_FUNC(kodzav_get),&v_data);
//Если не выводить то в меню будет первая строка из списка
//if(gl_data->metkazapisi == 1)
  gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(v_data.windowkodzav)->entry),v_data.zap_zaktaxi.kodzav.ravno_toutf());


label=gtk_label_new(iceb_u_toutf("Сумма"));
v_data.entry[E_SUMA] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox6), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox6), v_data.entry[E_SUMA], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_SUMA]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.suma);
//gtk_widget_set_usize(v_data.entry[E_SUMA],40,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_SUMA]),v_data.zap_zaktaxi.suma.ravno_toutf());

double suma=0.;

if(v_data.zap_zaktaxi.kodk.getdlinna() > 1)
 suma=taxi_saldo(v_data.zap_zaktaxi.kodk.ravno());

sprintf(strsql,"Сальдо: %.2f ",suma);
v_data.label_saldo=gtk_label_new(iceb_u_toutf(strsql));

gtk_box_pack_start (GTK_BOX (hbox6), v_data.label_saldo, FALSE, FALSE, 0);

label=gtk_label_new(iceb_u_toutf("Количество пассажиров"));
v_data.entry[E_KOLIH_PAS] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox6), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox6), v_data.entry[E_KOLIH_PAS], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_KOLIH_PAS]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.kolp);
//gtk_widget_set_usize(v_data.entry[E_KOLIH_PAS],40,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_KOLIH_PAS]),v_data.zap_zaktaxi.kolp.ravno_toutf());


/********************************/

label=gtk_label_new(iceb_u_toutf("ФИО"));
v_data.entry[E_FIO] = gtk_entry_new();
gtk_box_pack_start (GTK_BOX (hbox7), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox7), v_data.entry[E_FIO], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_FIO]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.fio);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_FIO]),v_data.zap_zaktaxi.fio.ravno_toutf());
//gtk_widget_set_usize(v_data.entry[E_FIO],200,20);


label=gtk_label_new(iceb_u_toutf("Дата вып.заказа"));
v_data.entry[E_DATA_ZAK] = gtk_entry_new_with_max_length (11);
gtk_box_pack_start (GTK_BOX (hbox8), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox8), v_data.entry[E_DATA_ZAK], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_DATA_ZAK]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.datvz);
time(&vrem);
bf=localtime(&vrem);  

if(gl_data->metkazapisi == 1)
 {
  gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_DATA_ZAK]),v_data.zap_zaktaxi.datvz.ravno());
//  strcpy(strsql,v_data.zap_zaktaxi.datvz.ravno());
 }
/******
if(gl_data->metkazapisi == 0)
 {
  sprintf(strsql,"%02d.%02d.%04d",bf->tm_mday,bf->tm_mon+1,bf->tm_year+1900);
  v_data.zap_zaktaxi.datvz.new_plus(strsql);
 }
*********/
//gtk_widget_set_usize(v_data.entry[E_DATA_ZAK],68,20);
//gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_DATA_ZAK]),strsql);


label=gtk_label_new(iceb_u_toutf("Время вып.заказа"));
v_data.entry[E_VREM_ZAK] = gtk_entry_new_with_max_length (9);
gtk_box_pack_start (GTK_BOX (hbox8), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox8), v_data.entry[E_VREM_ZAK], TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT (v_data.entry[E_VREM_ZAK]), "activate",GTK_SIGNAL_FUNC(iceb_get_text_str),&v_data.zap_zaktaxi.vremvz);

if(gl_data->metkazapisi == 1)
 {
  iceb_u_rstime(&d,&m,&g,v_data.zap_zaktaxi.vremvz.ravno());
  if(d != 0)
   sprintf(strsql,"%02d:%02d",d,m);
   gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_VREM_ZAK]),strsql);
 }
/*************
if(gl_data->metkazapisi == 0)
 {
  sprintf(strsql,"%02d:%02d",bf->tm_hour,bf->tm_min);
  v_data.zap_zaktaxi.vremvz.new_plus(strsql);
 }

//gtk_widget_set_usize(v_data.entry[E_VREM_ZAK],68,20);
gtk_entry_set_text(GTK_ENTRY(v_data.entry[E_VREM_ZAK]),strsql);

**************/  

sprintf(strsql,"F2 %s",gettext("Запись"));
v_data.knopka[FK2]=gtk_button_new_with_label(strsql);
GtkTooltips *tooltips0=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips0,v_data.knopka[FK2],gettext("Запись введеной в меню информации"),NULL);
gtk_signal_connect(GTK_OBJECT(v_data.knopka[FK2]),"clicked",GTK_SIGNAL_FUNC(vzaktaxi_knopka),&v_data);
gtk_object_set_user_data(GTK_OBJECT(v_data.knopka[FK2]),(gpointer)FK2);
gtk_box_pack_start(GTK_BOX(hboxknop), v_data.knopka[FK2], TRUE, TRUE, 0);

if(gl_data->metkazapisi == 0)
 {
  sprintf(strsql,"F4 %s",gettext("Очистить"));
  v_data.knopka[FK4]=gtk_button_new_with_label(strsql);
//  GtkTooltips *tooltips2=gtk_tooltips_new();
  gtk_tooltips_set_tip(tooltips0,v_data.knopka[FK4],gettext("Очистить меню от введеноой информации. Установить текущее время и дату"),NULL);
  gtk_signal_connect(GTK_OBJECT(v_data.knopka[FK4]),"clicked",GTK_SIGNAL_FUNC(vzaktaxi_knopka),&v_data);
  gtk_object_set_user_data(GTK_OBJECT(v_data.knopka[FK4]),(gpointer)FK4);
  gtk_box_pack_start(GTK_BOX(hboxknop), v_data.knopka[FK4], TRUE, TRUE, 0);
 }

sprintf(strsql,"F10 %s",gettext("Выход"));
v_data.knopka[FK10]=gtk_button_new_with_label(strsql);
GtkTooltips *tooltips1=gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips1,v_data.knopka[FK10],gettext("Завершение работы с меню без записи введенной информации"),NULL);
gtk_signal_connect(GTK_OBJECT(v_data.knopka[FK10]),"clicked",GTK_SIGNAL_FUNC(vzaktaxi_knopka),&v_data);
gtk_object_set_user_data(GTK_OBJECT(v_data.knopka[FK10]),(gpointer)FK10);
gtk_box_pack_start(GTK_BOX(hboxknop), v_data.knopka[FK10], TRUE, TRUE, 0);

gtk_widget_grab_focus(v_data.entry[E_ADRES_POD]);

if(gl_data->metkazapisi == 0)
  clear_menu(&v_data);
gtk_widget_show_all (v_data.window);

gtk_main();

gdk_window_set_cursor(gl_data->window->window,gdk_cursor_new(ICEB_CURSOR));

}