Kaydet (Commit) b0f2d55f authored tarafından Uray M. János's avatar Uray M. János Kaydeden (comit) Andras Timar

Basic IDE Object Catalog improvements

Change-Id: I4c3bbf721428e93cdfa8f062f37c5911faba0fa4
üst ef7b382e
......@@ -21,9 +21,6 @@
#include <svx/svxids.hrc>
// Width of Object Catalog pane in pixels
#define OBJCAT_PANE_WIDTH 240
// Resource-ID's...
#ifndef _SVX_NOIDERESIDS
......
......@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _BASIDE2_HXX
#define _BASIDE2_HXX
#ifndef BASCTL_BASIDE2_HXX
#define BASCTL_BASIDE2_HXX
#include <svheader.hxx>
......@@ -427,18 +427,18 @@ public:
class ModulWindowLayout: public Window, public utl::ConfigurationListener
{
private:
// is ArrangeWindows() called first in this object?
bool bFirstArrange;
Splitter aVSplitter;
Splitter aHSplitter;
// splitter lines
Splitter aLeftSplit, aBottomSplit, aVertSplit;
WatchWindow aWatchWindow;
StackWindow aStackWindow;
ObjectCatalog aObjectCatalog;
// dockable windows
ObjectCatalog aObjectCatalog;
WatchWindow aWatchWindow;
StackWindow aStackWindow;
bool bVSplitted;
bool bHSplitted;
ModulWindow * m_pModulWindow;
ModulWindow* m_pModulWindow;
Color m_aSyntaxColors[TT_KEYWORDS + 1];
svtools::ColorConfig m_aColorConfig;
......@@ -464,14 +464,14 @@ public:
~ModulWindowLayout();
void DockaWindow( DockingWindow* pDockingWin );
sal_Bool IsToBeDocked( DockingWindow* pDockingWin, const Point& rPos, Rectangle& rRect );
bool IsToBeDocked( DockingWindow* pDockingWin, const Point& rPos, Rectangle& rRect );
void SetModulWindow( ModulWindow* pModWin );
ModulWindow* GetModulWindow() const { return m_pModulWindow; }
WatchWindow& GetWatchWindow() { return aWatchWindow; }
StackWindow& GetStackWindow() { return aStackWindow; }
ObjectCatalog& GetObjectCatalog() { return aObjectCatalog; }
ObjectCatalog& GetObjectCatalog() { return aObjectCatalog; }
Image getImage(sal_uInt16 nId) const;
......@@ -479,8 +479,10 @@ public:
{ return m_aSyntaxColors[eType]; }
void ToggleObjectCatalog ();
bool HasObjectCatalog () const { return aObjectCatalog.IsVisible(); }
void UpdateObjectCatalog ();
};
#endif // _BASIDE2_HXX
#endif // BASCTL_BASIDE2_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -47,8 +47,11 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
namespace
{
long nVirtToolBoxHeight; // inited in WatchWindow, used in Stackwindow
long nHeaderBarHeight;
} // namespace
#define SCROLL_LINE 12
#define SCROLL_PAGE 60
......@@ -1515,7 +1518,7 @@ StackWindow::StackWindow( Window* pParent ) :
aTreeListBox( this, WB_BORDER | WB_3DLOOK | WB_HSCROLL | WB_TABSTOP ),
aStackStr( IDEResId( RID_STR_STACK ) )
{
aTreeListBox.SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
aTreeListBox.SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
aTreeListBox.SetAccessibleName(String( IDEResId(RID_STR_STACKNAME)));
aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) );
aTreeListBox.SetHighlightRange();
......
......@@ -442,6 +442,9 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_OBJCAT:
pModulLayout->ToggleObjectCatalog();
// refresh the button state
if (SfxBindings* pBindings = BasicIDE::GetBindingsPtr())
pBindings->Invalidate(nSlot);
break;
case SID_BASICIDE_NAMECHANGEDONTAB:
......@@ -883,9 +886,14 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
rSet.Put(SfxVisibilityItem(nWh, sal_False));
}
else
rSet.Put(SfxVisibilityItem(nWh, sal_True));
{
if (nWh == SID_BASICIDE_OBJCAT)
rSet.Put(SfxBoolItem(nWh, pModulLayout && pModulLayout->HasObjectCatalog()));
else
rSet.Put(SfxVisibilityItem(nWh, sal_True));
}
break;
}
break;
case SID_BASICIDE_SHOWSBX:
case SID_BASICIDE_CREATEMACRO:
case SID_BASICIDE_EDITMACRO:
......@@ -1424,8 +1432,6 @@ void BasicIDEShell::Activate( sal_Bool bMDI )
{
if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) )
((DialogWindow*)pCurWin)->UpdateBrowser();
ShowObjectDialog( true, false );
}
}
......@@ -1456,8 +1462,6 @@ void BasicIDEShell::Deactivate( sal_Bool bMDI )
break;
}
}
ShowObjectDialog( false, false );
}
}
......
......@@ -45,13 +45,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
namespace css = ::com::sun::star;
IMPL_LINK_NOARG_INLINE_START(BasicIDEShell, ObjectDialogCancelHdl)
{
ShowObjectDialog( false, true );
return 0;
}
IMPL_LINK_NOARG_INLINE_END(BasicIDEShell, ObjectDialogCancelHdl)
Reference< view::XRenderable > BasicIDEShell::GetRenderable()
{
return Reference< view::XRenderable >( new basicide::BasicRenderable( pCurWin ) );
......
......@@ -190,7 +190,6 @@ void BasicIDEShell::Init()
pCurWin = 0;
m_aCurDocument = ScriptDocument::getApplicationScriptDocument();
pObjectCatalog = 0;
bCreatingWindow = false;
pTabBar = new BasicIDETabBar( &GetViewFrame()->GetWindow() );
......@@ -238,7 +237,6 @@ BasicIDEShell::~BasicIDEShell()
aIDEWindowTable.clear();
delete pTabBar;
delete pObjectCatalog;
DestroyModulWindowLayout();
ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
......@@ -531,46 +529,6 @@ void BasicIDEShell::ArrangeTabBar()
void BasicIDEShell::ShowObjectDialog( bool bShow, bool bCreateOrDestroy )
{
if ( bShow )
{
if ( !pObjectCatalog && bCreateOrDestroy )
{
pObjectCatalog = new ObjectCatalog( &GetViewFrame()->GetWindow() );
// position is memorized in BasicIDEData and adjusted by the Dlg
if ( pObjectCatalog )
{
pObjectCatalog->SetCancelHdl( LINK( this, BasicIDEShell, ObjectDialogCancelHdl ) );
pObjectCatalog->SetCurrentEntry(pCurWin);
}
}
// the very last changes...
if ( pCurWin )
pCurWin->StoreData();
if ( pObjectCatalog )
{
pObjectCatalog->UpdateEntries();
pObjectCatalog->Show();
}
}
else if ( pObjectCatalog )
{
pObjectCatalog->Hide();
if ( bCreateOrDestroy )
{
// pObjectCatalog to NULL before the delete because of OS/2-focus-problem
ObjectCatalog* pTemp = pObjectCatalog;
pObjectCatalog = 0;
delete pTemp;
}
}
}
void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
......@@ -583,8 +541,8 @@ void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
case SFX_HINT_DYING:
{
EndListening( rBC, sal_True /* log off all */ );
if ( pObjectCatalog )
pObjectCatalog->UpdateEntries();
//if ( pObjectCatalog )
//pObjectCatalog->UpdateEntries();
}
break;
}
......@@ -1024,4 +982,10 @@ void BasicIDEShell::ImplStartListening( StarBASIC* pBasic )
StartListening( pBasic->GetBroadcaster(), sal_True /* log on only once */ );
}
// Updates the "Object Catalog" window.
void BasicIDEShell::UpdateObjectCatalog ()
{
pModulLayout->UpdateObjectCatalog();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -306,11 +306,9 @@ void MarkDocumentModified( const ScriptDocument& rDocument )
pBindings->Update( SID_SAVEDOC );
}
// Objectcatalog updaten...
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
ObjectCatalog* pObjCatalog = pIDEShell ? pIDEShell->GetObjectCatalog() : 0;
if ( pObjCatalog )
pObjCatalog->UpdateEntries();
// updating the Object Catalog
if (BasicIDEShell* pIdeShell = BasicIDEGlobals::GetShell())
pIdeShell->UpdateObjectCatalog();
}
//----------------------------------------------------------------------------
......
......@@ -151,7 +151,7 @@ BasicIDEData* BasicIDEDLL::GetExtraData()
return m_pExtraData;
}
BasicIDEData::BasicIDEData() : aObjCatPos( INVPOSITION, INVPOSITION )
BasicIDEData::BasicIDEData()
{
nBasicDialogCount = 0;
bChoosingMacro = false;
......
......@@ -40,9 +40,6 @@ private:
BasicEntryDescriptor m_aLastEntryDesc;
Point aObjCatPos;
Size aObjCatSize;
String aAddLibPath;
String aAddLibFilter;
......@@ -73,16 +70,6 @@ public:
SvxSearchItem& GetSearchItem() const;
void SetSearchItem( const SvxSearchItem& rItem );
void SetObjectCatalogPos( const Point& rPnt )
{ aObjCatPos = rPnt; }
const Point& GetObjectCatalogPos() const
{ return aObjCatPos; }
void SetObjectCatalogSize( const Size& rSize )
{ aObjCatSize = rSize; }
const Size& GetObjectCatalogSize() const
{ return aObjCatSize; }
const String& GetAddLibPath() const { return aAddLibPath; }
void SetAddLibPath( const String& rPath ) { aAddLibPath = rPath; }
......
......@@ -15,18 +15,13 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _OBJDLG_HRC
#define _OBJDLG_HRC
#ifndef BASCTL_OBJDLG_HRC
#define BASCTL_OBJDLG_HRC
#include <svl/solar.hrc>
#define RID_BASICIDE_OBJCAT ( RID_BASICIDE_START + 70 )
#define RID_FT_MACRODESCR 8
#define RID_TLB_MACROS 10
#define RID_TB_TOOLBOX 11
#define TBITEM_SHOW 1
#define RID_STR_TLB_MACROS ( RID_BASICIDE_START + 71 )
#define RID_TLB_MACROS ( RID_BASICIDE_START + 72 )
#endif // _OBJDLG_HXX
#endif // BASCTL_OBJDLG_HRR
......@@ -17,57 +17,42 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _OBJDLG_HXX
#define _OBJDLG_HXX
#ifndef BASCTL_OBJDLG_HXX
#define BASCTL_OBJDLG_HXX
#include <svheader.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
#include "vcl/image.hxx"
#include <vcl/image.hxx>
#include <bastype2.hxx>
class ObjectCatalogToolBox_Impl: public ToolBox
//
// ObjectCatalog -- a docking window that contains the currently loaded macros
// in a tree structure.
//
class ObjectCatalog : public BasicDockingWindow
{
public:
ObjectCatalogToolBox_Impl(Window * pParent, ResId const & rResId);
ObjectCatalog (Window* pParent);
virtual ~ObjectCatalog ();
public:
void UpdateEntries () { aTree.UpdateEntries(); }
void SetCurrentEntry (IDEBaseWindow* pCurWin);
private:
virtual void DataChanged(DataChangedEvent const & rDCEvt);
void setImages();
// title: "Object Catalog"
FixedText aTitle;
// the tree-list of the objects
BasicTreeListBox aTree;
ImageList m_aImagesNormal;
};
class ObjectCatalog : public BasicDockingWindow
{
private:
BasicTreeListBox aMacroTreeList;
ObjectCatalogToolBox_Impl aToolBox;
FixedText aMacroDescr;
Link aCancelHdl;
protected:
DECL_LINK( ToolBoxHdl, ToolBox* );
void CheckButtons();
DECL_LINK( TreeListHighlightHdl, SvTreeListBox * );
void UpdateFields();
virtual void Move();
virtual sal_Bool Close();
virtual void Resize();
virtual void Paint( const Rectangle& rRect );
public:
ObjectCatalog( Window * pParent );
virtual ~ObjectCatalog();
void UpdateEntries();
void SetCurrentEntry (IDEBaseWindow* pCurWin);
void SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; }
virtual void Resize (); // Window
virtual void ToggleFloatingMode (); // DockingWindow
void ArrangeWindows ();
};
#endif //_OBJDLG_HXX
#endif // BASCTL_OBJDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,61 +19,14 @@
#include <objdlg.hrc>
#include <helpid.hrc>
#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
Control RID_TLB_MACROS
{
TabStop = TRUE ;
};
DockingWindow RID_BASICIDE_OBJCAT
String RID_BASICIDE_OBJCAT
{
HelpID = "basctl:FloatingWindow:RID_BASICIDE_OBJCAT";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 191 , 179 ) ;
Text [ en-US ] = "Object Catalog" ;
Closeable = TRUE ;
Moveable = TRUE ;
Sizeable = TRUE ;
Zoomable = TRUE ;
Hide = TRUE ;
ClipChildren = TRUE ;
Border = TRUE ;
Control RID_TLB_MACROS
{
HelpId = HID_BASICIDE_OBJECTCAT ;
Border = TRUE ;
Pos = MAP_APPFONT ( 3 , 24 ) ;
Size = MAP_APPFONT ( 185 , 126 ) ;
TabStop = TRUE ;
};
ToolBox RID_TB_TOOLBOX
{
HelpId = HID_BASICIDE_OBJECTS ;
SVLook = TRUE ;
Align = BOXALIGN_TOP ;
Pos = MAP_APPFONT ( 4 , 6 ) ;
ItemImageList = ImageList
{
Prefix = "im";
MASKCOLOR
IdList =
{
TBITEM_SHOW ;
};
};
ItemList =
{
ToolBoxItem
{
Identifier = TBITEM_SHOW ;
HelpId = HID_BASICIDE_OBJCAT_SHOW ;
Text [ en-US ] = "Show" ;
};
};
};
FixedText RID_FT_MACRODESCR
{
WordBreak = TRUE ;
Pos = MAP_APPFONT ( 3 , 156 ) ;
Size = MAP_APPFONT ( 185 , 18 ) ;
};
Text [en-US] = "Object Catalog";
};
String RID_STR_TLB_MACROS
......
......@@ -40,7 +40,6 @@ class ModulWindow;
class ModulWindowLayout;
class DialogWindow;
class SdrView;
class ObjectCatalog;
class BasicIDETabBar;
class TabBar;
class IDEBaseWindow;
......@@ -69,8 +68,6 @@ friend class LocalizationMgr;
friend bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName );
friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName );
ObjectCatalog* pObjectCatalog;
IDEWindowTable aIDEWindowTable;
sal_uInt16 nCurKey;
IDEBaseWindow* pCurWin;
......@@ -98,7 +95,6 @@ friend class ContainerListenerImpl;
void CheckWindows();
void RemoveWindows( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, bool bDestroy );
void UpdateWindows();
void ShowObjectDialog( bool bShow, bool bCreateOrDestroy );
void InvalidateBasicIDESlots();
void StoreAllWindowData( bool bPersistent = true );
void SetMDITitle();
......@@ -109,7 +105,6 @@ friend class ContainerListenerImpl;
void ImplStartListening( StarBASIC* pBasic );
DECL_LINK( TabBarHdl, TabBar* );
DECL_LINK(ObjectDialogCancelHdl, void *);
DECL_LINK( TabBarSplitHdl, TabBar * );
#endif
......@@ -167,7 +162,6 @@ public:
const ScriptDocument&
GetCurDocument() const { return m_aCurDocument; }
const ::rtl::OUString& GetCurLibName() const { return m_aCurLibName; }
ObjectCatalog* GetObjectCatalog() const { return pObjectCatalog; }
boost::shared_ptr<LocalizationMgr> GetCurLocalizationMgr() const { return m_pCurLocalizationMgr; }
ScrollBar& GetHScrollBar() { return aHScrollBar; }
......@@ -221,6 +215,8 @@ public:
GetCurrentDocument() const;
bool SourceLinesDisplayed();
void UpdateObjectCatalog ();
};
#endif // _BASIDESH_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