Kaydet (Commit) ae4f2c72 authored tarafından Caolán McNamara's avatar Caolán McNamara

split out custom properties info page and convert to .ui

The CustomPropertiesWindow could be converted to something that inherits from
one of the new containers and remove a load of that custom positioning code but
for now just minimally retro-fit the existing manual position setting code of
the custom scrolling widget.

Change-Id: I6c85286f3652a11bf8c8d827c4986b5b9d745523
üst 8c2da9a4
...@@ -23,18 +23,23 @@ ...@@ -23,18 +23,23 @@
#include "sfx2/dllapi.h" #include "sfx2/dllapi.h"
#include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/DateTime.hpp>
#include <vcl/edit.hxx> #include <com/sun/star/util/Duration.hpp>
#include <vcl/field.hxx>
#include <svtools/stdctrl.hxx>
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
#include <svl/zforlist.hxx>
#include <svtools/headbar.hxx>
#include <svtools/stdctrl.hxx>
#include <svtools/svmedit.hxx> #include <svtools/svmedit.hxx>
#include <unotools/syslocale.hxx>
#include <vcl/edit.hxx>
#include <vcl/field.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/scrbar.hxx> #include <vcl/scrbar.hxx>
#include <svtools/headbar.hxx>
#include <unotools/syslocale.hxx>
#include <svl/zforlist.hxx>
#include <com/sun/star/util/Duration.hpp>
#include "tabdlg.hxx" #include "tabdlg.hxx"
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
...@@ -478,7 +483,10 @@ private: ...@@ -478,7 +483,10 @@ private:
void ValidateLine( CustomPropertyLine* pLine, bool bIsFromTypeBox ); void ValidateLine( CustomPropertyLine* pLine, bool bIsFromTypeBox );
public: public:
CustomPropertiesWindow( Window* pParent, const ResId& rResId ); CustomPropertiesWindow(Window* pParent,
const OUString &rHeaderAccName,
const OUString &rHeaderAccType,
const OUString &rHeaderAccValue);
~CustomPropertiesWindow(); ~CustomPropertiesWindow();
void InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar ); void InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
...@@ -492,16 +500,20 @@ public: ...@@ -492,16 +500,20 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
GetCustomProperties() const; GetCustomProperties() const;
void SetRemovedHdl( const Link& rLink ) { m_aRemovedHdl = rLink; } void SetRemovedHdl( const Link& rLink ) { m_aRemovedHdl = rLink; }
void InitRemoveButton(const ScrollBar &rScrollBar);
void updateLineWidth();
}; };
// class CustomPropertiesControl ----------------------------------------- // class CustomPropertiesControl -----------------------------------------
class CustomPropertiesControl : public Control class CustomPropertiesControl : public VclVBox
{ {
private: private:
HeaderBar m_aHeaderBar; HeaderBar* m_pHeaderBar;
CustomPropertiesWindow m_aPropertiesWin; VclHBox* m_pBody;
ScrollBar m_aVertScroll; CustomPropertiesWindow* m_pPropertiesWin;
ScrollBar* m_pVertScroll;
sal_Int32 m_nThumbPos; sal_Int32 m_nThumbPos;
...@@ -509,16 +521,18 @@ private: ...@@ -509,16 +521,18 @@ private:
DECL_LINK( RemovedHdl, void* ); DECL_LINK( RemovedHdl, void* );
public: public:
CustomPropertiesControl( Window* pParent, const ResId& rResId ); CustomPropertiesControl(Window* pParent);
~CustomPropertiesControl(); ~CustomPropertiesControl();
void AddLine( const ::rtl::OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive ); void AddLine( const ::rtl::OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive );
inline bool AreAllLinesValid() const { return m_aPropertiesWin.AreAllLinesValid(); } inline bool AreAllLinesValid() const { return m_pPropertiesWin->AreAllLinesValid(); }
inline void ClearAllLines() { m_aPropertiesWin.ClearAllLines(); } inline void ClearAllLines() { m_pPropertiesWin->ClearAllLines(); }
inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
GetCustomProperties() const GetCustomProperties() const
{ return m_aPropertiesWin.GetCustomProperties(); } { return m_pPropertiesWin->GetCustomProperties(); }
void Init(VclBuilderContainer& rParent);
virtual void setAllocation(const Size &rAllocation);
}; };
// class SfxCustomPropertiesPage ----------------------------------------- // class SfxCustomPropertiesPage -----------------------------------------
......
...@@ -132,7 +132,6 @@ ...@@ -132,7 +132,6 @@
#define TP_DOCINFODESC (RID_SFX_START+3) #define TP_DOCINFODESC (RID_SFX_START+3)
#define TP_DOCINFODOC (RID_SFX_START+4) #define TP_DOCINFODOC (RID_SFX_START+4)
#define TP_DOCINFOUSER (RID_SFX_START+5)
#define TP_DOCINFORELOAD (RID_SFX_START+13) #define TP_DOCINFORELOAD (RID_SFX_START+13)
#define TP_CUSTOMPROPERTIES (RID_SFX_START+14) #define TP_CUSTOMPROPERTIES (RID_SFX_START+14)
#define TP_DOCINFOSECURITY (RID_SFX_START+215) #define TP_DOCINFOSECURITY (RID_SFX_START+215)
......
This diff is collapsed.
...@@ -32,30 +32,9 @@ ...@@ -32,30 +32,9 @@
// defines --------------------------------------------------------------- // defines ---------------------------------------------------------------
#define FT_INFO1 15
#define ED_INFO1 16
#define FT_INFO2 17
#define ED_INFO2 18
#define FT_INFO3 19
#define ED_INFO3 20
#define FT_INFO4 21
#define ED_INFO4 22
#define BTN_EDITLABEL 34
#define WIN_PROPERTIES 90
#define SB_VERTICAL 91
#define FT_PROPERTIES 92
#define BTN_ADD 94
#define RB_PROPERTY_YES 100 #define RB_PROPERTY_YES 100
#define RB_PROPERTY_NO 101 #define RB_PROPERTY_NO 101
#define STR_HEADER_NAME 90
#define STR_HEADER_TYPE 91
#define STR_HEADER_VALUE 92
#define STR_HEADER_ACTION 93
#define EDIT_FILE_NAME 94
#define PB_OK 100 #define PB_OK 100
#define PB_CANCEL 101 #define PB_CANCEL 101
#define PB_HELP 102 #define PB_HELP 102
......
...@@ -29,139 +29,6 @@ String STR_SFX_NEWOFFICEDOC ...@@ -29,139 +29,6 @@ String STR_SFX_NEWOFFICEDOC
Text [ en-US ] = "%PRODUCTNAME document" ; Text [ en-US ] = "%PRODUCTNAME document" ;
}; };
// TP_DOCINFOUSER --------------------------------------------------------
TabPage TP_DOCINFOUSER
{
HelpId = HID_DOCINFOUSER ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_INFO1
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
};
Edit ED_INFO1
{
HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO1";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
Left = TRUE ;
};
FixedText FT_INFO2
{
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
};
Edit ED_INFO2
{
HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO2";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 43 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
Left = TRUE ;
};
FixedText FT_INFO3
{
Pos = MAP_APPFONT ( 6 , 58 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
};
Edit ED_INFO3
{
HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO3";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 69 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
Left = TRUE ;
};
FixedText FT_INFO4
{
Pos = MAP_APPFONT ( 6 , 84 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
};
Edit ED_INFO4
{
HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO4";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 95 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ;
Left = TRUE ;
};
PushButton BTN_EDITLABEL
{
HelpID = "sfx2:PushButton:TP_DOCINFOUSER:BTN_EDITLABEL";
Pos = MAP_APPFONT ( 194 , 165 ) ;
Size = MAP_APPFONT ( 60 , RSC_CD_PUSHBUTTON_HEIGHT ) ;
Text [ en-US ] = "~Info fields..." ;
};
};
Control SFX_CTRL_CUSTOM_PROPERTIES
{
HelpId = HID_CTRL_CUSTOMPROPERTIES;
Pos = MAP_APPFONT ( 6 , 18 ) ;
Size = MAP_APPFONT ( 248 , 141 ) ;
Border = TRUE;
DialogControl = TRUE;
Window WIN_PROPERTIES
{
OutputSize = TRUE ;
Pos = MAP_APPFONT ( 0 , 10 ) ;
Size = MAP_APPFONT ( 240 , 134 ) ;
DialogControl = TRUE;
};
ScrollBar SB_VERTICAL
{
Pos = MAP_APPFONT ( 238 , 10 ) ;
Size = MAP_APPFONT ( 8 , 129 ) ;
VScroll = TRUE;
};
String STR_HEADER_NAME
{
Text [ en-US ] = "Name" ;
};
String STR_HEADER_TYPE
{
Text [ en-US ] = "Type" ;
};
String STR_HEADER_VALUE
{
Text [ en-US ] = "Value" ;
};
String STR_HEADER_ACTION
{
Text [ en-US ] = "" ;
};
};
// TP_CUSTOMPROPERTIES ---------------------------------------------------
TabPage TP_CUSTOMPROPERTIES
{
HelpId = HID_TP_CUSTOMPROPERTIES ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_PROPERTIES
{
Pos = MAP_APPFONT ( 6 , 7 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
Text [ en-US ] = "~Properties" ;
};
PushButton BTN_ADD
{
HelpID = "sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD";
Pos = MAP_APPFONT( 204 , 165 );
Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "~Add";
};
};
ComboBox SFX_CB_PROPERTY_NAME ComboBox SFX_CB_PROPERTY_NAME
{ {
Pos = MAP_APPFONT ( 0 , 2 ) ; Pos = MAP_APPFONT ( 0 , 2 ) ;
...@@ -317,6 +184,7 @@ TabDialog SID_DOCINFO ...@@ -317,6 +184,7 @@ TabDialog SID_DOCINFO
OutputSize = TRUE ; OutputSize = TRUE ;
SVLook = TRUE ; SVLook = TRUE ;
Moveable = TRUE ; Moveable = TRUE ;
Sizeable = TRUE ;
Text [ en-US ] = "Properties of " ; Text [ en-US ] = "Properties of " ;
TabControl 1 TabControl 1
{ {
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR" #define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR"
#define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES" #define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES"
#define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT" #define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT"
#define HID_DOCINFOUSER "SFX2_HID_DOCINFOUSER"
#define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL" #define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL"
#define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS" #define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS"
#define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME" #define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME"
...@@ -135,8 +134,6 @@ ...@@ -135,8 +134,6 @@
#define HID_WARNING_ALIENFORMAT "SFX2_HID_WARNING_ALIENFORMAT" #define HID_WARNING_ALIENFORMAT "SFX2_HID_WARNING_ALIENFORMAT"
#define HID_HELP_ONSTARTUP_BOX "SFX2_HID_HELP_ONSTARTUP_BOX" #define HID_HELP_ONSTARTUP_BOX "SFX2_HID_HELP_ONSTARTUP_BOX"
#define HID_DLG_CHECKFORONLINEUPDATE "SFX2_HID_DLG_CHECKFORONLINEUPDATE" #define HID_DLG_CHECKFORONLINEUPDATE "SFX2_HID_DLG_CHECKFORONLINEUPDATE"
#define HID_TP_CUSTOMPROPERTIES "SFX2_HID_TP_CUSTOMPROPERTIES"
#define HID_CTRL_CUSTOMPROPERTIES "SFX2_HID_CTRL_CUSTOMPROPERTIES"
#define HID_CTRL_CUSTOMPROPS_YES_NO "SFX2_HID_CTRL_CUSTOMPROPS_YES_NO" #define HID_CTRL_CUSTOMPROPS_YES_NO "SFX2_HID_CTRL_CUSTOMPROPS_YES_NO"
#define HID_DLG_CUSTOMPROPS_DURATION "SFX2_HID_DLG_CUSTOMPROPS_DURATION" #define HID_DLG_CUSTOMPROPS_DURATION "SFX2_HID_DLG_CUSTOMPROPS_DURATION"
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11) #define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11)
#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12) #define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12)
#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13) #define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13)
#define SFX_CTRL_CUSTOM_PROPERTIES (RID_SFX_SFXLOCAL_START + 14)
// Images ---------------------------------------------------------------- // Images ----------------------------------------------------------------
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<object class="GtkGrid" id="grid12"> <object class="GtkGrid" id="CustomInfoPage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">2</property> <property name="top_attach">3</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
...@@ -47,6 +47,57 @@ ...@@ -47,6 +47,57 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
</object> </object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Name</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Type</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="value">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Value</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
......
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