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

adapt code for select range .ui conversion

Change-Id: Ib53b42a340da04276ce005efb22d19fda617e29a
üst 2705fc72
...@@ -17,6 +17,7 @@ $(eval $(call gb_UI_add_uifiles,modules/scalc,\ ...@@ -17,6 +17,7 @@ $(eval $(call gb_UI_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/insertsheet \ sc/uiconfig/scalc/ui/insertsheet \
sc/uiconfig/scalc/ui/printeroptions \ sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/sheetprintpage \ sc/uiconfig/scalc/ui/sheetprintpage \
sc/uiconfig/scalc/ui/selectrange \
sc/uiconfig/scalc/ui/sortcriteriapage \ sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortkey \ sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \ sc/uiconfig/scalc/ui/sortoptionspage \
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
#define HID_SC_NAVIGATOR "SC_HID_SC_NAVIGATOR" #define HID_SC_NAVIGATOR "SC_HID_SC_NAVIGATOR"
#define HID_SC_SELENTRY_LIST "SC_HID_SC_SELENTRY_LIST"
#define HID_SC_GROUP_COLS "SC_HID_SC_GROUP_COLS" #define HID_SC_GROUP_COLS "SC_HID_SC_GROUP_COLS"
#define HID_SC_GROUP_ROWS "SC_HID_SC_GROUP_ROWS" #define HID_SC_GROUP_ROWS "SC_HID_SC_GROUP_ROWS"
......
...@@ -716,8 +716,8 @@ ...@@ -716,8 +716,8 @@
#define SCSTR_MODIFY (STR_START + 19) #define SCSTR_MODIFY (STR_START + 19)
#define SCSTR_SHOWTABLE (STR_START + 20) #define SCSTR_SHOWTABLE (STR_START + 20)
#define SCSTR_HIDDENTABLES (STR_START + 21) #define SCSTR_HIDDENTABLES (STR_START + 21)
#define SCSTR_SELECTDB (STR_START + 22)
#define SCSTR_AREAS (STR_START + 23)
#define SCSTR_TABLE (STR_START + 24) #define SCSTR_TABLE (STR_START + 24)
#define SCSTR_NAME (STR_START + 25) #define SCSTR_NAME (STR_START + 25)
#define SCSTR_INSTABLE (STR_START + 26) #define SCSTR_INSTABLE (STR_START + 26)
...@@ -1035,7 +1035,7 @@ ...@@ -1035,7 +1035,7 @@
#define RID_SCDLG_ROW_OPT (SC_DIALOGS_START + 107) #define RID_SCDLG_ROW_OPT (SC_DIALOGS_START + 107)
// derivations from RID_SCDLG_SELENTRY // derivations from RID_SCDLG_SELENTRY
#define RID_SCDLG_SELECTDB (SC_DIALOGS_START + 108)
#define RID_SCDLG_SHOW_TAB (SC_DIALOGS_START + 109) #define RID_SCDLG_SHOW_TAB (SC_DIALOGS_START + 109)
// derivations from RID_SCDLG_GROUP // derivations from RID_SCDLG_GROUP
......
...@@ -395,11 +395,7 @@ public: ...@@ -395,11 +395,7 @@ public:
SCTAB nTabCount, bool bFromFile) = 0; SCTAB nTabCount, bool bFromFile) = 0;
virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
sal_uInt16 nResId, const std::vector<String> &rEntryList ) = 0;
const String& aTitle,
const String& aLbTitle,
const std::vector<String> &rEntryList,
int nId ) = 0;
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg
virtual AbstractScMetricInputDlg * CreateScMetricInputDlg ( Window* pParent, //add for ScMetricInputDlg virtual AbstractScMetricInputDlg * CreateScMetricInputDlg ( Window* pParent, //add for ScMetricInputDlg
......
...@@ -1000,25 +1000,10 @@ AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg( ...@@ -1000,25 +1000,10 @@ AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(
// add for ScSelEntryDlg begin // add for ScSelEntryDlg begin
AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Window* pParent, AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Window* pParent,
sal_uInt16 nResId, const std::vector<String> &rEntryList )
const String& aTitle,
const String& aLbTitle,
const std::vector<String> &rEntryList,
int nId )
{ {
ScSelEntryDlg * pDlg=NULL; ScSelEntryDlg * pDlg = new ScSelEntryDlg( pParent, rEntryList );
switch ( nId ) return new AbstractScSelEntryDlg_Impl( pDlg );
{
case RID_SCDLG_SELECTDB :
pDlg = new ScSelEntryDlg( pParent, nResId,aTitle, aLbTitle, rEntryList );
break;
default:
break;
}
if ( pDlg )
return new AbstractScSelEntryDlg_Impl( pDlg );
return 0;
} }
// add for ScSelEntryDlg end // add for ScSelEntryDlg end
......
...@@ -462,11 +462,7 @@ public: ...@@ -462,11 +462,7 @@ public:
SCTAB nTabCount, bool bFromFile); SCTAB nTabCount, bool bFromFile);
virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
sal_uInt16 nResId, const std::vector<String> &rEntryList );
const String& aTitle,
const String& aLbTitle,
const std::vector<String> &rEntryList,
int nId );
virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg
int nId); int nId);
......
...@@ -34,23 +34,14 @@ ...@@ -34,23 +34,14 @@
class ScSelEntryDlg : public ModalDialog class ScSelEntryDlg : public ModalDialog
{ {
private: private:
FixedLine aFlLbTitle; ListBox* m_pLb;
ListBox aLb;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
DECL_LINK( DblClkHdl, void * ); DECL_LINK( DblClkHdl, void * );
public: public:
ScSelEntryDlg( Window* pParent, ScSelEntryDlg(Window* pParent, const std::vector<String> &rEntryList);
sal_uInt16 nResId,
const String& aTitle, OUString GetSelectEntry() const;
const String& aLbTitle,
const std::vector<String> &rEntryList );
~ScSelEntryDlg();
String GetSelectEntry() const;
}; };
......
...@@ -30,43 +30,29 @@ ...@@ -30,43 +30,29 @@
#include "scresid.hxx" #include "scresid.hxx"
#include "miscdlgs.hrc" #include "miscdlgs.hrc"
//================================================================== //==================================================================
ScSelEntryDlg::ScSelEntryDlg( Window* pParent, ScSelEntryDlg::ScSelEntryDlg(Window* pParent, const std::vector<String> &rEntryList)
sal_uInt16 nResId, : ModalDialog(pParent, "SelectRangeDialog", "modules/scalc/ui/selectrange.ui")
const String& aTitle,
const String& aLbTitle,
const std::vector<String> &rEntryList ) :
ModalDialog ( pParent, ScResId( nResId ) ),
//
aFlLbTitle ( this, ScResId( FL_ENTRYLIST ) ),
aLb ( this, ScResId( LB_ENTRYLIST ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) )
{ {
SetText( aTitle ); get(m_pLb, "treeview");
aFlLbTitle.SetText( aLbTitle ); m_pLb->SetDropDownLineCount(8);
aLb.Clear(); m_pLb->set_width_request(m_pLb->approximate_char_width() * 32);
aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) ); m_pLb->SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) );
std::vector<String>::const_iterator pIter; std::vector<String>::const_iterator pIter;
for ( pIter = rEntryList.begin(); pIter != rEntryList.end(); ++pIter ) for ( pIter = rEntryList.begin(); pIter != rEntryList.end(); ++pIter )
aLb.InsertEntry(*pIter); m_pLb->InsertEntry(*pIter);
if ( aLb.GetEntryCount() > 0 )
aLb.SelectEntryPos( 0 );
//------------- if ( m_pLb->GetEntryCount() > 0 )
FreeResource(); m_pLb->SelectEntryPos( 0 );
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
String ScSelEntryDlg::GetSelectEntry() const OUString ScSelEntryDlg::GetSelectEntry() const
{ {
return aLb.GetSelectEntry(); return m_pLb->GetSelectEntry();
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -78,12 +64,4 @@ IMPL_LINK_NOARG_INLINE_START(ScSelEntryDlg, DblClkHdl) ...@@ -78,12 +64,4 @@ IMPL_LINK_NOARG_INLINE_START(ScSelEntryDlg, DblClkHdl)
} }
IMPL_LINK_NOARG_INLINE_END(ScSelEntryDlg, DblClkHdl) IMPL_LINK_NOARG_INLINE_END(ScSelEntryDlg, DblClkHdl)
//------------------------------------------------------------------------
ScSelEntryDlg::~ScSelEntryDlg()
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -911,55 +911,6 @@ ModalDialog RID_SCDLG_ROW_OPT ...@@ -911,55 +911,6 @@ ModalDialog RID_SCDLG_ROW_OPT
}; };
}; };
// RID_SCDLG_SELENTRY als Basis fuer RID_SCDLG_SELECTDB und RID_SCDLG_SHOW_TAB
// gibt es nicht mehr, weil die beiden jetzt unterschiedlich sind
ModalDialog RID_SCDLG_SELECTDB
{
HelpId = CMD_SID_SELECT_DB ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 168 , 100 ) ;
Text [ en-US ] = "Select" ;
Moveable = TRUE ;
Closeable = FALSE ;
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 112 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 112 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 112 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
ListBox LB_ENTRYLIST
{
// HelpID aus Zeiten, als noch abgeleitet wurde
HelpId = HID_SC_SELENTRY_LIST ;
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 91 , 80 ) ;
TabStop = TRUE ;
Sort = TRUE ;
};
FixedLine FL_ENTRYLIST
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
};
};
ModalDialog RID_SCDLG_SHOW_TAB ModalDialog RID_SCDLG_SHOW_TAB
{ {
HelpId = CMD_FID_TABLE_SHOW ; HelpId = CMD_FID_TABLE_SHOW ;
......
...@@ -245,16 +245,6 @@ String SCSTR_HIDDENTABLES ...@@ -245,16 +245,6 @@ String SCSTR_HIDDENTABLES
Text [ en-US ] = "Hidden Sheets" ; Text [ en-US ] = "Hidden Sheets" ;
}; };
String SCSTR_SELECTDB
{
Text [ en-US ] = "Select Database Range" ;
};
String SCSTR_AREAS
{
Text [ en-US ] = "Ranges" ;
};
String SCSTR_TABLE String SCSTR_TABLE
{ {
Text [ en-US ] = "Sheet" ; Text [ en-US ] = "Sheet" ;
......
...@@ -716,11 +716,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ...@@ -716,11 +716,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
AbstractScSelEntryDlg* pDlg = pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(), AbstractScSelEntryDlg* pDlg = pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(),
RID_SCDLG_SELECTDB, aList );
String(ScResId(SCSTR_SELECTDB)),
String(ScResId(SCSTR_AREAS)),
aList,
RID_SCDLG_SELECTDB);
OSL_ENSURE(pDlg, "Dialog create fail!"); OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK ) if ( pDlg->Execute() == RET_OK )
{ {
......
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="SelectRangeDialog"> <object class="GtkDialog" id="SelectRangeDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">5</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Select Database Range</property> <property name="title" translatable="yes">Select Database Range</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="SelectRange"> <object class="GtkBox" id="SelectRange">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">2</property> <property name="spacing">12</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1"> <object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="layout_style">start</property> <property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="ok1"> <object class="GtkButton" id="ok">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property> <property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
...@@ -32,12 +32,11 @@ ...@@ -32,12 +32,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel1"> <object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
...@@ -47,12 +46,11 @@ ...@@ -47,12 +46,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="help1"> <object class="GtkButton" id="help">
<property name="label">gtk-help</property> <property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
...@@ -70,46 +68,51 @@ ...@@ -70,46 +68,51 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkFrame" id="frame1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child> <child>
<object class="GtkLabel" id="selectRange"> <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Ranges</property> <property name="hexpand">True</property>
</object> <property name="vexpand">True</property>
<packing> <property name="top_padding">6</property>
<property name="expand">False</property> <property name="left_padding">12</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child> <child>
<object class="GtkTreeView" id="treeview1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child internal-child="selection"> <property name="hexpand">True</property>
<object class="GtkTreeSelection" id="treeview-selection1"/> <property name="vexpand">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
<packing> </child>
<property name="expand">False</property> <child type="label">
<property name="fill">True</property> <object class="GtkLabel" id="label1">
<property name="position">1</property> <property name="visible">True</property>
</packing> <property name="can_focus">False</property>
<property name="label" translatable="yes">Ranges</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
...@@ -117,9 +120,9 @@ ...@@ -117,9 +120,9 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">ok1</action-widget> <action-widget response="0">ok</action-widget>
<action-widget response="0">cancel1</action-widget> <action-widget response="0">cancel</action-widget>
<action-widget response="0">help1</action-widget> <action-widget response="0">help</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </interface>
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