31#include <sfx2/sfxsids.hrc>
76 if (eState != SfxItemState::DEFAULT)
92 ,
m_xWidget(m_xBuilder->weld_combo_box(
"combobox"))
109 return HandleKeyInput(rKEvt);
195 DBG_ASSERT(pCurSh,
"Current ViewShell not found!");
233 for (
auto const& doc : aDocuments)
253 sal_Int32 nLibCount = aLibNames.getLength();
254 const OUString* pLibNames = aLibNames.getConstArray();
256 for (sal_Int32
i = 0;
i < nLibCount; ++
i)
258 OUString aLibName = pLibNames[
i];
329 const OUString& aLibName = pEntry->
GetLibName();
330 SfxStringItem aLibNameItem(SID_BASICIDE_ARG_LIBNAME, aLibName);
332 pDispatcher->ExecuteList(SID_BASICIDE_LIBSELECTED, SfxCallMode::SYNCHRON,
333 { &aDocumentItem, &aLibNameItem });
379 if (eState != SfxItemState::DEFAULT)
380 pBox->set_sensitive(
false);
383 pBox->set_sensitive(
true);
397 , msNotLocalizedStr(
IDEResId(RID_STR_TRANSLATION_NOTLOCALIZED))
398 , msDefaultLanguageStr(
IDEResId(RID_STR_TRANSLATION_DEFAULT))
399 , mbIgnoreSelect(false)
421 sal_Int32 nSelPos = -1;
423 std::shared_ptr<LocalizationMgr> pCurMgr(
GetShell()->GetCurLocalizationMgr());
424 if (pCurMgr->isLibraryLocalized())
427 Locale aDefaultLocale = pCurMgr->getStringResourceManager()->getDefaultLocale();
428 Locale aCurrentLocale = pCurMgr->getStringResourceManager()->getCurrentLocale();
429 Sequence<Locale> aLocaleSeq = pCurMgr->getStringResourceManager()->getLocales();
431 sal_Int32
i,
nCount = aLocaleSeq.getLength();
519 if (pItem && !pItem->
GetValue().isEmpty())
static weld::Window * GetDefDialogParent()
const OUString & GetValue() const
bool ChildKeyInput(const KeyEvent &rKEvt)
virtual void dispose() override
void InitControlBase(weld::Widget *pWidget)
const vcl::KeyCode & GetKeyCode() const
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
vcl::Window * GetWindow() const
static OUString GetLanguageString(const LanguageType eType)
static VclPtr< reference_type > Create(Arg &&... arg)
Base class for all ComboBox elements.
virtual void onDocumentTitleChanged(const ScriptDocument &_rDoc) override
Not interested in. Do nothing.
virtual void onDocumentClosed(const ScriptDocument &_rDoc) override
Only calls FillBox(). Parameter is not used.
virtual void onDocumentModeChanged(const ScriptDocument &_rDoc) override
Not interested in. Do nothing.
virtual void dispose() override
void set_sensitive(bool bSensitive)
DocListenerBox(vcl::Window *pParent)
std::unique_ptr< weld::ComboBox > m_xWidget
virtual void onDocumentSaveAs(const ScriptDocument &_rDoc) override
Not interested in. Do nothing.
virtual void onDocumentCreated(const ScriptDocument &_rDoc) override
Only calls FillBox(). Parameter is not used.
virtual void onDocumentOpened(const ScriptDocument &_rDoc) override
Only calls FillBox(). Parameter is not used.
virtual void onDocumentSave(const ScriptDocument &_rDoc) override
Not interested in. Do nothing.
virtual void onDocumentSaveDone(const ScriptDocument &_rDoc) override
Not interested in. Do nothing.
DocumentEventNotifier maNotifier
virtual void onDocumentSaveAsDone(const ScriptDocument &_rDoc) override
Only calls FillBox(). Parameter is not used.
virtual ~DocListenerBox() override
virtual bool HandleKeyInput(const KeyEvent &rKEvt)
key strokes the ComboBox receives
ScriptDocument const & GetDocument() const
Manage stats of Language ComboBox.
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
LanguageBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
virtual void FillBox() override
Fill up the language combobox.
void ClearBox()
Delete all languages from ComboBox.
OUString msNotLocalizedStr
virtual void dispose() override
void Update(const SfxStringItem *pItem)
bool mbIgnoreSelect
do not use in this class
virtual bool HandleKeyInput(const KeyEvent &rKEvt) override
OUString msDefaultLanguageStr
void SetLanguage()
Switch interface of dialog to selected language.
virtual void Select() override
Called for setting language when user selects a language in ComboBox.
virtual ~LanguageBox() override
LanguageBox(vcl::Window *pParent)
Manage states of macro and dialog Library ComboBox.
LibBoxControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSlotID, SfxItemState eState, const SfxPoolItem *pState) override
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Macros and Dialogs Library ComboBox.
virtual bool HandleKeyInput(const KeyEvent &rKEvt) override
virtual void dispose() override
virtual void Select() override
Called for setting language when user selects a language in ComboBox.
bool mbFillBox
If true, when FillBox() is called.
LibBox(vcl::Window *pParent)
virtual ~LibBox() override
virtual void FillBox() override
Fill up the combobox.
void InsertEntries(const ScriptDocument &rDocument, LibraryLocation eLocation)
void Update(const SfxStringItem *pItem)
static void ReleaseFocus()
OUString const & GetLibName() const
encapsulates a document which contains Basic scripts and dialogs
OUString getTitle(LibraryLocation _eLocation, LibraryType _eType=LibraryType::All) const
returns the title for the document
@ DocumentsSorted
real documents only, sorted lexicographically by their title (using the sys locale's default collator...
static ScriptDocuments getAllScriptDocuments(ScriptDocumentList _eListType)
returns the set of ScriptDocument instances, one for each open document which contains Basic/Dialog c...
static const ScriptDocument & getApplicationScriptDocument()
returns a reference to a shared ScriptDocument instance which operates on the application-wide script...
css::uno::Sequence< OUString > getLibraryNames() const
retrieves the (combined) names of all script and dialog libraries
LibraryLocation getLibraryLocation(const OUString &_rLibName) const
returns the location of a library given by name
const std::shared_ptr< LocalizationMgr > & GetCurLocalizationMgr() const
sal_uInt16 GetCode() const
virtual void SetSizePixel(const Size &rNewSize)
void Enable(bool bEnable=true, bool bChild=true)
#define DBG_ASSERT(sCon, aError)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
#define LINK(Instance, Class, Member)
OUString CreateMgrAndLibStr(std::u16string_view rMgrName, std::u16string_view rLibName)
@ LIBRARY_LOCATION_UNKNOWN
@ LIBRARY_LOCATION_DOCUMENT
bool localesAreEqual(const Locale &rLocaleLeft, const Locale &rLocaleRight)
SfxDispatcher * GetDispatcher()
IMPL_LINK(AccessibleDialogWindow, WindowEventListener, VclWindowEvent &, rEvent, void)
std::vector< ScriptDocument > ScriptDocuments
IMPL_LINK_NOARG(EditorWindow, SetSourceInBasicHdl, void *, void)
OUString IDEResId(TranslateId aId)
SFX_IMPL_TOOLBOX_CONTROL(LibBoxControl, SfxStringItem)
OUString toId(const void *pValue)
css::lang::Locale m_aLocale