Re: patch: fixes and enhancements to the format table dialog box

From: Dom Lachowicz (domlachowicz@yahoo.com)
Date: Wed Sep 03 2003 - 08:36:01 EDT

  • Next message: Rui Miguel Seabra: "and I was called paranoid and FUD-monger..."

    Please commit this.

    Dom

    --- Jordi Mas <jmas@softcatala.org> wrote:
    >
    > - Now you can close the dialog box (before it was
    > impossible!)
    > - Some controls were showing wrong text (fix it)
    > - Implemented the "Apply to:" combobox that allows
    > select
    >
    > Requesting OK to commit
    >
    > Jordi,
    >
    > --
    >
    > Jordi Mas i Hernāndez - Abiword developer -
    > http://www.abisource.com
    > jmas@softcatala.org - Softcatalā member -
    > http://www.softcatala.org
    > - Personal Homepage
    > http://www.softcatala.org/~jmas
    >
    >
    >
    > > Index:
    src/wp/ap/win/ap_Win32Dialog_FormatTable.cpp
    >
    ===================================================================
    > RCS file:
    >
    /cvsroot/abi/src/wp/ap/win/ap_Win32Dialog_FormatTable.cpp,v
    > retrieving revision 1.6
    > diff -u -r1.6 ap_Win32Dialog_FormatTable.cpp
    > --- src/wp/ap/win/ap_Win32Dialog_FormatTable.cpp 16
    > Apr 2003 09:54:12 -0000 1.6
    > +++ src/wp/ap/win/ap_Win32Dialog_FormatTable.cpp 3
    > Sep 2003 12:02:46 -0000
    > @@ -146,6 +146,7 @@
    > int x, y;
    > UT_uint32 w,h;
    > RECT rect;
    > + int nItem;
    > const XAP_StringSet * pSS =
    > m_pApp->getStringSet();
    > DWORD dwColor = GetSysColor(COLOR_BTNFACE);
    > UT_RGBColor
    >
    Color(GetRValue(dwColor),GetGValue(dwColor),GetBValue(dwColor));
    > @@ -159,11 +160,12 @@
    > /* Localise controls*/
    > _DSX(FORMATTABLE_BTN_CANCEL, DLG_Close);
    > _DSX(FORMATTABLE_BTN_APPLY, DLG_Apply);
    > - _DS(FORMATTABLE_TEXT_BACKGROUND,
    > DLG_FormatTable_Background);
    > + _DS(FORMATTABLE_TEXT_BACKGROUND,
    > DLG_FormatTable_Color);
    > _DS(FORMATTABLE_TEXT_PREVIEW,
    > DLG_FormatTable_Preview);
    > - _DS(FORMATTABLE_TEXT_BORDER,
    > DLG_FormatTable_Border_Color);
    > - _DS(FORMATTABLE_TEXT_BORDERS,
    > DLG_FormatTable_Borders);
    > + _DS(FORMATTABLE_TEXT_BORDERS,
    > DLG_FormatTable_Border_Color);
    > + _DS(FORMATTABLE_TEXT_BORDER,
    > DLG_FormatTable_Color);
    > _DS(FORMATTABLE_TEXT_BACKGROUNDS,
    > DLG_FormatTable_Background);
    > + _DS(FORMATTABLE_TEXT_APPLYTO,
    > DLG_FormatTable_Apply_To);
    >
    > SetWindowText(hWnd,
    > pSS->getValue(AP_STRING_ID_DLG_FormatTableTitle));
    >
    > @@ -193,8 +195,24 @@
    > CheckDlgButton(m_hwndDlg,
    > AP_RID_DIALOG_FORMATTABLE_BMP_BOTTOM,
    > getBottomToggled() ? BST_CHECKED: BST_UNCHECKED);
    > CheckDlgButton(m_hwndDlg,
    > AP_RID_DIALOG_FORMATTABLE_BMP_RIGHT,
    > getRightToggled() ? BST_CHECKED: BST_UNCHECKED);
    > CheckDlgButton(m_hwndDlg,
    > AP_RID_DIALOG_FORMATTABLE_BMP_LEFT, getLeftToggled()
    > ? BST_CHECKED: BST_UNCHECKED);
    > -
    > +
    > + /* Combo Values for Applyto*/
    > + HWND hCombo = GetDlgItem(hWnd,
    > AP_RID_DIALOG_FORMATTABLE_COMBO_APPLYTO);
    > +
    > + nItem = SendMessage(hCombo, CB_ADDSTRING, 0,
    > (WPARAM)
    >
    pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Selection));
    >
    > + SendMessage(hCombo, CB_SETITEMDATA, nItem,
    > FORMAT_TABLE_SELECTION);
    > +
    > + nItem = SendMessage(hCombo, CB_ADDSTRING, 0,
    > (WPARAM)
    >
    pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Row));
    >
    > + SendMessage(hCombo, CB_SETITEMDATA, nItem,
    > FORMAT_TABLE_ROW);
    > +
    > + nItem = SendMessage(hCombo, CB_ADDSTRING, 0,
    > (WPARAM)
    >
    pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Column));
    >
    > + SendMessage(hCombo, CB_SETITEMDATA, nItem,
    > FORMAT_TABLE_COLUMN);
    > +
    > + nItem = SendMessage(hCombo, CB_ADDSTRING, 0,
    > (WPARAM)
    >
    pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Table));
    >
    > + SendMessage(hCombo, CB_SETITEMDATA, nItem,
    > FORMAT_TABLE_TABLE);
    >
    > + SendMessage(hCombo, CB_SETCURSEL, 0, 0);
    > +
    > XAP_Win32DialogHelper::s_centerDialog(hWnd);
    > return 1;
    > }
    > @@ -294,16 +312,30 @@
    > }
    >
    > return 1;
    > - }
    > -
    > + }
    > +
    > case AP_RID_DIALOG_FORMATTABLE_BTN_CANCEL:
    > m_answer = AP_Dialog_FormatTable::a_CLOSE;
    > destroy();
    > + EndDialog(hWnd,0);
    > return 1;
    >
    > case AP_RID_DIALOG_FORMATTABLE_BTN_APPLY:
    > + {
    > + int nSelected, nData = FORMAT_TABLE_SELECTION;
    > +
    > + HWND hCombo = GetDlgItem(hWnd,
    > AP_RID_DIALOG_FORMATTABLE_COMBO_APPLYTO);
    > +
    > + nSelected = SendMessage(hCombo, CB_GETCURSEL, 0,
    > 0);
    > +
    > + if (nSelected!=CB_ERR)
    > + nData = SendMessage(hCombo, CB_GETITEMDATA,
    > nSelected, 0);
    > +
    > + setApplyFormatTo((_FormatTable) nData);
    > +
    > m_answer = AP_Dialog_FormatTable::a_OK;
    > applyChanges();
    > + }
    > return 1;
    >
    > default: // we did not handle this
    > notification
    > Index: src/wp/ap/win/ap_Win32Res_FormatTable.rc2
    >
    ===================================================================
    > RCS file:
    >
    /cvsroot/abi/src/wp/ap/win/ap_Win32Res_FormatTable.rc2,v
    > retrieving revision 1.3
    > diff -u -r1.3 ap_Win32Res_FormatTable.rc2
    > --- src/wp/ap/win/ap_Win32Res_FormatTable.rc2 16 Apr
    > 2003 09:54:14 -0000 1.3
    > +++ src/wp/ap/win/ap_Win32Res_FormatTable.rc2 3 Sep
    > 2003 12:02:51 -0000
    > @@ -41,6 +41,8 @@
    > #define AP_RID_DIALOG_FORMATTABLE_BTN_APPLY 1010
    > #define AP_RID_DIALOG_FORMATTABLE_TEXT_BORDERS
    > 1011
    > #define AP_RID_DIALOG_FORMATTABLE_TEXT_BACKGROUNDS
    > 1012
    > +#define AP_RID_DIALOG_FORMATTABLE_COMBO_APPLYTO
    > 1013
    > +#define AP_RID_DIALOG_FORMATTABLE_TEXT_APPLYTO
    > 1014
    >
    > #define AP_RID_DIALOG_FORMATTABLE_BTN_CANCEL
    > IDCANCEL
    >
    > @@ -52,7 +54,7 @@
    > // NOTE -- these placeholder strings get overridden
    > at runtime
    > // NOTE -- they're just here to make sizing easier
    >
    > -AP_RID_DIALOG_FORMATTABLE DIALOG 0, 0, 307, 172
    > +AP_RID_DIALOG_FORMATTABLE DIALOG 0, 0, 307, 201
    > STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION |
    > WS_SYSMENU
    > CAPTION "Format Table"
    > FONT 8, "MS Sans Serif"
    > @@ -74,23 +76,26 @@
    > CONTROL
    >
    "",AP_RID_DIALOG_FORMATTABLE_STATIC_PREVIEW,"Static",
    >
    > SS_BLACKFRAME,177,40,86,76,WS_EX_CLIENTEDGE
    > LTEXT "Background Color",
    > -
    > AP_RID_DIALOG_FORMATTABLE_TEXT_BACKGROUND,15,91,60,8
    >
    > - CONTROL
    >
    "",AP_RID_DIALOG_FORMATTABLE_BTN_BACKCOLOR,"Button",BS_OWNERDRAW
    > |
    > - WS_TABSTOP,82,88,22,14
    >
    > - LTEXT "Border
    >
    Color",AP_RID_DIALOG_FORMATTABLE_TEXT_BORDER,16,29,53,8
    >
    > - CONTROL
    >
    "",AP_RID_DIALOG_FORMATTABLE_BTN_BORDERCOLOR,"Button",BS_OWNERDRAW
    > |
    > - WS_TABSTOP,82,27,22,14
    >
    > - DEFPUSHBUTTON
    >
    "Apply",AP_RID_DIALOG_FORMATTABLE_BTN_APPLY,243,153,50,
    > +
    > AP_RID_DIALOG_FORMATTABLE_TEXT_BACKGROUND,18,70,77,8
    > + CONTROL
    > "",AP_RID_DIALOG_FORMATTABLE_BTN_BACKCOLOR,"Button",
    > + BS_OWNERDRAW |
    > WS_TABSTOP,100,67,22,14
    > + LTEXT "Border
    > Color",AP_RID_DIALOG_FORMATTABLE_TEXT_BORDER,16,
    > + 26,69,8
    > + CONTROL
    >
    "",AP_RID_DIALOG_FORMATTABLE_BTN_BORDERCOLOR,"Button",
    >
    === message truncated ===

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com



    This archive was generated by hypermail 2.1.4 : Wed Sep 03 2003 - 08:48:33 EDT