Object Catalog pane in Basic IDE
Object Catalog was a floating window. It has been converted to a fixed pane on the right hand side of the editor window. While it is a BasicDockingWindow, at the moment it is not possible to undock, move, or resize it. Also, the Object Catalog toolbar button does not show the visibility status of the pane, ideally it should look pressed, when the Object Catalog pane is visible. Another missing feature is that the Object Catalog pane cannot be switched on together with the dialog editor.
This commit is contained in:
committed by
Andras Timar
parent
f32fe9f501
commit
0e8eb19a53
@@ -31,6 +31,9 @@
|
||||
#include <svx/svxids.hrc>
|
||||
#endif
|
||||
|
||||
// Width of Object Catalog pane in pixels
|
||||
#define OBJCAT_PANE_WIDTH 240
|
||||
|
||||
// Resource-ID's...
|
||||
#ifndef _SVX_NOIDERESIDS
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "brkdlg.hxx"
|
||||
#include "iderdll.hxx"
|
||||
#include "iderdll2.hxx"
|
||||
#include "objdlg.hxx"
|
||||
|
||||
#include "baside2.hrc"
|
||||
|
||||
@@ -1388,6 +1389,11 @@ void ModulWindow::SetLineNumberDisplay(bool b)
|
||||
aXEditorWindow.SetLineNumberDisplay(b);
|
||||
}
|
||||
|
||||
void ModulWindow::SetObjectCatalogDisplay(bool b)
|
||||
{
|
||||
aXEditorWindow.SetObjectCatalogDisplay(b);
|
||||
}
|
||||
|
||||
sal_Bool ModulWindow::IsPasteAllowed()
|
||||
{
|
||||
sal_Bool bPaste = sal_False;
|
||||
@@ -1420,6 +1426,7 @@ ModulWindowLayout::ModulWindowLayout( Window* pParent ) :
|
||||
aHSplitter( this, WinBits( WB_HSCROLL ) ),
|
||||
aWatchWindow( this ),
|
||||
aStackWindow( this ),
|
||||
aObjectCatalog( this ),
|
||||
bVSplitted(sal_False),
|
||||
bHSplitted(sal_False),
|
||||
m_pModulWindow(0),
|
||||
@@ -1434,6 +1441,7 @@ ModulWindowLayout::ModulWindowLayout( Window* pParent ) :
|
||||
|
||||
aWatchWindow.Show();
|
||||
aStackWindow.Show();
|
||||
aObjectCatalog.Show();
|
||||
|
||||
Color aColor(GetSettings().GetStyleSettings().GetFieldTextColor());
|
||||
m_aSyntaxColors[TT_UNKNOWN] = aColor;
|
||||
@@ -1506,12 +1514,13 @@ void ModulWindowLayout::ArrangeWindows()
|
||||
nVSplitPos = ( nVSplitPos < nMinPos ) ? 0 : ( aSz.Height() - SPLIT_HEIGHT );
|
||||
|
||||
Size aXEWSz;
|
||||
aXEWSz.Width() = aSz.Width();
|
||||
aXEWSz.Width() = aSz.Width() - OBJCAT_PANE_WIDTH;
|
||||
|
||||
aXEWSz.Height() = nVSplitPos + 1;
|
||||
if ( m_pModulWindow )
|
||||
{
|
||||
DBG_CHKOBJ( m_pModulWindow, ModulWindow, 0 );
|
||||
m_pModulWindow->SetPosSizePixel( Point( 0, 0 ), aXEWSz );
|
||||
m_pModulWindow->SetPosSizePixel( Point( OBJCAT_PANE_WIDTH, 0 ), aXEWSz );
|
||||
}
|
||||
|
||||
aVSplitter.SetDragRectPixel( Rectangle( Point( 0, 0 ), Size( aSz.Width(), aSz.Height() ) ) );
|
||||
@@ -1536,6 +1545,11 @@ void ModulWindowLayout::ArrangeWindows()
|
||||
if ( !aStackWindow.IsFloatingMode() )
|
||||
aStackWindow.SetPosSizePixel( aSWPos, aSWSz );
|
||||
|
||||
Size aOCSz( OBJCAT_PANE_WIDTH, aSz.Height() - aSWSz.Height() - 3 );
|
||||
Point aOCPos( 0, 0 );
|
||||
if ( !aObjectCatalog.IsFloatingMode() )
|
||||
aObjectCatalog.SetPosSizePixel( aOCPos, aOCSz );
|
||||
|
||||
if ( aStackWindow.IsFloatingMode() && aWatchWindow.IsFloatingMode() )
|
||||
aHSplitter.Hide();
|
||||
else
|
||||
@@ -1592,6 +1606,15 @@ sal_Bool ModulWindowLayout::IsToBeDocked( DockingWindow* pDockingWindow, const P
|
||||
return sal_True;
|
||||
}
|
||||
}
|
||||
if ( pDockingWindow == &aObjectCatalog )
|
||||
{
|
||||
if ( ( aPosInMe.Y() > nVSplitPos ) && ( aPosInMe.X() > nHSplitPos ) )
|
||||
{
|
||||
rRect.SetSize( Size( aSz.Width() - nHSplitPos, aSz.Height() - nVSplitPos ) );
|
||||
rRect.SetPos( OutputToScreenPixel( Point( nHSplitPos, nVSplitPos ) ) );
|
||||
return sal_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sal_False;
|
||||
}
|
||||
@@ -1606,6 +1629,10 @@ void ModulWindowLayout::DockaWindow( DockingWindow* pDockingWindow )
|
||||
{
|
||||
ArrangeWindows();
|
||||
}
|
||||
else if ( pDockingWindow == &aObjectCatalog )
|
||||
{
|
||||
ArrangeWindows();
|
||||
}
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
else
|
||||
OSL_FAIL( "Wer will sich denn hier andocken ?" );
|
||||
|
@@ -54,6 +54,7 @@ class SvxSearchItem;
|
||||
|
||||
#include "breakpoint.hxx"
|
||||
#include "linenumberwindow.hxx"
|
||||
#include "objdlg.hxx"
|
||||
|
||||
DBG_NAMEEX( ModulWindow )
|
||||
|
||||
@@ -291,6 +292,7 @@ private:
|
||||
EditorWindow aEdtWindow;
|
||||
ScrollBar aEWVScrollBar;
|
||||
bool bLineNumberDisplay;
|
||||
bool bObjectCatalogDisplay;
|
||||
|
||||
virtual void DataChanged(DataChangedEvent const & rDCEvt);
|
||||
|
||||
@@ -307,6 +309,7 @@ public:
|
||||
ScrollBar& GetEWVScrollBar() { return aEWVScrollBar; }
|
||||
|
||||
void SetLineNumberDisplay(bool b);
|
||||
void SetObjectCatalogDisplay(bool b);
|
||||
};
|
||||
|
||||
|
||||
@@ -368,6 +371,7 @@ public:
|
||||
virtual sal_Bool IsReadOnly();
|
||||
|
||||
void SetLineNumberDisplay(bool);
|
||||
void SetObjectCatalogDisplay(bool);
|
||||
|
||||
StarBASIC* GetBasic() { XModule(); return xBasic; }
|
||||
|
||||
@@ -437,6 +441,7 @@ private:
|
||||
|
||||
WatchWindow aWatchWindow;
|
||||
StackWindow aStackWindow;
|
||||
ObjectCatalog aObjectCatalog;
|
||||
|
||||
sal_Bool bVSplitted;
|
||||
sal_Bool bHSplitted;
|
||||
@@ -474,6 +479,7 @@ public:
|
||||
|
||||
WatchWindow& GetWatchWindow() { return aWatchWindow; }
|
||||
StackWindow& GetStackWindow() { return aStackWindow; }
|
||||
ObjectCatalog& GetObjectCatalog() { return aObjectCatalog; }
|
||||
|
||||
Image getImage(sal_uInt16 nId) const;
|
||||
|
||||
|
@@ -1658,7 +1658,8 @@ ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) :
|
||||
aLineNumberWindow( this, pParent ),
|
||||
aEdtWindow( this ),
|
||||
aEWVScrollBar( this, WB_VSCROLL | WB_DRAG ),
|
||||
bLineNumberDisplay(false)
|
||||
bLineNumberDisplay(false),
|
||||
bObjectCatalogDisplay(true)
|
||||
{
|
||||
aEdtWindow.SetModulWindow( pParent );
|
||||
aBrkWindow.SetModulWindow( pParent );
|
||||
@@ -1681,23 +1682,24 @@ void ComplexEditorWindow::Resize()
|
||||
long nSBWidth = aEWVScrollBar.GetSizePixel().Width();
|
||||
|
||||
Size aBrkSz(nBrkWidth, aSz.Height());
|
||||
aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
|
||||
|
||||
Size aLnSz(aLineNumberWindow.GetWidth(), aSz.Height());
|
||||
aLineNumberWindow.SetPosSizePixel(Point(DWBORDER+aBrkSz.Width() - 1, DWBORDER), aLnSz);
|
||||
|
||||
if(bLineNumberDisplay)
|
||||
{
|
||||
aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
|
||||
aLineNumberWindow.SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aLnSz);
|
||||
Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow.GetWidth() - nSBWidth + 2, aSz.Height());
|
||||
aEdtWindow.SetPosSizePixel( Point( DWBORDER+aBrkSz.Width()+aLnSz.Width()-1, DWBORDER ), aEWSz );
|
||||
aEdtWindow.SetPosSizePixel( Point( DWBORDER + aBrkSz.Width() + aLnSz.Width() - 1, DWBORDER ), aEWSz );
|
||||
}
|
||||
else
|
||||
{
|
||||
Size aEWSz(aSz.Width() - nBrkWidth - nSBWidth + 1, aSz.Height());
|
||||
aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
|
||||
Size aEWSz(aSz.Width() - nBrkWidth - nSBWidth + 2, aSz.Height());
|
||||
aEdtWindow.SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aEWSz);
|
||||
}
|
||||
|
||||
aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width()-DWBORDER-nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) );
|
||||
aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width() - DWBORDER - nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) );
|
||||
}
|
||||
|
||||
IMPL_LINK( ComplexEditorWindow, ScrollHdl, ScrollBar *, pCurScrollBar )
|
||||
@@ -1734,15 +1736,18 @@ void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
|
||||
|
||||
void ComplexEditorWindow::SetLineNumberDisplay(bool b)
|
||||
{
|
||||
if(b == bLineNumberDisplay)
|
||||
return;
|
||||
bLineNumberDisplay = b;
|
||||
Resize();
|
||||
|
||||
if(b)
|
||||
aLineNumberWindow.Show();
|
||||
else
|
||||
aLineNumberWindow.Hide();
|
||||
}
|
||||
|
||||
bLineNumberDisplay = b;
|
||||
void ComplexEditorWindow::SetObjectCatalogDisplay(bool b)
|
||||
{
|
||||
bObjectCatalogDisplay = b;
|
||||
Resize();
|
||||
}
|
||||
|
||||
|
@@ -432,10 +432,22 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
|
||||
break;
|
||||
case SID_BASICIDE_OBJCAT:
|
||||
{
|
||||
if ( pObjectCatalog )
|
||||
ShowObjectDialog( sal_False, sal_True );
|
||||
if ( bObjectCatalogDisplay )
|
||||
{
|
||||
pModulLayout->GetObjectCatalog().Hide();
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetPosPixel( Point( 0, 0 ) );
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetSizePixel( Size( pCurWin->GetSizePixel().Width() + OBJCAT_PANE_WIDTH, pCurWin->GetSizePixel().Height() ) );
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetObjectCatalogDisplay( false );
|
||||
bObjectCatalogDisplay = sal_False;
|
||||
}
|
||||
else
|
||||
ShowObjectDialog( sal_True, sal_True );
|
||||
{
|
||||
pModulLayout->GetObjectCatalog().Show();
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetPosPixel( Point( OBJCAT_PANE_WIDTH, 0 ) );
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetSizePixel( Size( pCurWin->GetSizePixel().Width() - OBJCAT_PANE_WIDTH, pCurWin->GetSizePixel().Height() ) );
|
||||
dynamic_cast<ModulWindow*>(pCurWin)->SetObjectCatalogDisplay( true );
|
||||
bObjectCatalogDisplay = sal_True;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SID_BASICIDE_NAMECHANGEDONTAB:
|
||||
@@ -870,6 +882,18 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
|
||||
break;
|
||||
case SID_BASICIDE_CHOOSEMACRO:
|
||||
case SID_BASICIDE_OBJCAT:
|
||||
{
|
||||
// FIXME: hide Object Catalog icon from the toolbar,
|
||||
// when window type is not macro editor.
|
||||
if( pCurWin && !pCurWin->IsA( TYPE( ModulWindow ) ) )
|
||||
{
|
||||
rSet.DisableItem( nWh );
|
||||
rSet.Put(SfxVisibilityItem(nWh, sal_False));
|
||||
}
|
||||
else
|
||||
rSet.Put(SfxVisibilityItem(nWh, sal_True));
|
||||
}
|
||||
break;
|
||||
case SID_BASICIDE_SHOWSBX:
|
||||
case SID_BASICIDE_CREATEMACRO:
|
||||
case SID_BASICIDE_EDITMACRO:
|
||||
|
@@ -206,6 +206,8 @@ void BasicIDEShell::Init()
|
||||
pObjectCatalog = 0;
|
||||
bCreatingWindow = sal_False;
|
||||
|
||||
bObjectCatalogDisplay = sal_True;
|
||||
|
||||
pTabBar = new BasicIDETabBar( &GetViewFrame()->GetWindow() );
|
||||
pTabBar->SetSplitHdl( LINK( this, BasicIDEShell, TabBarSplitHdl ) );
|
||||
bTabBarSplitted = sal_False;
|
||||
|
@@ -263,7 +263,13 @@ BasicDockingWindow::BasicDockingWindow( Window* pParent ) :
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BasicDockingWindow::BasicDockingWindow( Window* pParent, const ResId& rResId ) :
|
||||
DockingWindow( pParent, rResId )
|
||||
{
|
||||
SetStyle( WB_BORDER | WB_3DLOOK | WB_DOCKABLE | WB_MOVEABLE |
|
||||
WB_SIZEABLE | WB_ROLLABLE |
|
||||
WB_DOCKABLE | WB_CLIPCHILDREN );
|
||||
}
|
||||
|
||||
sal_Bool BasicDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
|
||||
{
|
||||
|
@@ -44,7 +44,7 @@
|
||||
#include <vcl/sound.hxx>
|
||||
|
||||
ObjectCatalog::ObjectCatalog( Window * pParent )
|
||||
:FloatingWindow( pParent, IDEResId( RID_BASICIDE_OBJCAT ) )
|
||||
:BasicDockingWindow( pParent, IDEResId( RID_BASICIDE_OBJCAT ) )
|
||||
,aMacroTreeList( this, IDEResId( RID_TLB_MACROS ) )
|
||||
,aToolBox(this, IDEResId(RID_TB_TOOLBOX))
|
||||
,aMacroDescr( this, IDEResId( RID_FT_MACRODESCR ) )
|
||||
@@ -96,6 +96,13 @@ ObjectCatalog::~ObjectCatalog()
|
||||
GetParent()->GetSystemWindow()->GetTaskPaneList()->RemoveWindow( this );
|
||||
}
|
||||
|
||||
void ObjectCatalog::Paint( const Rectangle& )
|
||||
{
|
||||
String sOC = GetText();
|
||||
long nPos = GetSizePixel().Width()/2-GetTextWidth(sOC)/2;
|
||||
DrawText( Point( nPos, 10 ), String( sOC ) );
|
||||
}
|
||||
|
||||
void ObjectCatalog::Move()
|
||||
{
|
||||
BasicIDEGlobals::GetExtraData()->SetObjectCatalogPos( GetPosPixel() );
|
||||
|
@@ -52,7 +52,7 @@ private:
|
||||
ImageList m_aImagesNormal;
|
||||
};
|
||||
|
||||
class ObjectCatalog : public FloatingWindow
|
||||
class ObjectCatalog : public BasicDockingWindow
|
||||
{
|
||||
private:
|
||||
BasicTreeListBox aMacroTreeList;
|
||||
@@ -68,6 +68,7 @@ protected:
|
||||
virtual void Move();
|
||||
virtual sal_Bool Close();
|
||||
virtual void Resize();
|
||||
virtual void Paint( const Rectangle& rRect );
|
||||
|
||||
public:
|
||||
ObjectCatalog( Window * pParent );
|
||||
@@ -75,7 +76,6 @@ public:
|
||||
|
||||
void UpdateEntries();
|
||||
void SetCurrentEntry( BasicEntryDescriptor& rDesc );
|
||||
|
||||
void SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; }
|
||||
};
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
|
||||
|
||||
FloatingWindow RID_BASICIDE_OBJCAT
|
||||
DockingWindow RID_BASICIDE_OBJCAT
|
||||
{
|
||||
HelpID = "basctl:FloatingWindow:RID_BASICIDE_OBJCAT";
|
||||
OutputSize = TRUE ;
|
||||
@@ -43,6 +43,7 @@ FloatingWindow RID_BASICIDE_OBJCAT
|
||||
Zoomable = TRUE ;
|
||||
Hide = TRUE ;
|
||||
ClipChildren = TRUE ;
|
||||
Border = TRUE ;
|
||||
Control RID_TLB_MACROS
|
||||
{
|
||||
HelpId = HID_BASICIDE_OBJECTCAT ;
|
||||
|
@@ -100,6 +100,8 @@ friend class LocalizationMgr;
|
||||
friend class ContainerListenerImpl;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xLibListener;
|
||||
|
||||
sal_Bool bObjectCatalogDisplay;
|
||||
|
||||
#if _SOLAR__PRIVATE
|
||||
void Init();
|
||||
void InitTabBar();
|
||||
|
@@ -78,6 +78,7 @@ protected:
|
||||
|
||||
public:
|
||||
BasicDockingWindow( Window* pParent );
|
||||
BasicDockingWindow( Window* pParent, const ResId& rResId );
|
||||
};
|
||||
|
||||
// helper class for sorting TabBar
|
||||
|
Reference in New Issue
Block a user