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

convert help index page to .ui

Change-Id: I2d3b5311b8f40350f6d9524f802cb074c175ffaa
üst eb847b33
......@@ -18,6 +18,9 @@
<glade-widget-class title="Bookmarks Box" name="sfxlo-BookmarksBox"
generic-name="BookmarksBox" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
<glade-widget-class title="Index Box" name="sfxlo-IndexBox"
generic-name="IndexBox" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
<glade-widget-class title="Font PickListBox" name="smlo-SmFontPickListBox"
generic-name="SmFontPickListBox" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
......
......@@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/editdurationdialog \
sfx2/uiconfig/ui/errorfindemaildialog \
sfx2/uiconfig/ui/helpbookmarkpage \
sfx2/uiconfig/ui/helpindexpage \
sfx2/uiconfig/ui/inputdialog \
sfx2/uiconfig/ui/licensedialog \
sfx2/uiconfig/ui/managestylepage \
......
......@@ -43,7 +43,6 @@
#define WIN_HELPINDEX (RID_SFX_APP_START+99)
#define TP_HELP_CONTENT (RID_SFX_APP_START+100)
#define TP_HELP_INDEX (RID_SFX_APP_START+101)
#define TP_HELP_SEARCH (RID_SFX_APP_START+102)
#define MENU_HELP_BOOKMARKS (RID_SFX_APP_START+105)
......
......@@ -470,16 +470,24 @@ Control* ContentTabPage_Impl::GetLastFocusControl()
// class IndexBox_Impl ---------------------------------------------------
IndexBox_Impl::IndexBox_Impl( Window* pParent, const ResId& rResId ) :
ComboBox( pParent, rResId )
IndexBox_Impl::IndexBox_Impl(Window* pParent, WinBits nStyle)
: ComboBox(pParent, nStyle)
{
EnableAutocomplete( true );
EnableUserDraw( true );
EnableAutocomplete(true);
EnableUserDraw(true);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeIndexBox(Window *pParent,
VclBuilder::stringmap &rMap)
{
WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
IndexBox_Impl* pListBox = new IndexBox_Impl(pParent, nWinBits);
pListBox->EnableAutoSize(true);
return pListBox;
}
void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
{
......@@ -537,31 +545,25 @@ void IndexBox_Impl::SelectExecutableEntry()
// class IndexTabPage_Impl -----------------------------------------------
IndexTabPage_Impl::IndexTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin ) :
HelpTabPage_Impl( pParent, _pIdxWin, SfxResId( TP_HELP_INDEX ) ),
aExpressionFT ( this, SfxResId( FT_EXPRESSION ) ),
aIndexCB ( this, SfxResId( CB_INDEX ) ),
aOpenBtn ( this, SfxResId( PB_OPEN_INDEX ) ),
bIsActivated ( sal_False )
IndexTabPage_Impl::IndexTabPage_Impl(Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin)
: HelpTabPage_Impl(pParent, _pIdxWin, "HelpIndexPage",
"sfx/ui/helpindexpage.ui")
, bIsActivated(false)
{
FreeResource();
get(m_pIndexCB, "terms");
Size aSize(LogicToPixel(Size(108, 97), MAP_APPFONT));
m_pIndexCB->set_width_request(aSize.Width());
m_pIndexCB->set_height_request(aSize.Height());
get(m_pOpenBtn, "display");
aOpenBtn.SetClickHdl( LINK( this, IndexTabPage_Impl, OpenHdl ) );
m_pOpenBtn->SetClickHdl( LINK( this, IndexTabPage_Impl, OpenHdl ) );
Link aTimeoutLink = LINK( this, IndexTabPage_Impl, TimeoutHdl );
aFactoryTimer.SetTimeoutHdl( aTimeoutLink );
aFactoryTimer.SetTimeout( 300 );
aKeywordTimer.SetTimeoutHdl( aTimeoutLink );
aFactoryTimer.SetTimeout( 300 );
nMinWidth = aOpenBtn.GetSizePixel().Width();
}
IndexTabPage_Impl::~IndexTabPage_Impl()
{
ClearIndex();
......@@ -597,18 +599,18 @@ namespace sfx2 {
#define UNIFY_AND_INSERT_TOKEN( aToken ) \
it = aInfo.insert( sfx2::KeywordInfo::value_type( aToken, 0 ) ).first; \
if ( ( tmp = it->second++ ) != 0 ) \
nPos = aIndexCB.InsertEntry( aToken + OUString( append, tmp ) ); \
nPos = m_pIndexCB->InsertEntry( aToken + OUString( append, tmp ) ); \
else \
nPos = aIndexCB.InsertEntry( aToken )
nPos = m_pIndexCB->InsertEntry( aToken )
#define INSERT_DATA( j ) \
if ( aAnchorList[j].getLength() > 0 ) \
{ \
aData.append( aRefList[j] ).append( '#' ).append( aAnchorList[j] ); \
aIndexCB.SetEntryData( nPos, NEW_ENTRY( aData.makeStringAndClear(), insert ) ); \
m_pIndexCB->SetEntryData( nPos, NEW_ENTRY( aData.makeStringAndClear(), insert ) ); \
} \
else \
aIndexCB.SetEntryData( nPos, NEW_ENTRY( aRefList[j], insert ) );
m_pIndexCB->SetEntryData( nPos, NEW_ENTRY( aRefList[j], insert ) );
......@@ -622,7 +624,7 @@ void IndexTabPage_Impl::InitializeIndex()
append[k] = ' ';
sfx2::KeywordInfo aInfo;
aIndexCB.SetUpdateMode( false );
m_pIndexCB->SetUpdateMode( false );
try
{
......@@ -719,7 +721,7 @@ void IndexTabPage_Impl::InitializeIndex()
OSL_FAIL( "IndexTabPage_Impl::InitializeIndex(): unexpected exception" );
}
aIndexCB.SetUpdateMode( true );
m_pIndexCB->SetUpdateMode( true );
if ( !sKeyword.isEmpty() )
aKeywordLink.Call( this );
......@@ -732,22 +734,18 @@ void IndexTabPage_Impl::InitializeIndex()
void IndexTabPage_Impl::ClearIndex()
{
sal_uInt16 nCount = aIndexCB.GetEntryCount();
sal_uInt16 nCount = m_pIndexCB->GetEntryCount();
for ( sal_uInt16 i = 0; i < nCount; ++i )
delete (IndexEntry_Impl*)(sal_uIntPtr)aIndexCB.GetEntryData(i);
aIndexCB.Clear();
delete (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData(i);
m_pIndexCB->Clear();
}
IMPL_LINK_NOARG(IndexTabPage_Impl, OpenHdl)
{
aIndexCB.GetDoubleClickHdl().Call( &aIndexCB );
m_pIndexCB->GetDoubleClickHdl().Call(m_pIndexCB);
return 0;
}
IMPL_LINK( IndexTabPage_Impl, TimeoutHdl, Timer*, pTimer )
{
if ( &aFactoryTimer == pTimer )
......@@ -757,43 +755,11 @@ IMPL_LINK( IndexTabPage_Impl, TimeoutHdl, Timer*, pTimer )
return 0;
}
void IndexTabPage_Impl::Resize()
{
Size aSize = GetSizePixel();
if ( aSize.Width() < nMinWidth )
aSize.Width() = nMinWidth;
Point aPnt = aExpressionFT.GetPosPixel();
Size aNewSize = aExpressionFT.GetSizePixel();
aNewSize.Width() = aSize.Width() - ( aPnt.X() * 2 );
aExpressionFT.SetSizePixel( aNewSize );
Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
Size aBtnSize = aOpenBtn.GetSizePixel();
aPnt = aIndexCB.GetPosPixel();
aNewSize = aIndexCB.GetSizePixel();
aNewSize.Width() = aSize.Width() - ( aPnt.X() * 2 );
aNewSize.Height() = aSize.Height() - aPnt.Y();
aNewSize.Height() -= ( aBtnSize.Height() + ( a6Size.Height() * 3 / 2 ) );
aIndexCB.SetSizePixel( aNewSize );
aPnt.X() += ( aNewSize.Width() - aBtnSize.Width() );
aPnt.Y() += aNewSize.Height() + ( a6Size.Height() / 2 );
long nMinX = aIndexCB.GetPosPixel().X();
if ( aPnt.X() < nMinX )
aPnt.X() = nMinX;
aOpenBtn.SetPosPixel( aPnt );
}
void IndexTabPage_Impl::ActivatePage()
{
if ( !bIsActivated )
{
bIsActivated = sal_True;
bIsActivated = true;
aFactoryTimer.Start();
}
......@@ -801,22 +767,16 @@ void IndexTabPage_Impl::ActivatePage()
SetFocusOnBox();
}
Control* IndexTabPage_Impl::GetLastFocusControl()
{
return &aOpenBtn;
return m_pOpenBtn;
}
void IndexTabPage_Impl::SetDoubleClickHdl( const Link& rLink )
{
aIndexCB.SetDoubleClickHdl( rLink );
m_pIndexCB->SetDoubleClickHdl( rLink );
}
void IndexTabPage_Impl::SetFactory( const OUString& rFactory )
{
OUString sNewFactory( rFactory );
......@@ -843,7 +803,7 @@ void IndexTabPage_Impl::SetFactory( const OUString& rFactory )
OUString IndexTabPage_Impl::GetSelectEntry() const
{
OUString aRet;
IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)aIndexCB.GetEntryData( aIndexCB.GetEntryPos( aIndexCB.GetText() ) );
IndexEntry_Impl* pEntry = (IndexEntry_Impl*)(sal_uIntPtr)m_pIndexCB->GetEntryData( m_pIndexCB->GetEntryPos( m_pIndexCB->GetText() ) );
if ( pEntry )
aRet = pEntry->m_aURL;
return aRet;
......@@ -855,7 +815,7 @@ void IndexTabPage_Impl::SetKeyword( const OUString& rKeyword )
{
sKeyword = rKeyword;
if ( aIndexCB.GetEntryCount() > 0 )
if ( m_pIndexCB->GetEntryCount() > 0 )
aKeywordTimer.Start();
else if ( !bIsActivated )
aFactoryTimer.Start();
......@@ -868,7 +828,7 @@ sal_Bool IndexTabPage_Impl::HasKeyword() const
sal_Bool bRet = sal_False;
if ( !sKeyword.isEmpty() )
{
sal_uInt16 nPos = aIndexCB.GetEntryPos( sKeyword );
sal_uInt16 nPos = m_pIndexCB->GetEntryPos( sKeyword );
bRet = ( nPos != LISTBOX_ENTRY_NOTFOUND );
}
......@@ -882,12 +842,12 @@ sal_Bool IndexTabPage_Impl::HasKeywordIgnoreCase()
sal_Bool bRet = sal_False;
if ( !sKeyword.isEmpty() )
{
sal_uInt16 nEntries = aIndexCB.GetEntryCount();
sal_uInt16 nEntries = m_pIndexCB->GetEntryCount();
OUString sIndexItem;
const vcl::I18nHelper& rI18nHelper = GetSettings().GetLocaleI18nHelper();
for ( sal_uInt16 n = 0; n < nEntries; n++)
{
sIndexItem = aIndexCB.GetEntry( n );
sIndexItem = m_pIndexCB->GetEntry( n );
if (rI18nHelper.MatchString( sIndexItem, sKeyword ))
{
sKeyword = sIndexItem;
......@@ -905,8 +865,8 @@ void IndexTabPage_Impl::OpenKeyword()
{
if ( !sKeyword.isEmpty() )
{
aIndexCB.SetText( sKeyword );
aIndexCB.GetDoubleClickHdl().Call( NULL );
m_pIndexCB->SetText( sKeyword );
m_pIndexCB->GetDoubleClickHdl().Call( NULL );
sKeyword = "";
}
}
......
......@@ -26,11 +26,6 @@
#define FL_ACTIVE 11
#define TC_INDEX 12
// Index TabPage
#define FT_EXPRESSION 10
#define CB_INDEX 11
#define PB_OPEN_INDEX 12
// Search TabPage
#define FT_SEARCH 10
#define ED_SEARCH 11
......@@ -41,11 +36,6 @@
#define LB_RESULT 16
#define PB_OPEN_SEARCH 17
// Bookmarks TabPage
#define FT_BOOKMARKS 10
#define LB_BOOKMARKS 11
#define PB_BOOKMARKS 12
// Content TabPage
#define LB_CONTENTS 10
......
......@@ -109,7 +109,7 @@ public:
class IndexBox_Impl : public ComboBox
{
public:
IndexBox_Impl( Window* pParent, const ResId& rResId );
IndexBox_Impl(Window* pParent, WinBits nStyle);
virtual void UserDraw( const UserDrawEvent& rUDEvt );
virtual bool Notify( NotifyEvent& rNEvt );
......@@ -120,9 +120,8 @@ public:
class IndexTabPage_Impl : public HelpTabPage_Impl
{
private:
FixedText aExpressionFT;
IndexBox_Impl aIndexCB;
PushButton aOpenBtn;
IndexBox_Impl* m_pIndexCB;
PushButton* m_pOpenBtn;
Timer aFactoryTimer;
Timer aKeywordTimer;
......@@ -131,8 +130,7 @@ private:
OUString sFactory;
OUString sKeyword;
long nMinWidth;
sal_Bool bIsActivated;
bool bIsActivated;
void InitializeIndex();
void ClearIndex();
......@@ -144,7 +142,6 @@ public:
IndexTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
~IndexTabPage_Impl();
virtual void Resize();
virtual void ActivatePage();
virtual Control* GetLastFocusControl();
......@@ -152,8 +149,8 @@ public:
void SetFactory( const OUString& rFactory );
inline OUString GetFactory() const { return sFactory; }
OUString GetSelectEntry() const;
inline void SetFocusOnBox() { aIndexCB.GrabFocus(); }
inline sal_Bool HasFocusOnEdit() const { return aIndexCB.HasChildPathFocus(); }
inline void SetFocusOnBox() { m_pIndexCB->GrabFocus(); }
inline sal_Bool HasFocusOnEdit() const { return m_pIndexCB->HasChildPathFocus(); }
inline void SetKeywordHdl( const Link& rLink ) { aKeywordLink = rLink; }
void SetKeyword( const OUString& rKeyword );
......@@ -161,7 +158,7 @@ public:
sal_Bool HasKeywordIgnoreCase();
void OpenKeyword();
inline void SelectExecutableEntry() { aIndexCB.SelectExecutableEntry(); }
inline void SelectExecutableEntry() { m_pIndexCB->SelectExecutableEntry(); }
};
// class SearchTabPage_Impl ----------------------------------------------
......
......@@ -71,34 +71,6 @@ Window WIN_HELPINDEX
};
};
TabPage TP_HELP_INDEX
{
HelpId = HID_HELP_TABPAGE_INDEX;
Hide = TRUE ;
DialogControl = TRUE;
Size = MAP_APPFONT ( 120 , 200 ) ;
FixedText FT_EXPRESSION
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 108 , 10 ) ;
Text [ en-US ] = "~Search term" ;
};
ComboBox CB_INDEX
{
HelpID = "sfx2:ComboBox:TP_HELP_INDEX:CB_INDEX";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 108 , 97 ) ;
};
PushButton PB_OPEN_INDEX
{
HelpID = "sfx2:PushButton:TP_HELP_INDEX:PB_OPEN_INDEX";
Pos = MAP_APPFONT ( 64 , 115 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Display" ;
};
};
TabPage TP_HELP_SEARCH
{
HelpId = HID_HELP_TABPAGE_SEARCH;
......
......@@ -105,7 +105,6 @@
#define HID_HELP_TOOLBOXITEM_PRINT "SFX2_HID_HELP_TOOLBOXITEM_PRINT"
#define HID_HELP_TOOLBOXITEM_BOOKMARKS "SFX2_HID_HELP_TOOLBOXITEM_BOOKMARKS"
#define HID_HELP_TABPAGE_CONTENTS "SFX2_HID_HELP_TABPAGE_CONTENTS"
#define HID_HELP_TABPAGE_INDEX "SFX2_HID_HELP_TABPAGE_INDEX"
#define HID_HELP_TABPAGE_SEARCH "SFX2_HID_HELP_TABPAGE_SEARCH"
#define HID_TBXCONTROL_FILENEW "SFX2_HID_TBXCONTROL_FILENEW"
#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG "SFX2_HID_HELP_TOOLBOXITEM_SEARCHDIALOG"
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires LibreOffice 1.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkBox" id="HelpIndexPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkButton" id="display">
<property name="label" translatable="yes">_Display</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="use_underline">True</property>
</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="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Search term</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">terms:border</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="sfxlo-IndexBox" id="terms:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</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