diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 2fae5da5f40e..05ae93b4a5e6 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -37,6 +37,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/formatnumberdialog \ cui/uiconfig/ui/gradientpage \ cui/uiconfig/ui/colorconfigwin \ + cui/uiconfig/ui/dbregisterpage \ cui/uiconfig/ui/effectspage \ cui/uiconfig/ui/hatchpage \ cui/uiconfig/ui/hyphenate \ diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 0ccdd9c6633f..5e23c480e0ef 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -445,6 +445,9 @@ #define RID_SVXSTR_HEADER1 (RID_SVX_START + 1242) #define RID_SVXSTR_HEADER2 (RID_SVX_START + 1243) +#define RID_SVXSTR_TYPE (RID_SVX_START + 1244) +#define RID_SVXSTR_PATH (RID_SVX_START + 1245) + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx index 9a5c7bf532c1..d89560dfaef3 100644 --- a/cui/source/inc/dbregister.hxx +++ b/cui/source/inc/dbregister.hxx @@ -44,13 +44,13 @@ namespace svx class DbRegistrationOptionsPage : public SfxTabPage { private: - FixedLine aStdBox; - FixedText aTypeText; - FixedText aPathText; - SvSimpleTableContainer aPathCtrl; - PushButton m_aNew; - PushButton m_aEdit; - PushButton m_aDelete; + OUString aTypeText; + OUString aPathText; + + SvSimpleTableContainer* m_pPathCtrl; + PushButton* m_pNew; + PushButton* m_pEdit; + PushButton* m_pDelete; ::svx::OptHeaderTabListBox* pPathBox; SvTreeListEntry* m_pCurEntry; diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 1e4ce41275c2..4701c7d0eb4b 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -18,7 +18,6 @@ */ #include "dbregister.hxx" -#include "dbregister.hrc" #include "dbregistersettings.hxx" #include "connpooloptions.hxx" #include @@ -104,29 +103,33 @@ short DatabaseRegistrationDialog::Execute() DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet ) : - SfxTabPage( pParent, CUI_RES( RID_SFXPAGE_DBREGISTER), rSet ), + SfxTabPage( pParent, "DbRegisterPage", "cui/ui/dbregisterpage.ui", rSet ), - aStdBox ( this, CUI_RES( GB_STD ) ), - aTypeText ( this, CUI_RES( FT_TYPE ) ), - aPathText ( this, CUI_RES( FT_PATH ) ), - aPathCtrl ( this, CUI_RES( LB_PATH ) ), - m_aNew ( this, CUI_RES( BTN_NEW ) ), - m_aEdit ( this, CUI_RES( BTN_EDIT ) ), - m_aDelete ( this, CUI_RES( BTN_DELETE ) ), + aTypeText ( CUI_RES( RID_SVXSTR_TYPE ) ), + aPathText ( CUI_RES( RID_SVXSTR_PATH ) ), pPathBox ( NULL ), m_pCurEntry ( NULL ), m_nOldCount ( 0 ), m_bModified ( sal_False ) { - m_aNew.SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) ); - m_aEdit.SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) ); - m_aDelete.SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) ); + get(m_pPathCtrl, "pathctrl"); + Size aControlSize(248, 147); + aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); + m_pPathCtrl->set_width_request(aControlSize.Width()); + m_pPathCtrl->set_height_request(aControlSize.Height()); - Size aBoxSize = aPathCtrl.GetOutputSizePixel(); + get(m_pNew, "new"); + get(m_pEdit, "edit"); + get(m_pDelete, "delete"); + m_pNew->SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) ); + m_pEdit->SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) ); + m_pDelete->SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) ); + + Size aBoxSize = m_pPathCtrl->GetOutputSizePixel(); WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP; - pPathBox = new ::svx::OptHeaderTabListBox( aPathCtrl, nBits ); + pPathBox = new ::svx::OptHeaderTabListBox( *m_pPathCtrl, nBits ); HeaderBar &rBar = pPathBox->GetTheHeaderBar(); @@ -134,11 +137,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) ); Size aSz; aSz.Width() = TAB_WIDTH1; - rBar.InsertItem( ITEMID_TYPE, aTypeText.GetText(), + rBar.InsertItem( ITEMID_TYPE, aTypeText, LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(), HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW ); aSz.Width() = TAB_WIDTH2; - rBar.InsertItem( ITEMID_PATH, aPathText.GetText(), + rBar.InsertItem( ITEMID_PATH, aPathText, LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(), HIB_LEFT | HIB_VCENTER ); @@ -158,8 +161,6 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx rBar.SetHelpId( HID_DBPATH_HEADERBAR ); pPathBox->ShowTable(); - - FreeResource(); } // ----------------------------------------------------------------------- @@ -384,8 +385,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, PathSelect_Impl) bReadOnly = pRegistration->bReadOnly; } - m_aEdit.Enable( !bReadOnly ); - m_aDelete.Enable( !bReadOnly ); + m_pEdit->Enable( !bReadOnly ); + m_pDelete->Enable( !bReadOnly ); return 0; } // ----------------------------------------------------------------------------- diff --git a/cui/source/options/dbregister.hrc b/cui/source/options/dbregister.hrc deleted file mode 100644 index ac3841bff9cd..000000000000 --- a/cui/source/options/dbregister.hrc +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef SVX_DBREGISTER_HRC -#define SVX_DBREGISTER_HRC -// defines --------------------------------------------------------------- - -#define FT_TYPE 10 -#define FT_PATH 11 -#define LB_PATH 12 -#define BTN_NEW 13 -#define BTN_EDIT 14 -#define GB_STD 15 -#define IMG_LOCK 16 -#define BTN_DELETE 17 - -#endif // SVX_DBREGISTER_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/dbregister.src b/cui/source/options/dbregister.src index 4e89503c606c..2f8d708721a5 100644 --- a/cui/source/options/dbregister.src +++ b/cui/source/options/dbregister.src @@ -17,70 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "dbregister.hrc" #include -#include -#include -// RID_SFXPAGE_PATH ----------------------------------------------------- -#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; } -TabPage RID_SFXPAGE_DBREGISTER +String RID_SVXSTR_TYPE { - HelpId = "cui:TabPage:RID_SFXPAGE_DBREGISTER" ; - OutputSize = TRUE ; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Text [ en-US ] = "Registered databases" ; - - FixedText FT_TYPE - { - Hide = TRUE; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Registered name" ; - }; - FixedText FT_PATH - { - Hide = TRUE; - Pos = MAP_APPFONT ( 110 , 14 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Database file" ; - }; - Control LB_PATH - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 236 , 147 ) ; - Border = TRUE ; - TabStop = TRUE; - }; - PushButton BTN_NEW - { - HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_NEW"; - Pos = MAP_APPFONT ( 47 , 165 ) ; - Size = MAP_APPFONT ( 65 , 14 ) ; - Text [ en-US ] = "~New..." ; - }; - PushButton BTN_EDIT - { - HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_EDIT"; - Pos = MAP_APPFONT ( 183 , 165 ) ; - Size = MAP_APPFONT ( 65 , 14 ) ; - Text [ en-US ] = "~Edit..." ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SFXPAGE_DBREGISTER:BTN_DELETE"; - Pos = MAP_APPFONT ( 115 , 165 ) ; - Size = MAP_APPFONT ( 65 , 14 ) ; - Text [ en-US ] = "~Delete" ; - }; - FixedLine GB_STD - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Registered databases" ; - }; + Text [ en-US ] = "Registered name" ; +}; +String RID_SVXSTR_PATH +{ + Text [ en-US ] = "Database file" ; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/dbregisterpage.ui b/cui/uiconfig/ui/dbregisterpage.ui new file mode 100644 index 000000000000..f555953bd44a --- /dev/null +++ b/cui/uiconfig/ui/dbregisterpage.ui @@ -0,0 +1,129 @@ + + + + + + True + False + 6 + 12 + + + True + False + True + 0 + none + + + True + False + 6 + True + 6 + 12 + + + True + False + vertical + 12 + + + True + False + + + + + + False + True + 0 + + + + + True + False + end + 12 + + + _New... + False + True + True + True + False + True + + + False + True + 0 + + + + + _Delete + False + True + True + True + False + True + + + False + True + 1 + + + + + _Edit... + False + True + True + True + False + True + + + False + True + 2 + + + + + False + True + 1 + + + + + + + + + True + False + Registered databases + + + + + + + + 0 + 0 + 1 + 1 + + + +