2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
#include <basidesh.hrc>
|
2001-09-06 08:21:02 +00:00
|
|
|
#include <basidesh.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <basobj.hxx>
|
|
|
|
|
|
|
|
#include <basicbox.hxx>
|
|
|
|
#include <iderid.hxx>
|
2001-09-06 08:21:02 +00:00
|
|
|
#include <iderdll.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <bastypes.hxx>
|
2004-07-23 11:00:50 +00:00
|
|
|
#include "bastype2.hxx"
|
|
|
|
#include "basdoc.hxx"
|
2004-07-06 11:18:39 +00:00
|
|
|
|
2007-01-02 14:48:49 +00:00
|
|
|
#include "localizationmgr.hxx"
|
|
|
|
#include "managelang.hxx"
|
|
|
|
#include "dlgresid.hrc"
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/unolingu.hxx>
|
2007-11-23 15:44:34 +00:00
|
|
|
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/dinfdlg.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2007-11-23 15:44:34 +00:00
|
|
|
#include <svtools/langtab.hxx>
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2004-07-06 11:18:39 +00:00
|
|
|
using namespace ::com::sun::star;
|
2007-01-02 14:48:49 +00:00
|
|
|
using namespace ::com::sun::star::lang;
|
2004-07-23 11:00:50 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
SFX_IMPL_TOOLBOX_CONTROL( LibBoxControl, SfxStringItem );
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
LibBoxControl::LibBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
|
2004-07-06 11:18:39 +00:00
|
|
|
: SfxToolBoxControl( nSlotId, nId, rTbx )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LibBoxControl::~LibBoxControl()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
void LibBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LibBox* pBox = (LibBox*)GetToolBox().GetItemWindow(GetId());
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
DBG_ASSERT( pBox, "Box not found" );
|
|
|
|
if ( !pBox )
|
|
|
|
return;
|
|
|
|
|
|
|
|
if ( eState != SFX_ITEM_AVAILABLE )
|
|
|
|
pBox->Disable();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pBox->Enable();
|
2012-08-07 14:33:56 +02:00
|
|
|
pBox->Update(dynamic_cast<SfxStringItem const*>(pState));
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Window* LibBoxControl::CreateItemWindow( Window *pParent )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
return new LibBox( pParent, m_xFrame );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2007-10-09 14:20:55 +00:00
|
|
|
//=============================================================================
|
|
|
|
//= DocListenerBox
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
DocListenerBox::DocListenerBox( Window* pParent )
|
|
|
|
:ListBox( pParent, WinBits( WB_BORDER | WB_DROPDOWN ) )
|
|
|
|
,m_aNotifier( *this )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
DocListenerBox::~DocListenerBox()
|
|
|
|
{
|
|
|
|
m_aNotifier.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
FillBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentOpened( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
FillBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentSave( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
// not interested in
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentSaveDone( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
// not interested in
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentSaveAs( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
// not interested in
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentSaveAsDone( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
FillBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentClosed( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
undoapi: removed SfxApplication::IsInBasicCall
It checked a counter for being != 0 which, effectively, was set to 1 at application
startup, and never reset to 0 (though incremented and decremented by calls to Enter/LeaveBasicCall).
So, IsInBasicCall was meaningless.
Consequently, Enter/LeaveBasicCall collapse to empty operations, not doing anything anymore.
Will (hopefully) remove those, too, but need them for the moment to track and judge, guess, basic calls ...
2010-11-01 15:17:35 +01:00
|
|
|
FillBox();
|
2007-10-09 14:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentTitleChanged( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
// not interested in
|
|
|
|
}
|
|
|
|
|
|
|
|
void DocListenerBox::onDocumentModeChanged( const ScriptDocument& /*_rDocument*/ )
|
|
|
|
{
|
|
|
|
// not interested in
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
//= basctl::LibBox
|
2007-10-09 14:20:55 +00:00
|
|
|
//=============================================================================
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LibBox::LibBox( Window* pParent, const uno::Reference< frame::XFrame >& rFrame ) :
|
2007-10-09 14:20:55 +00:00
|
|
|
DocListenerBox( pParent ),
|
2004-07-06 11:18:39 +00:00
|
|
|
m_xFrame( rFrame )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
FillBox();
|
2012-07-20 06:11:34 +09:00
|
|
|
bIgnoreSelect = true; // do not yet transfer select of 0
|
|
|
|
bFillBox = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
SelectEntryPos( 0 );
|
|
|
|
aCurText = GetEntry( 0 );
|
2004-07-23 11:00:50 +00:00
|
|
|
SetSizePixel( Size( 250, 200 ) );
|
2012-07-20 06:11:34 +09:00
|
|
|
bIgnoreSelect = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LibBox::~LibBox()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-01-02 14:48:49 +00:00
|
|
|
ClearBox();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::Update( const SfxStringItem* pItem )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
// if ( !pItem || !pItem->GetValue().Len() )
|
|
|
|
FillBox();
|
|
|
|
|
|
|
|
if ( pItem )
|
|
|
|
{
|
|
|
|
aCurText = pItem->GetValue();
|
2013-03-01 19:08:22 +01:00
|
|
|
if ( aCurText.isEmpty() )
|
|
|
|
aCurText = OUString( IDEResId( RID_STR_ALL ) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( GetSelectEntry() != aCurText )
|
|
|
|
SelectEntry( aCurText );
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::ReleaseFocus()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
SfxViewShell* pCurSh = SfxViewShell::Current();
|
|
|
|
DBG_ASSERT( pCurSh, "Current ViewShell not found!" );
|
|
|
|
|
|
|
|
if ( pCurSh )
|
|
|
|
{
|
|
|
|
Window* pShellWin = pCurSh->GetWindow();
|
2011-08-22 11:39:37 +02:00
|
|
|
if ( !pShellWin )
|
2004-01-06 16:10:59 +00:00
|
|
|
pShellWin = Application::GetDefDialogParent();
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
pShellWin->GrabFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::FillBox()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
SetUpdateMode(false);
|
2012-07-20 06:11:34 +09:00
|
|
|
bIgnoreSelect = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
aCurText = GetSelectEntry();
|
|
|
|
|
|
|
|
SelectEntryPos( 0 );
|
2007-01-02 14:48:49 +00:00
|
|
|
ClearBox();
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2004-07-23 11:00:50 +00:00
|
|
|
// create list box entries
|
2013-03-01 19:08:22 +01:00
|
|
|
sal_uInt16 nPos = InsertEntry( OUString( IDEResId( RID_STR_ALL ) ), LISTBOX_APPEND );
|
|
|
|
SetEntryData( nPos, new LibEntry( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_UNKNOWN, OUString() ) );
|
2007-03-15 14:51:26 +00:00
|
|
|
InsertEntries( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_USER );
|
|
|
|
InsertEntries( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_SHARE );
|
|
|
|
|
2007-10-09 14:20:55 +00:00
|
|
|
ScriptDocuments aDocuments( ScriptDocument::getAllScriptDocuments( ScriptDocument::DocumentsSorted ) );
|
2007-03-15 14:51:26 +00:00
|
|
|
for ( ScriptDocuments::const_iterator doc = aDocuments.begin();
|
|
|
|
doc != aDocuments.end();
|
|
|
|
++doc
|
|
|
|
)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:51:26 +00:00
|
|
|
InsertEntries( *doc, LIBRARY_LOCATION_DOCUMENT );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SetUpdateMode(true);
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2007-10-09 14:20:55 +00:00
|
|
|
SelectEntry( aCurText );
|
|
|
|
if ( !GetSelectEntryCount() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
SelectEntryPos( GetEntryCount() );
|
2007-10-09 14:20:55 +00:00
|
|
|
aCurText = GetSelectEntry();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2012-07-20 06:11:34 +09:00
|
|
|
bIgnoreSelect = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::InsertEntries( const ScriptDocument& rDocument, LibraryLocation eLocation )
|
2004-07-23 11:00:50 +00:00
|
|
|
{
|
|
|
|
// get a sorted list of library names
|
2012-10-01 13:03:37 -03:00
|
|
|
Sequence< OUString > aLibNames = rDocument.getLibraryNames();
|
2004-07-23 11:00:50 +00:00
|
|
|
sal_Int32 nLibCount = aLibNames.getLength();
|
2012-10-01 13:03:37 -03:00
|
|
|
const OUString* pLibNames = aLibNames.getConstArray();
|
2004-07-23 11:00:50 +00:00
|
|
|
|
|
|
|
for ( sal_Int32 i = 0 ; i < nLibCount ; ++i )
|
|
|
|
{
|
2013-03-01 19:08:22 +01:00
|
|
|
OUString aLibName = pLibNames[ i ];
|
2007-03-15 14:51:26 +00:00
|
|
|
if ( eLocation == rDocument.getLibraryLocation( aLibName ) )
|
2004-07-23 11:00:50 +00:00
|
|
|
{
|
2013-03-01 19:08:22 +01:00
|
|
|
OUString aName( rDocument.getTitle( eLocation ) );
|
|
|
|
OUString aEntryText( CreateMgrAndLibStr( aName, aLibName ) );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nPos = InsertEntry( aEntryText, LISTBOX_APPEND );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
SetEntryData( nPos, new LibEntry( rDocument, eLocation, aLibName ) );
|
2004-07-23 11:00:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
long LibBox::PreNotify( NotifyEvent& rNEvt )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
long nDone = 0;
|
|
|
|
if( rNEvt.GetType() == EVENT_KEYINPUT )
|
|
|
|
{
|
|
|
|
KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nKeyCode = aKeyEvt.GetKeyCode().GetCode();
|
2000-09-29 10:02:42 +00:00
|
|
|
switch( nKeyCode )
|
|
|
|
{
|
|
|
|
case KEY_RETURN:
|
|
|
|
{
|
|
|
|
NotifyIDE();
|
|
|
|
nDone = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KEY_ESCAPE:
|
|
|
|
{
|
|
|
|
SelectEntry( aCurText );
|
|
|
|
ReleaseFocus();
|
|
|
|
nDone = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( rNEvt.GetType() == EVENT_GETFOCUS )
|
|
|
|
{
|
|
|
|
if ( bFillBox )
|
|
|
|
{
|
|
|
|
FillBox();
|
2012-07-20 06:11:34 +09:00
|
|
|
bFillBox = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
|
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
if ( !HasChildPathFocus(true) )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-07-20 06:11:34 +09:00
|
|
|
bIgnoreSelect = true;
|
|
|
|
bFillBox = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nDone ? nDone : ListBox::PreNotify( rNEvt );
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::Select()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( !IsTravelSelect() )
|
|
|
|
{
|
|
|
|
if ( !bIgnoreSelect )
|
|
|
|
NotifyIDE();
|
|
|
|
else
|
2011-08-22 11:39:37 +02:00
|
|
|
SelectEntry( aCurText ); // since 306... (Select after Escape)
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::NotifyIDE()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nSelPos = GetSelectEntryPos();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData(nSelPos)))
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-03-15 14:51:26 +00:00
|
|
|
ScriptDocument aDocument( pEntry->GetDocument() );
|
|
|
|
SfxUsrAnyItem aDocumentItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, uno::makeAny( aDocument.getDocumentOrNull() ) );
|
2013-03-01 19:08:22 +01:00
|
|
|
OUString aLibName = pEntry->GetLibName();
|
2004-07-23 11:00:50 +00:00
|
|
|
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
|
|
|
pDispatcher->Execute(
|
|
|
|
SID_BASICIDE_LIBSELECTED,
|
|
|
|
SFX_CALLMODE_SYNCHRON, &aDocumentItem, &aLibNameItem, 0L
|
|
|
|
);
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
ReleaseFocus();
|
|
|
|
}
|
2006-01-10 13:02:07 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LibBox::ClearBox()
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nCount = GetEntryCount();
|
|
|
|
for ( sal_uInt16 i = 0; i < nCount; ++i )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData( i ));
|
2007-01-02 14:48:49 +00:00
|
|
|
delete pEntry;
|
|
|
|
}
|
|
|
|
ListBox::Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// class LanguageBoxControl ----------------------------------------------
|
|
|
|
|
|
|
|
SFX_IMPL_TOOLBOX_CONTROL( LanguageBoxControl, SfxStringItem );
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
LanguageBoxControl::LanguageBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
|
2007-01-02 14:48:49 +00:00
|
|
|
: SfxToolBoxControl( nSlotId, nId, rTbx )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
LanguageBoxControl::~LanguageBoxControl()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-07 14:33:56 +02:00
|
|
|
void LanguageBoxControl::StateChanged( sal_uInt16 nID, SfxItemState eState, const SfxPoolItem* pItem )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
(void)nID;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (LanguageBox* pBox = static_cast<LanguageBox*>(GetToolBox().GetItemWindow(GetId())))
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
2012-08-07 14:33:56 +02:00
|
|
|
if (eState != SFX_ITEM_AVAILABLE)
|
2007-01-02 14:48:49 +00:00
|
|
|
pBox->Disable();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pBox->Enable();
|
2012-08-07 14:33:56 +02:00
|
|
|
pBox->Update(dynamic_cast<SfxStringItem const*>(pItem));
|
2007-01-02 14:48:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Window* LanguageBoxControl::CreateItemWindow( Window *pParent )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
return new LanguageBox( pParent );
|
2007-01-02 14:48:49 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
// class basctl::LanguageBox -----------------------------------------------
|
2007-01-02 14:48:49 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LanguageBox::LanguageBox( Window* pParent ) :
|
2007-01-02 14:48:49 +00:00
|
|
|
|
2007-10-09 14:20:55 +00:00
|
|
|
DocListenerBox( pParent ),
|
2007-01-02 14:48:49 +00:00
|
|
|
|
|
|
|
m_sNotLocalizedStr( IDEResId( RID_STR_TRANSLATION_NOTLOCALIZED ) ),
|
|
|
|
m_sDefaultLanguageStr( IDEResId( RID_STR_TRANSLATION_DEFAULT ) ),
|
|
|
|
|
|
|
|
m_bIgnoreSelect( false )
|
|
|
|
|
|
|
|
{
|
|
|
|
SetSizePixel( Size( 210, 200 ) );
|
|
|
|
|
|
|
|
FillBox();
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
LanguageBox::~LanguageBox()
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
ClearBox();
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LanguageBox::FillBox()
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
SetUpdateMode(false);
|
2007-01-02 14:48:49 +00:00
|
|
|
m_bIgnoreSelect = true;
|
|
|
|
m_sCurrentText = GetSelectEntry();
|
|
|
|
ClearBox();
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
boost::shared_ptr<LocalizationMgr> pCurMgr(GetShell()->GetCurLocalizationMgr());
|
2007-01-02 14:48:49 +00:00
|
|
|
if ( pCurMgr->isLibraryLocalized() )
|
|
|
|
{
|
|
|
|
Enable();
|
2007-11-23 15:44:34 +00:00
|
|
|
SvtLanguageTable aLangTable;
|
2007-01-02 14:48:49 +00:00
|
|
|
Locale aDefaultLocale = pCurMgr->getStringResourceManager()->getDefaultLocale();
|
|
|
|
Locale aCurrentLocale = pCurMgr->getStringResourceManager()->getCurrentLocale();
|
|
|
|
Sequence< Locale > aLocaleSeq = pCurMgr->getStringResourceManager()->getLocales();
|
|
|
|
const Locale* pLocale = aLocaleSeq.getConstArray();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Int32 i, nCount = aLocaleSeq.getLength();
|
|
|
|
sal_uInt16 nSelPos = LISTBOX_ENTRY_NOTFOUND;
|
2007-01-02 14:48:49 +00:00
|
|
|
for ( i = 0; i < nCount; ++i )
|
|
|
|
{
|
|
|
|
bool bIsDefault = localesAreEqual( aDefaultLocale, pLocale[i] );
|
|
|
|
bool bIsCurrent = localesAreEqual( aCurrentLocale, pLocale[i] );
|
2013-07-13 02:54:05 +02:00
|
|
|
LanguageType eLangType = LanguageTag::convertToLanguageType( pLocale[i] );
|
2013-03-01 19:08:22 +01:00
|
|
|
OUString sLanguage = aLangTable.GetString( eLangType );
|
2007-01-02 14:48:49 +00:00
|
|
|
if ( bIsDefault )
|
|
|
|
{
|
2013-03-01 19:08:22 +01:00
|
|
|
sLanguage += " ";
|
2007-01-02 14:48:49 +00:00
|
|
|
sLanguage += m_sDefaultLanguageStr;
|
|
|
|
}
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nPos = InsertEntry( sLanguage );
|
2007-01-02 14:48:49 +00:00
|
|
|
SetEntryData( nPos, new LanguageEntry( sLanguage, pLocale[i], bIsDefault ) );
|
|
|
|
|
|
|
|
if ( bIsCurrent )
|
|
|
|
nSelPos = nPos;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nSelPos != LISTBOX_ENTRY_NOTFOUND )
|
|
|
|
{
|
|
|
|
SelectEntryPos( nSelPos );
|
|
|
|
m_sCurrentText = GetSelectEntry();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
InsertEntry( m_sNotLocalizedStr );
|
|
|
|
SelectEntryPos(0);
|
|
|
|
Disable();
|
|
|
|
}
|
|
|
|
|
2012-08-07 08:36:40 +02:00
|
|
|
SetUpdateMode(true);
|
2007-01-02 14:48:49 +00:00
|
|
|
m_bIgnoreSelect = false;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LanguageBox::ClearBox()
|
2006-01-10 13:02:07 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nCount = GetEntryCount();
|
|
|
|
for ( sal_uInt16 i = 0; i < nCount; ++i )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
LanguageEntry* pEntry = (LanguageEntry*)GetEntryData(i);
|
|
|
|
delete pEntry;
|
|
|
|
}
|
2006-01-10 13:02:07 +00:00
|
|
|
ListBox::Clear();
|
|
|
|
}
|
2007-01-02 14:48:49 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LanguageBox::SetLanguage()
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
LanguageEntry* pEntry = (LanguageEntry*)GetEntryData( GetSelectEntryPos() );
|
|
|
|
if ( pEntry )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
GetShell()->GetCurLocalizationMgr()->handleSetCurrentLocale( pEntry->m_aLocale );
|
2007-01-02 14:48:49 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LanguageBox::Select()
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
if ( !m_bIgnoreSelect )
|
|
|
|
SetLanguage();
|
|
|
|
else
|
|
|
|
SelectEntry( m_sCurrentText ); // Select after Escape
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
long LanguageBox::PreNotify( NotifyEvent& rNEvt )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
long nDone = 0;
|
|
|
|
if( rNEvt.GetType() == EVENT_KEYINPUT )
|
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 nKeyCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
|
2007-01-02 14:48:49 +00:00
|
|
|
switch( nKeyCode )
|
|
|
|
{
|
|
|
|
case KEY_RETURN:
|
|
|
|
{
|
|
|
|
SetLanguage();
|
|
|
|
nDone = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KEY_ESCAPE:
|
|
|
|
{
|
|
|
|
SelectEntry( m_sCurrentText );
|
|
|
|
nDone = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( rNEvt.GetType() == EVENT_GETFOCUS )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
return nDone ? nDone : ListBox::PreNotify( rNEvt );
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void LanguageBox::Update( const SfxStringItem* pItem )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
FillBox();
|
|
|
|
|
2013-02-22 10:13:44 +00:00
|
|
|
if ( pItem && !pItem->GetValue().isEmpty() )
|
2007-01-02 14:48:49 +00:00
|
|
|
{
|
|
|
|
m_sCurrentText = pItem->GetValue();
|
|
|
|
if ( GetSelectEntry() != m_sCurrentText )
|
|
|
|
SelectEntry( m_sCurrentText );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
|
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|