Kaydet (Commit) 0631c5da authored tarafından tagezi's avatar tagezi Kaydeden (comit) Mike Kaganski

Reformat and documentation of ObjectCatalog

This improves the Doxygen-generated documentation for the class at
https://docs.libreoffice.org.
Also remove objdlg.cxx and objdlg.hxx files from clang-format blacklist.

Change-Id: I2299e225892a4d5db638a519bdab51a5d0c72c4d
Reviewed-on: https://gerrit.libreoffice.org/63610Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst a96e6e80
......@@ -27,8 +27,7 @@
namespace basctl
{
ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
ObjectCatalog::ObjectCatalog(vcl::Window* pParent)
: DockingWindow(pParent)
, aTitle(VclPtr<FixedText>::Create(this))
, aTree(VclPtr<TreeListBox>::Create(this, WB_TABSTOP))
......@@ -42,11 +41,8 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
// tree list
aTree->Hide();
aTree->SetStyle(
WB_BORDER | WB_TABSTOP | WB_HSCROLL |
WB_HASLINES | WB_HASLINESATROOT |
WB_HASBUTTONS | WB_HASBUTTONSATROOT
);
aTree->SetStyle(WB_BORDER | WB_TABSTOP | WB_HSCROLL | WB_HASLINES | WB_HASLINESATROOT
| WB_HASBUTTONS | WB_HASBUTTONSATROOT);
aTree->SetAccessibleName(IDEResId(RID_STR_TLB_MACROS));
aTree->SetHelpId(HID_BASICIDE_OBJECTCAT);
aTree->ScanAllEntries();
......@@ -58,8 +54,8 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
Point aPos = rParent.OutputToScreenPixel(Point(0, 0));
Size const aParentSize = rParent.GetSizePixel();
Size const aSize = GetSizePixel();
aPos.AdjustX((aParentSize.Width() - aSize.Width()) / 2 );
aPos.AdjustY((aParentSize.Height() - aSize.Height()) / 2 );
aPos.AdjustX((aParentSize.Width() - aSize.Width()) / 2);
aPos.AdjustY((aParentSize.Height() - aSize.Height()) / 2);
SetPosPixel(aPos);
}
......@@ -67,10 +63,7 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
GetParent()->GetSystemWindow()->GetTaskPaneList()->AddWindow(this);
}
ObjectCatalog::~ObjectCatalog()
{
disposeOnce();
}
ObjectCatalog::~ObjectCatalog() { disposeOnce(); }
void ObjectCatalog::dispose()
{
......@@ -82,14 +75,14 @@ void ObjectCatalog::dispose()
}
// Resize() -- called by Window
void ObjectCatalog::Resize ()
void ObjectCatalog::Resize()
{
// arranging the controls
ArrangeWindows();
}
// ToggleFloatingMode() -- called by DockingWindow when IsFloatingMode() changes
void ObjectCatalog::ToggleFloatingMode ()
void ObjectCatalog::ToggleFloatingMode()
{
// base class version
DockingWindow::ToggleFloatingMode();
......@@ -113,7 +106,7 @@ void ObjectCatalog::ArrangeWindows()
else
{
Size aTitleSize = LogicToPixel(Size(3, 10), MapMode(MapUnit::MapAppFont));
aTitleSize.setWidth( aSize.Width() - 2*aTitleSize.Width() );
aTitleSize.setWidth(aSize.Width() - 2 * aTitleSize.Width());
aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MapMode(MapUnit::MapAppFont)));
aTitle->SetSizePixel(aTitleSize);
aTitle->Show();
......@@ -122,10 +115,7 @@ void ObjectCatalog::ArrangeWindows()
// tree
Point const aTreePos = LogicToPixel(Point(3, bFloating ? 3 : 16), MapMode(MapUnit::MapAppFont));
long const nMargin = aTreePos.X();
Size const aTreeSize(
aSize.Width() - 2*nMargin,
aSize.Height() - aTreePos.Y() - nMargin
);
Size const aTreeSize(aSize.Width() - 2 * nMargin, aSize.Height() - aTreePos.Y() - nMargin);
if (aTreeSize.Height() > 0)
{
aTree->SetPosSizePixel(aTreePos, aTreeSize);
......@@ -135,7 +125,7 @@ void ObjectCatalog::ArrangeWindows()
aTree->Hide();
}
void ObjectCatalog::SetCurrentEntry (BaseWindow* pCurWin)
void ObjectCatalog::SetCurrentEntry(BaseWindow* pCurWin)
{
EntryDescriptor aDescriptor;
if (pCurWin)
......@@ -143,7 +133,6 @@ void ObjectCatalog::SetCurrentEntry (BaseWindow* pCurWin)
aTree->SetCurrentEntry(aDescriptor);
}
} // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -27,31 +27,38 @@
namespace basctl
{
// ObjectCatalog -- a docking window that contains the currently loaded macros
// in a tree structure.
/*!
* @brief A docking window that contains a tree of the currently loaded macros
*
* The class creates Object Catalog window with the currently loaded macros
* in a tree structure which allows user to quickly select the necessary
* macro in BasicIDE.
*/
class ObjectCatalog : public DockingWindow
{
public:
explicit ObjectCatalog(vcl::Window* pParent);
virtual ~ObjectCatalog() override;
virtual void dispose() override;
public:
void UpdateEntries () { aTree->UpdateEntries(); }
void SetCurrentEntry (BaseWindow* pCurWin);
private:
// title: "Object Catalog"
VclPtr<FixedText> aTitle;
// the tree-list of the objects
VclPtr<TreeListBox> aTree;
/// Update the entries of Object Catalog Treelist
void UpdateEntries() { aTree->UpdateEntries(); }
void SetCurrentEntry(BaseWindow* pCurWin);
private:
virtual void Resize () override; // Window
virtual void ToggleFloatingMode () override; // DockingWindow
void ArrangeWindows ();
VclPtr<FixedText> aTitle; ///< Title of the Object Catalog window
VclPtr<TreeListBox> aTree; ///< The Treelist of the objects in window
/// Function is called by Window. Use only for arranging the controls.
virtual void Resize() override;
/*!
* Function for resize by DockingWindow.
* It is called by DockingWindow when IsFloatingMode() changes.
*/
virtual void ToggleFloatingMode() override;
/// Uses by Resize() and ToggleFloatingMode() functions for resizing
void ArrangeWindows();
};
} // namespace basctl
......
......@@ -284,7 +284,6 @@ basctl/source/basicide/macrodlg.hxx
basctl/source/basicide/moduldl2.cxx
basctl/source/basicide/moduldlg.cxx
basctl/source/basicide/moduldlg.hxx
basctl/source/basicide/objdlg.cxx
basctl/source/basicide/register.cxx
basctl/source/basicide/sbxitem.cxx
basctl/source/basicide/scriptdocument.cxx
......@@ -325,7 +324,6 @@ basctl/source/inc/iderid.hxx
basctl/source/inc/layout.hxx
basctl/source/inc/localizationmgr.hxx
basctl/source/inc/managelang.hxx
basctl/source/inc/objdlg.hxx
basctl/source/inc/propbrw.hxx
basctl/source/inc/sbxitem.hxx
basctl/source/inc/scriptdocument.hxx
......
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