Kaydet (Commit) 70af05cf authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Convert Calc page header/footer content to Widget UI

Change-Id: I26465f69a7fa50fa58643c00225376a82ba8a7fc
üst dd5b15eb
......@@ -214,6 +214,14 @@
generic-name="Cursor Reference Edit" parent="foruilo-RefEdit"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Text View" name="sclo-ScEditWindow"
generic-name="Text View" parent="GtkTextView"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Combo Image Button" name="sclo-ScExtIButton"
generic-name="Combo Image Button" parent="GtkButton"
icon-name="widget-gtk-button"/>
<glade-widget-class title="Open Document ListBox" name="dbulo-OpenDocumentListBox"
generic-name="Open Document ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/>
......
......@@ -68,11 +68,12 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/externaldata \
sc/uiconfig/scalc/ui/formatcellsdialog \
sc/uiconfig/scalc/ui/goalseekdlg \
sc/uiconfig/scalc/ui/headerfootercontent \
sc/uiconfig/scalc/ui/insertname \
sc/uiconfig/scalc/ui/insertsheet \
sc/uiconfig/scalc/ui/managenamesdialog \
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/sheetprintpage \
sc/uiconfig/scalc/ui/selectrange \
sc/uiconfig/scalc/ui/selectsource \
......
......@@ -509,13 +509,13 @@
#define STR_CHANGED_MOVE_REJECTION_WARNING 402
#define STR_CHANGED_DELETE_REJECTION_WARNING 403
#define STR_HF_NONE_IN_BRACKETS 404
#define STR_HF_OF 405
#define STR_HF_OF_QUESTION 406
#define STR_HF_CREATED_BY 407
#define STR_HF_CONFIDENTIAL 408
#define STR_HF_CUSTOMIZED 409
#define STR_HF_CUSTOM_FOOTER 410
// #define STR_HF_NONE_IN_BRACKETS 404
// #define STR_HF_OF 405
// #define STR_HF_OF_QUESTION 406
// #define STR_HF_CREATED_BY 407
// #define STR_HF_CONFIDENTIAL 408
// #define STR_HF_CUSTOMIZED 409
//#define STR_HF_CUSTOM_FOOTER 410
#define STR_ERR_DATAPILOT_INPUT 411
......
......@@ -142,12 +142,6 @@
#define HID_SCPAGE_OPREDLINE "SC_HID_SCPAGE_OPREDLINE"
#define HID_SC_REDLIN_CTR "SC_HID_SC_REDLIN_CTR"
//Kopf/FusszeilenDlg: Contextmenue fuer Dateiname
#define HID_FCOMMAND_TITEL "SC_HID_FCOMMAND_TITEL"
#define HID_FCOMMAND_FILENAME "SC_HID_FCOMMAND_FILENAME"
#define HID_FCOMMAND_PATH "SC_HID_FCOMMAND_PATH"
// Hilfe IDs fuer Objekt- und Werkzeugleisten (max.10) -----------------------
#define HID_SC_TOOLBOX_TOOLS "SC_HID_SC_TOOLBOX_TOOLS"
......
......@@ -979,7 +979,7 @@
#define RID_SCPAGE_AREAS (SC_DIALOGS_START + 44)
#define RID_SCDLG_STYLES_PAR (SC_DIALOGS_START + 46)
#define RID_SCDLG_STYLES_PAGE (SC_DIALOGS_START + 48)
#define RID_HFBASE (SC_DIALOGS_START + 49)
#define RID_SCDLG_HFEDIT (SC_DIALOGS_START + 50)
#define RID_SCDLG_HFEDIT_ALL (SC_DIALOGS_START + 51)
#define RID_SCDLG_HFED_HEADER (SC_DIALOGS_START + 52)
......
......@@ -37,7 +37,7 @@ public:
Window* pParent,
const SfxItemSet& rCoreSet,
const String& rPageStyle,
sal_uInt16 nResId = RID_SCDLG_HFEDIT );
sal_uInt16 nResId = RID_SCDLG_HFEDIT );
~ScHFEditDlg();
......
......@@ -32,7 +32,9 @@ protected:
virtual void Select();
public:
ScPopupMenu() : nSel(0),bHit(false) {}
ScPopupMenu(const ResId& rRes) : PopupMenu(rRes),nSel(0),bHit(false) {}
sal_uInt16 GetSelected() const { return nSel; }
sal_Bool WasHit() const { return bHit; }
};
......
......@@ -21,6 +21,7 @@
#define SCUI_TPHFEDIT_HXX
#include "tphfedit.hxx"
//#include <boost/graph/graph_concepts.hpp>
//===================================================================
enum ScHFEntryId
......@@ -47,41 +48,46 @@ class ScHFEditPage : public SfxTabPage
{
public:
virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet );
virtual void Reset ( const SfxItemSet& rCoreSet );
virtual void Reset ( const SfxItemSet& rCoreSet );
void SetNumType(SvxNumType eNumType);
void ClearTextAreas();
protected:
ScHFEditPage( Window* pParent,
sal_uInt16 nResId,
const SfxItemSet& rCoreSet,
sal_uInt16 nWhich, bool bHeader );
sal_uInt16 nWhich,
bool bHeader );
virtual ~ScHFEditPage();
private:
FixedText aFtLeft;
ScEditWindow aWndLeft;
FixedText aFtCenter;
ScEditWindow aWndCenter;
FixedText aFtRight;
ScEditWindow aWndRight;
FixedText maFtDefinedHF;
ListBox maLbDefined;
FixedText maFtCustomHF;
ImageButton aBtnText;
ScExtIButton aBtnFile;
ImageButton aBtnTable;
ImageButton aBtnPage;
ImageButton aBtnLastPage;
ImageButton aBtnDate;
ImageButton aBtnTime;
FixedLine aFlInfo;
FixedInfo aFtInfo;
ScPopupMenu aPopUpFile;
sal_uInt16 nWhich;
String aCmdArr[6];
//FixedText aFtLeft;
ScEditWindow* m_pWndLeft;
//FixedText aFtCenter;
ScEditWindow* m_pWndCenter;
//FixedText aFtRight;
ScEditWindow* m_pWndRight;
FixedText* m_pFtDefinedHF;
ListBox* m_pLbDefined;
FixedText* m_pFtCustomHF;
PushButton* m_pBtnText;
ScExtIButton* m_pBtnFile;
PushButton* m_pBtnTable;
PushButton* m_pBtnPage;
PushButton* m_pBtnLastPage;
PushButton* m_pBtnDate;
PushButton* m_pBtnTime;
FixedText* m_pFtConfidential;
FixedText* m_pFtPage;
FixedText* m_pFtOfQuestion;
FixedText* m_pFtOf;
FixedText* m_pFtNone;
FixedText* m_pFtCreatedBy;
FixedText* m_pFtCustomized;
sal_uInt16 nWhich;
OUString aCmdArr[6];
private:
#ifdef _TPHFEDIT_CXX
......@@ -95,7 +101,7 @@ private:
bool IsDateEntry(EditTextObject* pTextObj);
bool IsExtFileNameEntry(EditTextObject* pTextObj);
DECL_LINK( ListHdl_Impl, ListBox* );
DECL_LINK( ClickHdl, ImageButton* );
DECL_LINK( ClickHdl, PushButton* );
DECL_LINK( MenuHdl, ScExtIButton* );
#endif
};
......
......@@ -56,6 +56,7 @@ class SC_DLLPUBLIC ScEditWindow : public Control
{
public:
ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc );
ScEditWindow( Window* pParent, WinBits nBits , ScEditWindowLocation eLoc );
~ScEditWindow();
using Control::SetFont;
......@@ -72,6 +73,8 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
inline ScHeaderEditEngine* GetEditEngine() const {return pEdEngine;}
void SetLocation(ScEditWindowLocation eLoc) { eLocation = eLoc; }
protected:
virtual void Paint( const Rectangle& rRect );
virtual void MouseMove( const MouseEvent& rMEvt );
......@@ -81,6 +84,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt );
virtual void GetFocus();
virtual void LoseFocus();
virtual void Resize();
private:
ScHeaderEditEngine* pEdEngine;
......@@ -116,6 +120,7 @@ protected:
public:
ScExtIButton(Window* pParent, const ResId& rResId );
ScExtIButton(Window* pParent, WinBits nBits );
void SetPopupMenu(PopupMenu* pPopUp);
......
......@@ -54,7 +54,7 @@ ScHFEditDlg::ScHFEditDlg( SfxViewFrame* pFrameP,
Window* pParent,
const SfxItemSet& rCoreSet,
const String& rPageStyle,
sal_uInt16 nResIdP )
sal_uInt16 nResIdP )
: SfxTabDialog( pFrameP, pParent, ScResId( nResIdP ), &rCoreSet )
{
eNumType = ((const SvxPageItem&)rCoreSet.Get(ATTR_PAGE)).GetNumType();
......
......@@ -19,25 +19,9 @@
#include "sc.hrc"
#define FT_LEFT 1
#define FT_CENTER 2
#define FT_RIGHT 3
#define FT_INFO 4
#define WND_LEFT 1
#define WND_CENTER 2
#define WND_RIGHT 3
#define BTN_TEXT 1
#define BTN_PAGE 2
#define BTN_PAGES 3
#define BTN_DATE 4
#define BTN_TIME 5
#define BTN_FILE 6
#define BTN_TABLE 7
#define RID_POPUP_FCOMMAND 10
#define FILE_COMMAND_TITEL 11
#define FILE_COMMAND_FILENAME 12
#define FILE_COMMAND_PATH 13
#define FL_INFO 14
......
......@@ -429,190 +429,8 @@ TabDialog RID_SCDLG_HFEDIT_LEFTFOOTER
};
};
//------------------------------------------------------------------------
// ScTpHFEdit
//------------------------------------------------------------------------
TabPage RID_HFBASE
{
Hide = TRUE ;
HelpId = HID_SCPAGE_HFEDIT ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_LEFT
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Left area" ;
};
FixedText FT_CENTER
{
Pos = MAP_APPFONT ( 90 , 6 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "~Center area" ;
};
FixedText FT_RIGHT
{
Pos = MAP_APPFONT ( 174 , 6 ) ;
Size = MAP_APPFONT ( 75 , 10 ) ;
Text [ en-US ] = "R~ight area" ;
};
FixedText FT_HF_DEFINED
{
Pos = MAP_APPFONT ( 12 , 102 ) ;
Size = MAP_APPFONT ( 76 , 10 ) ;
Text [ en-US ] = "Hea~der" ;
};
FixedText FT_HF_CUSTOM
{
Pos = MAP_APPFONT ( 12 , 124 ) ;
Size = MAP_APPFONT ( 76 , 10 ) ;
Text [ en-US ] = "Custom header" ;
};
ImageButton BTN_TEXT
{
HelpId = HID_SC_HF_TEXT ;
Pos = MAP_APPFONT ( 90 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Text Attributes" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "text.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
ImageButton BTN_FILE
{
HelpId = HID_SC_HF_FILE ;
Pos = MAP_APPFONT ( 113 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Title" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "file.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
Menu RID_POPUP_FCOMMAND
{
ItemList =
{
MenuItem
{
Identifier = FILE_COMMAND_TITEL ;
HelpID = HID_FCOMMAND_TITEL ;
Text [ en-US ] = "Title";
};
MenuItem
{
Identifier = FILE_COMMAND_FILENAME;
HelpID = HID_FCOMMAND_FILENAME;
RadioCheck = TRUE ;
Text [ en-US ] = "File Name";
};
MenuItem
{
Identifier = FILE_COMMAND_PATH;
HelpID = HID_FCOMMAND_PATH;
RadioCheck = TRUE ;
Text [ en-US ] = "Path/File Name";
};
};
};
ImageButton BTN_TABLE
{
HelpId = HID_SC_HF_TABLE ;
Pos = MAP_APPFONT ( 130 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Sheet Name" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "table.png" ; };
MaskColor = STD_MASKCOLOR;
};
};
ImageButton BTN_PAGE
{
HelpId = HID_SC_HF_PAGE ;
Pos = MAP_APPFONT ( 150 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Page" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "page.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
ImageButton BTN_PAGES
{
HelpId = HID_SC_HF_PAGES ;
Pos = MAP_APPFONT ( 167 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Pages" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "pages.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
ImageButton BTN_DATE
{
HelpId = HID_SC_HF_DATE ;
Pos = MAP_APPFONT ( 187 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Date" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "date.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
ImageButton BTN_TIME
{
HelpId = HID_SC_HF_TIME ;
Pos = MAP_APPFONT ( 204 , 122 ) ;
Size = MAP_APPFONT ( 15 , 15 ) ;
TabStop = TRUE ;
QuickHelpText [ en-US ] = "Time" ;
ButtonImage = Image
{
ImageBitmap = Bitmap { File = "time.png" ; };
MaskColor = STD_MASKCOLOR ;
};
};
FixedText FT_INFO
{
Pos = MAP_APPFONT ( 12 , 155 ) ;
Size = MAP_APPFONT ( 240 , 24 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Use the buttons to change the font or insert field commands such as date, time, etc." ;
};
FixedLine FL_INFO
{
Pos = MAP_APPFONT ( 6 , 144 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Note" ;
};
};
// Kombinationen: Header/Footer links/rechts
// die Eingabefenster jeweils mit eigener ID, sonst aus RID_HFBASE kopiert
TabPage RID_SCPAGE_HFED_HL < RID_HFBASE
TabPage RID_SCPAGE_HFED_HL
{
Hide = TRUE ;
HelpId = HID_SCPAGE_HFED_HL ;
......@@ -651,7 +469,7 @@ TabPage RID_SCPAGE_HFED_HL < RID_HFBASE
};
};
TabPage RID_SCPAGE_HFED_HR < RID_HFBASE
TabPage RID_SCPAGE_HFED_HR
{
Hide = TRUE ;
HelpId = HID_SCPAGE_HFED_HR ;
......@@ -690,7 +508,7 @@ TabPage RID_SCPAGE_HFED_HR < RID_HFBASE
};
};
TabPage RID_SCPAGE_HFED_FL < RID_HFBASE
TabPage RID_SCPAGE_HFED_FL
{
Hide = TRUE ;
HelpId = HID_SCPAGE_HFED_FL ;
......@@ -729,7 +547,7 @@ TabPage RID_SCPAGE_HFED_FL < RID_HFBASE
};
};
TabPage RID_SCPAGE_HFED_FR < RID_HFBASE
TabPage RID_SCPAGE_HFED_FR
{
Hide = TRUE ;
HelpId = HID_SCPAGE_HFED_FR ;
......
......@@ -111,6 +111,54 @@ ScEditWindow::ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLo
pEdEngine->InsertView( pEdView );
}
ScEditWindow::ScEditWindow( Window* pParent, WinBits nBits, ScEditWindowLocation eLoc )
: Control( pParent, nBits ),
eLocation(eLoc),
pAcc(NULL)
{
EnableRTL(false);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
SetMapMode( MAP_TWIP );
SetPointer( POINTER_TEXT );
SetBackground( aBgColor );
Size aSize( GetOutputSize() );
aSize.Height() *= 4;
pEdEngine = new ScHeaderEditEngine( EditEngine::CreatePool(), sal_True );
pEdEngine->SetPaperSize( aSize );
pEdEngine->SetRefDevice( this );
ScHeaderFieldData aData;
lcl_GetFieldData( aData );
// Feldbefehle:
pEdEngine->SetData( aData );
pEdEngine->SetControlWord( pEdEngine->GetControlWord() | EE_CNTRL_MARKFIELDS );
mbRTL = ScGlobal::IsSystemRTL();
if (mbRTL)
pEdEngine->SetDefaultHorizontalTextDirection(EE_HTEXTDIR_R2L);
pEdView = new EditView( pEdEngine, this );
pEdView->SetOutputArea( Rectangle( Point(0,0), GetOutputSize() ) );
pEdView->SetBackgroundColor( aBgColor );
pEdEngine->InsertView( pEdView );
}
void ScEditWindow::Resize()
{
Size aOutputSize(GetOutputSize());
Size aSize(aOutputSize);
aSize.Height() *= 4;
pEdEngine->SetPaperSize(aSize);
pEdView->SetOutputArea(Rectangle(Point(0,0), aOutputSize));
Control::Resize();
}
// -----------------------------------------------------------------------
ScEditWindow::~ScEditWindow()
......@@ -126,6 +174,11 @@ ScEditWindow::~ScEditWindow()
delete pEdView;
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScEditWindow(Window *pParent, VclBuilder::stringmap &)
{
return new ScEditWindow (pParent, WB_BORDER|WB_TABSTOP, Left);
}
// -----------------------------------------------------------------------
void ScEditWindow::SetNumType(SvxNumType eNumType)
......@@ -340,14 +393,25 @@ void ScEditWindow::LoseFocus()
}
ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId )
: ImageButton(pParent,rResId),
pPopupMenu(NULL)
: ImageButton(pParent,rResId), pPopupMenu(NULL)
{
nSelected=0;
aTimer.SetTimeout(600);
SetDropDown( true);
}
ScExtIButton::ScExtIButton(Window* pParent, WinBits nBits )
: ImageButton(pParent,nBits), pPopupMenu(NULL)
{
nSelected=0;
aTimer.SetTimeout(600);
SetDropDown( true);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScExtIButton(Window *pParent, VclBuilder::stringmap &)
{
return new ScExtIButton (pParent, 0);// WB_BORDER|WB_TABSTOP);
}
void ScExtIButton::SetPopupMenu(PopupMenu* pPopUp)
{
pPopupMenu=pPopUp;
......
......@@ -1619,40 +1619,40 @@ Resource RID_GLOBSTR
Text[ en-US ] = "WARNING: This action may have resulted in references to the deleted area not being restored.";
};
String STR_HF_NONE_IN_BRACKETS
{
Text [ en-US ] = "(none)";
};
String STR_HF_OF
{
Text [ en-US ] = "of";
};
// String STR_HF_NONE_IN_BRACKETS
// {
// Text [ en-US ] = "(none)";
// };
//
// String STR_HF_OF
// {
// Text [ en-US ] = "of";
// };
//
// String STR_HF_OF_QUESTION
// {
// Text [ en-US ] = "of ?";
// };
//
// String STR_HF_CREATED_BY
// {
// Text [ en-US ] = "Created by";
// };
//
// String STR_HF_CONFIDENTIAL
// {
// Text [ en-US ] = "Confidential";
// };
//
// String STR_HF_CUSTOMIZED
// {
// Text [ en-US ] = "Customized";
// };
String STR_HF_OF_QUESTION
{
Text [ en-US ] = "of ?";
};
String STR_HF_CREATED_BY
{
Text [ en-US ] = "Created by";
};
String STR_HF_CONFIDENTIAL
{
Text [ en-US ] = "Confidential";
};
String STR_HF_CUSTOMIZED
{
Text [ en-US ] = "Customized";
};
String STR_HF_CUSTOM_FOOTER
{
Text [ en-US ] = "Custom footer";
};
// String STR_HF_CUSTOM_FOOTER
// {
// Text [ en-US ] = "Custom footer";
// };
String STR_UNDO_CHINESE_TRANSLATION
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment