void AP_Dialog_FormatTable::ConstructWindowName(void) { const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); gchar * tmp = NULL; UT_XML_cloneNoAmpersands(tmp, pSS->getValue(AP_STRING_ID_DLG_FormatTableTitle)); BuildWindowName(static_cast<char *>(m_WindowName),static_cast<char*>(tmp),sizeof(m_WindowName)); FREEP(tmp); }
void AP_Dialog_SplitCells::ConstructWindowName(void) { const XAP_StringSet * pSS = m_pApp->getStringSet(); gchar * tmp = NULL; UT_XML_cloneNoAmpersands(tmp, pSS->getValue(AP_STRING_ID_DLG_SplitCellsTitle)); BuildWindowName(static_cast<char *>(m_WindowName),static_cast<char*>(tmp),sizeof(m_WindowName)); FREEP(tmp); }
void Markup(GtkWidget * widget, const XAP_StringSet * /*pSS*/, char *string) { gchar * unixstr = NULL; // used for conversions UT_XML_cloneNoAmpersands(unixstr, string); UT_String markupStr(UT_String_sprintf(gtk_label_get_label (GTK_LABEL(widget)), unixstr)); gtk_label_set_markup (GTK_LABEL(widget), markupStr.c_str()); FREEP(unixstr); }
void AP_Dialog_FormatFrame::ConstructWindowName(void) { const XAP_StringSet * pSS = m_pApp->getStringSet(); gchar * tmp = NULL; UT_uint32 title_width = 26; UT_XML_cloneNoAmpersands(tmp, pSS->getValue(AP_STRING_ID_DLG_FormatFrameTitle)); BuildWindowName(static_cast<char *>(m_WindowName),static_cast<char*>(tmp),title_width); FREEP(tmp); }
/*! * Localizes a button given the string id */ void localizeButton(GtkWidget * widget, const XAP_StringSet * pSS, XAP_String_Id id) { gchar * unixstr = NULL; // used for conversions UT_UTF8String s; pSS->getValueUTF8(id,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); gtk_button_set_label (GTK_BUTTON(widget), unixstr); FREEP(unixstr); }
void AP_Dialog_Modeless::ConstructWindowName(void) { const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); std::string s; pSS->getValueUTF8(getWindowTitleStringId(), s); s = UT_XML_cloneNoAmpersands( s ); m_WindowName = BuildWindowName( s.c_str() ); }
/*! * Localizes the label of a Menu widget given the string id */ void localizeMenu(GtkWidget * widget, const XAP_StringSet * pSS, XAP_String_Id id) { // UT_ASSERT(GTK_IS_MENU(widget)); gchar * unixstr = NULL; // used for conversions UT_UTF8String s; pSS->getValueUTF8(id,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); gtk_menu_set_title (GTK_MENU(widget), unixstr); FREEP(unixstr); }
/*! * Localizes the label of a widget given the string id * It formats the label using the current label of the widget as a format * string. The current label is assumed to be something like * "<span size="larger">%s</span>". */ void localizeLabelMarkup(GtkWidget * widget, const XAP_StringSet * pSS, XAP_String_Id id) { gchar * unixstr = NULL; // used for conversions UT_UTF8String s; pSS->getValueUTF8(id,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); UT_String markupStr(UT_String_sprintf(gtk_label_get_label (GTK_LABEL(widget)), unixstr)); gtk_label_set_markup (GTK_LABEL(widget), markupStr.c_str()); FREEP(unixstr); }
void XAP_Dialog_Insert_Symbol::ConstructWindowName() { const XAP_StringSet * pSS = m_pApp->getStringSet(); gchar * tmp = NULL; UT_UTF8String sTitle; pSS->getValueUTF8(XAP_STRING_ID_DLG_Insert_SymbolTitle,sTitle); UT_XML_cloneNoAmpersands(tmp, sTitle.utf8_str()); BuildWindowName((char *) m_WindowName,(char*)tmp,sizeof(m_WindowName)); FREEP(tmp); }
std::string UT_XML_cloneNoAmpersands( const std::string& src ) { gchar* rszDest = 0; bool rc = UT_XML_cloneNoAmpersands( rszDest, src.c_str() ); if( !rc ) return src; std::string ret = rszDest; FREEP(rszDest); return ret; }
GtkWidget * AP_UnixDialog_Paragraph::_constructWindow(void) { const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); GtkWidget * windowParagraph; GtkWidget * windowContents; GtkWidget * vboxMain; GtkWidget * buttonTabs; GtkWidget * buttonOK; GtkWidget * buttonCancel; gchar * unixstr = NULL; UT_UTF8String s; pSS->getValueUTF8(AP_STRING_ID_DLG_Para_ParaTitle,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); windowParagraph = abiDialogNew("paragraph dialog", TRUE, unixstr); FREEP(unixstr); vboxMain = gtk_dialog_get_content_area(GTK_DIALOG(windowParagraph)); gtk_container_set_border_width (GTK_CONTAINER(vboxMain), 10); windowContents = _constructWindowContents(windowParagraph); gtk_box_pack_start (GTK_BOX (vboxMain), windowContents, FALSE, TRUE, 5); buttonCancel = abiAddStockButton(GTK_DIALOG(windowParagraph), GTK_STOCK_CANCEL, BUTTON_CANCEL); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_ButtonTabs,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); buttonTabs = abiAddButton (GTK_DIALOG(windowParagraph), unixstr, BUTTON_TABS); FREEP(unixstr); buttonOK = abiAddStockButton(GTK_DIALOG(windowParagraph), GTK_STOCK_OK, BUTTON_OK); m_windowMain = windowParagraph; m_buttonOK = buttonOK; m_buttonCancel = buttonCancel; m_buttonTabs = buttonTabs; return windowParagraph; }
void AP_Dialog_Lists::ConstructWindowName(void) { const XAP_StringSet * pSS = m_pApp->getStringSet(); gchar * tmp = NULL; UT_uint32 title_width = 33; UT_UTF8String s; pSS->getValueUTF8(AP_STRING_ID_DLG_Lists_Title,s); UT_XML_cloneNoAmpersands(tmp, s.utf8_str()); BuildWindowName((char *) m_WindowName,(char*)tmp,title_width); FREEP(tmp); }
GtkWidget * AP_UnixDialog_Paragraph::_constructWindowContents(GtkWidget *windowMain) { // grab the string set const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); GtkWidget * vboxContents; GtkWidget * tabMain; GtkWidget * boxSpacing; GtkWidget * hboxAlignment; GtkComboBox * listAlignment; GtkWidget * spinbuttonLeft; GtkWidget * spinbuttonRight; GtkComboBox * listSpecial; GtkWidget * spinbuttonBy; GtkWidget * spinbuttonBefore; GtkWidget * spinbuttonAfter; GtkComboBox * listLineSpacing; GtkWidget * spinbuttonAt; GtkWidget * labelAlignment; GtkWidget * labelBy; GtkWidget * hboxIndentation; GtkWidget * labelIndentation; GtkWidget * labelLeft; GtkWidget * labelRight; GtkWidget * labelSpecial; GtkWidget * hseparator3; GtkWidget * hboxSpacing; GtkWidget * labelSpacing; GtkWidget * labelAfter; GtkWidget * labelLineSpacing; GtkWidget * labelAt; GtkWidget * hseparator1; GtkWidget * labelBefore; GtkWidget * labelIndents; GtkWidget * boxBreaks; GtkWidget * hboxPagination; GtkWidget * labelPagination; GtkWidget * hseparator5; GtkWidget * checkbuttonWidowOrphan; GtkWidget * checkbuttonKeepLines; GtkWidget * checkbuttonPageBreak; GtkWidget * checkbuttonSuppress; GtkWidget * checkbuttonHyphenate; GtkWidget * hseparator6; GtkWidget * checkbuttonKeepNext; GtkWidget * labelBreaks; GtkWidget * checkbuttonDomDirection; gchar * unixstr = NULL; vboxContents = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vboxContents); tabMain = gtk_notebook_new (); gtk_widget_show (tabMain); gtk_box_pack_start (GTK_BOX (vboxContents), tabMain, FALSE, TRUE, 0); // "Indents and Spacing" page #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON boxSpacing = gtk_table_new (3, 4, FALSE); #else boxSpacing = gtk_table_new (7, 4, FALSE); #endif gtk_widget_show (boxSpacing); gtk_table_set_row_spacings (GTK_TABLE(boxSpacing), 5); gtk_table_set_col_spacings (GTK_TABLE(boxSpacing), 5); gtk_container_set_border_width (GTK_CONTAINER(boxSpacing), 5); UT_UTF8String s; pSS->getValueUTF8(AP_STRING_ID_DLG_Para_TabLabelIndentsAndSpacing,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelIndents = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelIndents); gtk_notebook_append_page (GTK_NOTEBOOK (tabMain), boxSpacing, labelIndents); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelAlignment,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelAlignment = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelAlignment); gtk_table_attach ( GTK_TABLE(boxSpacing), labelAlignment, 0,1, 0,1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelAlignment), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelAlignment), 1, 0.5); hboxAlignment = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxAlignment); listAlignment = GTK_COMBO_BOX(gtk_combo_box_new ()); XAP_makeGtkComboBoxText(listAlignment, G_TYPE_INT); /**/ g_object_set_data(G_OBJECT(listAlignment), WIDGET_ID_TAG, (gpointer) id_MENU_ALIGNMENT); gtk_widget_show (GTK_WIDGET(listAlignment)); gtk_box_pack_start (GTK_BOX (hboxAlignment), GTK_WIDGET(listAlignment), FALSE, FALSE, 0); gtk_table_attach ( GTK_TABLE(boxSpacing), hboxAlignment, 1,2, 0,1, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); XAP_appendComboBoxTextAndInt(listAlignment, " ", 0); // add an empty menu option to fix bug 594 pSS->getValueUTF8(AP_STRING_ID_DLG_Para_AlignLeft,s); XAP_appendComboBoxTextAndInt(listAlignment, s.utf8_str(), align_LEFT); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_AlignCentered,s); XAP_appendComboBoxTextAndInt(listAlignment, s.utf8_str(), align_CENTERED); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_AlignRight,s); XAP_appendComboBoxTextAndInt(listAlignment, s.utf8_str(), align_RIGHT); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_AlignJustified,s); XAP_appendComboBoxTextAndInt(listAlignment, s.utf8_str(), align_JUSTIFIED); gtk_combo_box_set_active(listAlignment, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_DomDirection,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonDomDirection = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonDomDirection), WIDGET_ID_TAG, (gpointer) id_CHECK_DOMDIRECTION); gtk_widget_show (checkbuttonDomDirection); gtk_table_attach ( GTK_TABLE(boxSpacing), checkbuttonDomDirection, 3,4,0,1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); hboxIndentation = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxIndentation); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelIndentation,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelIndentation = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelIndentation); gtk_box_pack_start (GTK_BOX (hboxIndentation), labelIndentation, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (labelIndentation), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelIndentation), 0, 0.5); hseparator3 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator3); gtk_box_pack_start (GTK_BOX (hboxIndentation), hseparator3, TRUE, TRUE, 0); gtk_table_attach ( GTK_TABLE(boxSpacing), hboxIndentation, 0,4, 1,2, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelLeft,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelLeft = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelLeft); gtk_table_attach ( GTK_TABLE(boxSpacing), labelLeft, 0,1, 2,3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelLeft), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelLeft), 1, 0.5); // spinbuttonLeft_adj = gtk_adjustment_new (0, 0, 100, 0.1, 10, 10); // spinbuttonLeft = gtk_spin_button_new (NULL, 1, 1); spinbuttonLeft = gtk_entry_new(); g_object_ref (spinbuttonLeft); g_object_set_data_full (G_OBJECT (windowMain), "spinbuttonLeft", spinbuttonLeft, (GDestroyNotify) g_object_unref); /**/ g_object_set_data(G_OBJECT(spinbuttonLeft), WIDGET_ID_TAG, (gpointer) id_SPIN_LEFT_INDENT); gtk_widget_show (spinbuttonLeft); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonLeft, 1,2, 2,3, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelRight,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelRight = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelRight); gtk_table_attach ( GTK_TABLE(boxSpacing), labelRight, 0,1, 3,4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelRight), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelRight), 1, 0.5); // spinbuttonRight_adj = gtk_adjustment_new (0, 0, 100, 0.1, 10, 10); // spinbuttonRight = gtk_spin_button_new (NULL, 1, 1); spinbuttonRight = gtk_entry_new(); /**/ g_object_set_data(G_OBJECT(spinbuttonRight), WIDGET_ID_TAG, (gpointer) id_SPIN_RIGHT_INDENT); gtk_widget_show (spinbuttonRight); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonRight, 1,2, 3,4, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelSpecial,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelSpecial = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelSpecial); gtk_table_attach ( GTK_TABLE(boxSpacing), labelSpecial, 2,3, 2,3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON gtk_label_set_justify (GTK_LABEL (labelSpecial), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelSpecial), 1, 0.5); #else gtk_label_set_justify (GTK_LABEL (labelSpecial), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelSpecial), 0, 0.5); #endif listSpecial = GTK_COMBO_BOX(gtk_combo_box_new ()); XAP_makeGtkComboBoxText(listSpecial, G_TYPE_INT); /**/ g_object_set_data(G_OBJECT(listSpecial), WIDGET_ID_TAG, (gpointer) id_MENU_SPECIAL_INDENT); gtk_widget_show (GTK_WIDGET(listSpecial)); #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON gtk_table_attach ( GTK_TABLE(boxSpacing), (GtkWidget*)listSpecial, 3, 4, 2, 3, (GtkAttachOptions) (GTK_SHRINK), (GtkAttachOptions) (GTK_FILL), 0, 0); #else gtk_table_attach ( GTK_TABLE(boxSpacing), (GtkWidget*)listSpecial, 2,3, 3,4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); #endif XAP_appendComboBoxTextAndInt(listSpecial, " ", 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpecialNone,s); XAP_appendComboBoxTextAndInt(listSpecial, s.utf8_str(), indent_NONE); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpecialFirstLine,s); XAP_appendComboBoxTextAndInt(listSpecial, s.utf8_str(), indent_FIRSTLINE); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpecialHanging,s); XAP_appendComboBoxTextAndInt(listSpecial, s.utf8_str(), indent_HANGING); gtk_combo_box_set_active(listSpecial, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelBy,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelBy = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelBy); #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON gtk_table_attach ( GTK_TABLE(boxSpacing), labelBy, 2, 3, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelBy), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelBy), 1, 0.5); #else gtk_table_attach ( GTK_TABLE(boxSpacing), labelBy, 3,4, 2,3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelBy), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelBy), 0, 0.5); #endif // spinbuttonBy_adj = gtk_adjustment_new (0.5, 0, 100, 0.1, 10, 10); // spinbuttonBy = gtk_spin_button_new (NULL, 1, 1); spinbuttonBy = gtk_entry_new(); /**/ g_object_set_data(G_OBJECT(spinbuttonBy), WIDGET_ID_TAG, (gpointer) id_SPIN_SPECIAL_INDENT); gtk_widget_show (spinbuttonBy); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonBy, 3,4, 3,4, #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON (GtkAttachOptions) (GTK_SHRINK|GTK_EXPAND), #else (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), #endif (GtkAttachOptions) (GTK_FILL), 0, 0); hboxSpacing = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxSpacing); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelSpacing,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelSpacing = gtk_label_new (unixstr); FREEP(unixstr); gtk_box_pack_start (GTK_BOX (hboxSpacing), labelSpacing, FALSE, FALSE, 0); gtk_label_set_justify (GTK_LABEL (labelSpacing), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelSpacing), 0, 0.5); hseparator1 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_box_pack_start (GTK_BOX (hboxSpacing), hseparator1, TRUE, TRUE, 0); gtk_table_attach ( GTK_TABLE(boxSpacing), hboxSpacing, 0,4, 4,5, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelBefore,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelBefore = gtk_label_new (unixstr); FREEP(unixstr); gtk_table_attach ( GTK_TABLE(boxSpacing), labelBefore, 0,1, 5,6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelBefore), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelBefore), 1, 0.5); // spinbuttonBefore_adj = gtk_adjustment_new (0, 0, 1500, 0.1, 10, 10); // spinbuttonBefore = gtk_spin_button_new (NULL, 1, 1); spinbuttonBefore = gtk_entry_new(); /**/ g_object_set_data(G_OBJECT(spinbuttonBefore), WIDGET_ID_TAG, (gpointer) id_SPIN_BEFORE_SPACING); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonBefore, 1,2, 5,6, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelAfter,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelAfter = gtk_label_new (unixstr); FREEP(unixstr); gtk_table_attach ( GTK_TABLE(boxSpacing), labelAfter, 0,1, 6,7, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelAfter), GTK_JUSTIFY_RIGHT); gtk_misc_set_alignment (GTK_MISC (labelAfter), 1, 0.5); // spinbuttonAfter_adj = gtk_adjustment_new (0, 0, 1500, 0.1, 10, 10); // spinbuttonAfter = gtk_spin_button_new (NULL, 1, 1); spinbuttonAfter = gtk_entry_new(); /**/ g_object_set_data(G_OBJECT(spinbuttonAfter), WIDGET_ID_TAG, (gpointer) id_SPIN_AFTER_SPACING); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonAfter, 1,2, 6,7, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelLineSpacing,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelLineSpacing = gtk_label_new (unixstr); FREEP(unixstr); gtk_table_attach ( GTK_TABLE(boxSpacing), labelLineSpacing, 2,3, 5,6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelLineSpacing), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelLineSpacing), 0, 0.5); listLineSpacing = GTK_COMBO_BOX(gtk_combo_box_new ()); XAP_makeGtkComboBoxText(listLineSpacing, G_TYPE_INT); /**/ g_object_set_data(G_OBJECT(listLineSpacing), WIDGET_ID_TAG, (gpointer) id_MENU_SPECIAL_SPACING); gtk_table_attach ( GTK_TABLE(boxSpacing), GTK_WIDGET(listLineSpacing), 2,3, 6,7, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); XAP_appendComboBoxTextAndInt(listLineSpacing, " ", 0); // add an empty menu option to fix bug 594 pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingSingle,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_SINGLE); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingHalf,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_ONEANDHALF); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingDouble,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_DOUBLE); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingAtLeast,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_ATLEAST); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingExactly,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_EXACTLY); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_SpacingMultiple,s); XAP_appendComboBoxTextAndInt(listLineSpacing, s.utf8_str(), spacing_MULTIPLE); gtk_combo_box_set_active(listLineSpacing, 0); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelAt,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelAt = gtk_label_new (unixstr); FREEP(unixstr); gtk_table_attach ( GTK_TABLE(boxSpacing), labelAt, 3,4, 5,6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); gtk_label_set_justify (GTK_LABEL (labelAt), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelAt), 0, 0.5); // spinbuttonAt_adj = gtk_adjustment_new (0.5, 0, 100, 0.1, 10, 10); // spinbuttonAt = gtk_spin_button_new (NULL, 1, 1); spinbuttonAt = gtk_entry_new(); /**/ g_object_set_data(G_OBJECT(spinbuttonAt), WIDGET_ID_TAG, (gpointer) id_SPIN_SPECIAL_SPACING); gtk_table_attach ( GTK_TABLE(boxSpacing), spinbuttonAt, 3,4, 6,7, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0); //TODO: In hildon only hide components for future features #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON #else gtk_widget_show (labelSpacing); gtk_widget_show (hseparator1); gtk_widget_show (labelBefore); gtk_widget_show (spinbuttonBefore); gtk_widget_show (labelAfter); gtk_widget_show (spinbuttonAfter); gtk_widget_show (labelLineSpacing); gtk_widget_show (GTK_WIDGET(listLineSpacing)); gtk_widget_show (labelAt); gtk_widget_show (spinbuttonAt); #endif /* HAVE_HILDON */ // The "Line and Page Breaks" page boxBreaks = gtk_table_new (6, 2, FALSE); gtk_widget_show (boxBreaks); gtk_table_set_row_spacings (GTK_TABLE(boxBreaks), 5); gtk_table_set_col_spacings (GTK_TABLE(boxBreaks), 5); gtk_container_set_border_width (GTK_CONTAINER(boxBreaks), 5); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_TabLabelLineAndPageBreaks,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelBreaks = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelBreaks); gtk_notebook_append_page (GTK_NOTEBOOK (tabMain), boxBreaks, labelBreaks); // Pagination headline hboxPagination = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxPagination); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelPagination,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelPagination = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelPagination); gtk_box_pack_start (GTK_BOX (hboxPagination), labelPagination, FALSE, FALSE, 0); hseparator5 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator5); gtk_box_pack_start (GTK_BOX (hboxPagination), hseparator5, TRUE, TRUE, 0); gtk_table_attach ( GTK_TABLE(boxBreaks), hboxPagination, 0,2, 0,1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0); // Pagination toggles pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushWidowOrphanControl,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonWidowOrphan = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonWidowOrphan), WIDGET_ID_TAG, (gpointer) id_CHECK_WIDOW_ORPHAN); gtk_widget_show (checkbuttonWidowOrphan); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonWidowOrphan, 0,1, 1,2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushKeepWithNext,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonKeepNext = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonKeepNext), WIDGET_ID_TAG, (gpointer) id_CHECK_KEEP_NEXT); gtk_widget_show (checkbuttonKeepNext); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonKeepNext, 1,2, 1,2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushKeepLinesTogether,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonKeepLines = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonKeepLines), WIDGET_ID_TAG, (gpointer) id_CHECK_KEEP_LINES); gtk_widget_show (checkbuttonKeepLines); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonKeepLines, 0,1, 2,3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushPageBreakBefore,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonPageBreak = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonPageBreak), WIDGET_ID_TAG, (gpointer) id_CHECK_PAGE_BREAK); gtk_widget_show (checkbuttonPageBreak); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonPageBreak, 1,2, 2,3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); hseparator6 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator6); gtk_table_attach ( GTK_TABLE(boxBreaks), hseparator6, 0,2, 3,4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushSuppressLineNumbers,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonSuppress = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonSuppress), WIDGET_ID_TAG, (gpointer) id_CHECK_SUPPRESS); gtk_widget_show (checkbuttonSuppress); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonSuppress, 0,1, 4,5, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_PushNoHyphenate,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); checkbuttonHyphenate = gtk_check_button_new_with_label (unixstr); FREEP(unixstr); /**/ g_object_set_data(G_OBJECT(checkbuttonHyphenate), WIDGET_ID_TAG, (gpointer) id_CHECK_NO_HYPHENATE); gtk_widget_show (checkbuttonHyphenate); gtk_table_attach ( GTK_TABLE(boxBreaks), checkbuttonHyphenate, 0,1, 5,6, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, 0 ); // End of notebook. Next comes the preview area. #if !defined(EMBEDDED_TARGET) || EMBEDDED_TARGET != EMBEDDED_TARGET_HILDON GtkWidget * hboxPreview; GtkWidget * labelPreview; GtkWidget * hboxPreviewFrame; GtkWidget * framePreview; GtkWidget * drawingareaPreview; GtkWidget * hseparator4; hboxPreview = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxPreview); pSS->getValueUTF8(AP_STRING_ID_DLG_Para_LabelPreview,s); UT_XML_cloneNoAmpersands(unixstr, s.utf8_str()); labelPreview = gtk_label_new (unixstr); FREEP(unixstr); gtk_widget_show (labelPreview); gtk_box_pack_start (GTK_BOX (hboxPreview), labelPreview, FALSE, TRUE, 0); gtk_label_set_justify (GTK_LABEL (labelPreview), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (labelPreview), 0, 0.5); hseparator4 = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator4); gtk_box_pack_start (GTK_BOX (hboxPreview), hseparator4, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vboxContents), hboxPreview, TRUE, TRUE, 0); hboxPreviewFrame = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_widget_show (hboxPreviewFrame); framePreview = gtk_frame_new (NULL); gtk_widget_show (framePreview); gtk_box_pack_start (GTK_BOX (hboxPreviewFrame), framePreview, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vboxContents), hboxPreviewFrame, FALSE, TRUE, 0); gtk_widget_set_size_request (framePreview, 400, 150); gtk_frame_set_shadow_type (GTK_FRAME (framePreview), GTK_SHADOW_NONE); drawingareaPreview = createDrawingArea (); gtk_widget_show (drawingareaPreview); gtk_container_add (GTK_CONTAINER (framePreview), drawingareaPreview); #endif // Update member variables with the important widgets that // might need to be queried or altered later. m_windowContents = vboxContents; m_listAlignment = GTK_WIDGET(listAlignment); // m_spinbuttonLeft_adj = spinbuttonLeft_adj; m_spinbuttonLeft = spinbuttonLeft; // m_spinbuttonRight_adj = spinbuttonRight_adj; m_spinbuttonRight = spinbuttonRight; m_listSpecial = GTK_WIDGET(listSpecial); // m_spinbuttonBy_adj = spinbuttonBy_adj; m_spinbuttonBy = spinbuttonBy; // m_spinbuttonBefore_adj = spinbuttonBefore_adj; m_spinbuttonBefore = spinbuttonBefore; // m_spinbuttonAfter_adj = spinbuttonAfter_adj; m_spinbuttonAfter = spinbuttonAfter; m_listLineSpacing = GTK_WIDGET(listLineSpacing); // m_spinbuttonAt_adj = spinbuttonAt_adj; m_spinbuttonAt = spinbuttonAt; #if defined(EMBEDDED_TARGET) && EMBEDDED_TARGET == EMBEDDED_TARGET_HILDON m_drawingareaPreview = NULL; #else m_drawingareaPreview = drawingareaPreview; #endif m_checkbuttonWidowOrphan = checkbuttonWidowOrphan; m_checkbuttonKeepLines = checkbuttonKeepLines; m_checkbuttonPageBreak = checkbuttonPageBreak; m_checkbuttonSuppress = checkbuttonSuppress; m_checkbuttonHyphenate = checkbuttonHyphenate; m_checkbuttonKeepNext = checkbuttonKeepNext; m_checkbuttonDomDirection = checkbuttonDomDirection; return vboxContents; }