Kaydet (Commit) 2d3baccf authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Math: new rendered Elements docking window added

Added a docking window with elements that are rendered using the
math renderer insted of static pictures. Currently this is an
alternative to the existing elements floating window which will
be removed when the new one is ready. This is an initial but
fully functional version.

Change-Id: I7678d09d643c532c672447026b0f12b7b70fc91d
üst c0b8dd85
......@@ -156,6 +156,11 @@
<value xml:lang="en-US">Elements</value>
</prop>
</node>
<node oor:name=".uno:ElementsDockingWindow" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Elements Dock</value>
</prop>
</node>
<node oor:name=".uno:FormelCursor" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Formula Cursor</value>
......
......@@ -53,6 +53,7 @@ $(eval $(call gb_Library_use_libraries,sm,\
))
$(eval $(call gb_Library_add_exception_objects,sm,\
starmath/source/ElementsDockingWindow \
starmath/source/accessibility \
starmath/source/action \
starmath/source/caret \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _ELEMENTSDOCKINGWINDOW_HXX_
#define _ELEMENTSDOCKINGWINDOW_HXX_
#include <sfx2/ctrlitem.hxx>
#include <sfx2/dockwin.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/graph.hxx>
#include <svx/dlgctrl.hxx>
#include <document.hxx>
class SmElement
{
SmNode* mpNode;
OUString maText;
public:
SmElement(SmNode* pNode, OUString aText);
virtual ~SmElement();
SmNode* getNode();
OUString getText() { return maText; }
virtual bool isSeparator()
{
return false;
}
Point mBoxLocation;
Size mBoxSize;
};
class SmElementSeparator : public SmElement
{
public:
SmElementSeparator();
virtual bool isSeparator()
{
return true;
}
};
class SmElementsControl : public Control
{
static const sal_uInt16 aUnaryBinaryOperatorsList[];
static const sal_uInt16 aRelationsList[];
static const sal_uInt16 aSetOperations[];
static const sal_uInt16 aFunctions[];
static const sal_uInt16 aOperators[];
static const sal_uInt16 aAttributes[];
static const sal_uInt16 aBrackets[];
static const sal_uInt16 aFormats[];
static const sal_uInt16 aOthers[];
Link aSelectHdlLink;
virtual void Paint(const Rectangle&);
virtual void MouseButtonDown(const MouseEvent& rMEvt);
virtual void MouseMove( const MouseEvent& rMEvt );
SmDocShell* mpDocShell;
SmFormat maFormat;
sal_uInt16 maCurrentSetId;
SmElement* mpCurrentElement;
std::vector<SmElement*> maElementList;
Size maMaxElementDimensions;
void addElement(OUString aElementVisual, OUString aElementSource);
void addElements(const sal_uInt16 aElementsArray[], sal_uInt16 size);
void addSeparator();
void build();
public:
SmElementsControl(Window *pParent, const ResId& rResId);
void setElementSetId(sal_uInt16 aSetId);
void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; }
};
class SmElementsDockingWindow : public SfxDockingWindow
{
static const sal_uInt16 aCategories[];
SmElementsControl maElementsControl;
ListBox maElementListBox;
virtual void Resize();
SmViewShell* GetView();
DECL_LINK(SelectClickHdl, SmElement*);
DECL_LINK(ElementSelectedHandle, ListBox*);
public:
SmElementsDockingWindow( SfxBindings* pBindings,
SfxChildWindow* pChildWindow,
Window* pParent );
~SmElementsDockingWindow();
};
class SmElementsDockingWindowWrapper : public SfxChildWindow
{
SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper);
protected:
SmElementsDockingWindowWrapper( Window* pParentWindow,
sal_uInt16 nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo );
virtual ~SmElementsDockingWindowWrapper();
};
#endif // _SYMBOLDOCKINGWINDOW_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -56,6 +56,7 @@
#define SID_INSERTSYMBOL (SID_SMA_START + 104)
/** Command for inserting a math construction specified in commands.src */
#define SID_INSERTCOMMAND (SID_SMA_START + 105)
#define SID_INSERTCOMMANDTEXT (SID_SMA_START + 106)
#define SID_LOADSYMBOLS (SID_SMA_START + 107)
#define SID_SAVESYMBOLS (SID_SMA_START + 108)
......@@ -77,6 +78,7 @@
#define SID_TOOLBOXWINDOW (SID_SMA_START + 123)
#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124)
#define SID_SAVE_ONLY_USED_SYMBOLS (SID_SMA_START + 125)
#define SID_ELEMENTSDOCKINGWINDOW (SID_SMA_START + 126)
#define RID_FONTDIALOG (RID_APP_START + 2)
......@@ -110,6 +112,7 @@
#define RID_SYMBOLFILESSTR (RID_APP_START + 809)
#define RID_ALLFILESSTR (RID_APP_START + 810)
#define RID_STATUSBAR (RID_APP_START + 816)
#define RID_ELEMENTSDOCKINGWINDOW (RID_APP_START + 817)
#define STR_MATH_DOCUMENT_FULLTYPE_CURRENT (RID_APP_START + 821)
#define STR_STATSTR_READING (RID_APP_START + 823)
......@@ -281,6 +284,39 @@
#define RID_LIMINFX (RID_APP_START + 1616)
#define RID_LIMSUPX (RID_APP_START + 1617)
#define RID_LIM_FROMX (RID_APP_START + 1621)
#define RID_SUM_FROMX (RID_APP_START + 1622)
#define RID_PROD_FROMX (RID_APP_START + 1623)
#define RID_COPROD_FROMX (RID_APP_START + 1624)
#define RID_INT_FROMX (RID_APP_START + 1625)
#define RID_IINT_FROMX (RID_APP_START + 1626)
#define RID_IIINT_FROMX (RID_APP_START + 1627)
#define RID_LINT_FROMX (RID_APP_START + 1629)
#define RID_LLINT_FROMX (RID_APP_START + 1630)
#define RID_LLLINT_FROMX (RID_APP_START + 1631)
#define RID_LIM_TOX (RID_APP_START + 1641)
#define RID_SUM_TOX (RID_APP_START + 1642)
#define RID_PROD_TOX (RID_APP_START + 1643)
#define RID_COPROD_TOX (RID_APP_START + 1644)
#define RID_INT_TOX (RID_APP_START + 1645)
#define RID_IINT_TOX (RID_APP_START + 1646)
#define RID_IIINT_TOX (RID_APP_START + 1647)
#define RID_LINT_TOX (RID_APP_START + 1649)
#define RID_LLINT_TOX (RID_APP_START + 1650)
#define RID_LLLINT_TOX (RID_APP_START + 1651)
#define RID_LIM_FROMTOX (RID_APP_START + 1661)
#define RID_SUM_FROMTOX (RID_APP_START + 1662)
#define RID_PROD_FROMTOX (RID_APP_START + 1663)
#define RID_COPROD_FROMTOX (RID_APP_START + 1664)
#define RID_INT_FROMTOX (RID_APP_START + 1665)
#define RID_IINT_FROMTOX (RID_APP_START + 1666)
#define RID_IIINT_FROMTOX (RID_APP_START + 1667)
#define RID_LINT_FROMTOX (RID_APP_START + 1669)
#define RID_LLINT_FROMTOX (RID_APP_START + 1670)
#define RID_LLLINT_FROMTOX (RID_APP_START + 1671)
#define RID_ACUTEX (RID_APP_START + 1701)
#define RID_GRAVEX (RID_APP_START + 1702)
#define RID_CHECKX (RID_APP_START + 1703)
......@@ -396,6 +432,16 @@
#define RID_SPANISH_50_NAMES (RID_APP_START + 3113)
#define RID_SPANISH_60_NAMES (RID_APP_START + 3114)
#define RID_CATERGORY_UNARY_BINARY_OPERATORS (RID_APP_START + 4001)
#define RID_CATERGORY_RELATIONS (RID_APP_START + 4002)
#define RID_CATERGORY_SET_OPERATIONS (RID_APP_START + 4003)
#define RID_CATERGORY_FUNCTIONS (RID_APP_START + 4004)
#define RID_CATERGORY_OPERATORS (RID_APP_START + 4005)
#define RID_CATERGORY_ATTRIBUTES (RID_APP_START + 4006)
#define RID_CATERGORY_BRACKETS (RID_APP_START + 4007)
#define RID_CATERGORY_FORMATS (RID_APP_START + 4008)
#define RID_CATERGORY_OTHERS (RID_APP_START + 4009)
#define RID_CATERGORY_EXAMPLES (RID_APP_START + 4010)
#define BMP_ARROW_RIGHT 1
......@@ -406,6 +452,8 @@
#define MN_SUB_SPELLING 34
#define MN_SUB_TEMPLATES 35
#define FT_1 1
// 342 == SCH_IF_SMAVIEWSHELL, because SFX_INTERFACE_LIB is no
// Define but latterly an Enum
#define HID_SMA_VIEWSHELL_DOCUMENT (342)
......
......@@ -164,6 +164,31 @@ SfxVoidItem CommandWindow SID_CMDBOXWINDOW
GroupId = GID_VIEW;
]
//--------------------------------------------------------------------------
SfxVoidItem ElementsDockingWindow SID_ELEMENTSDOCKINGWINDOW
()
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_VIEW;
]
//--------------------------------------------------------------------------
SfxVoidItem Preferences SID_PREFERENCES
()
......@@ -368,6 +393,30 @@ SfxVoidItem InsertCommand SID_INSERTCOMMAND
GroupId = GID_INSERT;
]
SfxVoidItem InsertCommandText SID_INSERTCOMMANDTEXT
()
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Asynchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_INSERT;
]
//--------------------------------------------------------------------------
SfxVoidItem InsertConfigName SID_INSERTSYMBOL
()
......@@ -777,7 +826,7 @@ SfxStringItem TextStatus SID_TEXTSTATUS
]
//--------------------------------------------------------------------------
SfxVoidItem ToolBowWindow SID_TOOLBOXWINDOW
SfxVoidItem ToolBoxWindow SID_TOOLBOXWINDOW
()
[
/* flags: */
......@@ -952,4 +1001,3 @@ SfxVoidItem ZoomOut SID_ZOOMOUT
ToolBoxConfig = TRUE,
GroupId = GID_VIEW;
]
......@@ -260,6 +260,11 @@ interface FormulaView
ExecMethod = Execute ;
StateMethod = GetState ;
]
SID_INSERTCOMMANDTEXT
[
ExecMethod = Execute ;
StateMethod = GetState ;
]
//idlpp kein Menueeintrag , also keine Texte
SID_INSERTSYMBOL //idlpp ole : no , status : no
[
......@@ -296,6 +301,11 @@ interface FormulaView
ExecMethod = NoExec ;
StateMethod = NoState ;
]
SID_ELEMENTSDOCKINGWINDOW
[
ExecMethod = Execute ;
StateMethod = GetState ;
]
//idlpp kein Menueeintrag , also keine Texte
SID_TOOLBOXWINDOW //idlpp ole : no , status : no
[
......@@ -320,4 +330,3 @@ shell SmViewShell
}
}
This diff is collapsed.
......@@ -105,20 +105,50 @@ String RID_ARCOSHX { Text = "arcosh(<?>) " ; };
String RID_ARTANHX { Text = "artanh(<?>) " ; };
String RID_ARCOTHX { Text = "arcoth(<?>) " ; };
String RID_SUMX { Text = "sum <?> " ; };
String RID_SUM_FROMX { Text = "sum from{<?>} <?> " ; };
String RID_SUM_TOX { Text = "sum to{<?>} <?> " ; };
String RID_SUM_FROMTOX { Text = "sum from{<?>} to{<?>} <?> " ; };
String RID_PRODX { Text = "prod <?> " ; };
String RID_PROD_FROMX { Text = "prod from{<?>} <?> " ; };
String RID_PROD_TOX { Text = "prod to{<?>} <?> " ; };
String RID_PROD_FROMTOX { Text = "prod from{<?>} to{<?>} <?> " ; };
String RID_COPRODX { Text = "coprod <?> " ; };
String RID_COPROD_FROMX { Text = "coprod from{<?>} <?> " ; };
String RID_COPROD_TOX { Text = "coprod to{<?>} <?> " ; };
String RID_COPROD_FROMTOX { Text = "coprod from{<?>} to{<?>} <?> " ; };
String RID_LIMX { Text = "lim <?> " ; };
String RID_LIM_FROMX { Text = "lim from{<?>} <?> " ; };
String RID_LIM_TOX { Text = "lim to{<?>} <?> " ; };
String RID_LIM_FROMTOX { Text = "lim from{<?>} to{<?>} <?> " ; };
String RID_LIMINFX { Text = "liminf <?> " ; };
String RID_LIMSUPX { Text = "limsup <?> " ; };
String RID_EXISTS { Text = "exists " ; };
String RID_NOTEXISTS { Text = "notexists " ; };
String RID_FORALL { Text = "forall " ; };
String RID_INTX { Text = "int <?> " ; };
String RID_INT_FROMX { Text = "int from{<?>} <?> " ; };
String RID_INT_TOX { Text = "int to{<?>} <?> " ; };
String RID_INT_FROMTOX { Text = "int from{<?>} to{<?>} <?> " ; };
String RID_IINTX { Text = "iint <?> " ; };
String RID_IINT_FROMX { Text = "iint from{<?>} <?> " ; };
String RID_IINT_TOX { Text = "iint to{<?>} <?> " ; };
String RID_IINT_FROMTOX { Text = "iint from{<?>} to{<?>} <?> " ; };
String RID_IIINTX { Text = "iiint <?> " ; };
String RID_IIINT_FROMX { Text = "iiint from{<?>} <?> " ; };
String RID_IIINT_TOX { Text = "iiint to{<?>} <?> " ; };
String RID_IIINT_FROMTOX { Text = "iiint from{<?>} to{<?>} <?> " ; };
String RID_LINTX { Text = "lint <?> " ; };
String RID_LINT_FROMX { Text = "lint from{<?>} <?> " ; };
String RID_LINT_TOX { Text = "lint to{<?>} <?> " ; };
String RID_LINT_FROMTOX { Text = "lint from{<?>} to{<?>} <?> " ; };
String RID_LLINTX { Text = "llint <?> " ; };
String RID_LLINT_FROMX { Text = "llint from{<?>} <?> " ; };
String RID_LLINT_TOX { Text = "llint to{<?>} <?> " ; };
String RID_LLINT_FROMTOX { Text = "llint from{<?>} to{<?>} <?> " ; };
String RID_LLLINTX { Text = "lllint <?> " ; };
String RID_LLLINT_FROMX { Text = "lllint from{<?>} <?> " ; };
String RID_LLLINT_TOX { Text = "lllint to{<?>} <?> " ; };
String RID_LLLINT_FROMTOX { Text = "lllint from{<?>} to{<?>} <?> " ; };
String RID_FROMX { Text = "from{<?>} <?> " ; };
String RID_TOX { Text = "to{<?>} <?> " ; };
String RID_FROMXTOY { Text = "from{<?>} to{<?>} <?> " ; };
......@@ -226,6 +256,18 @@ String RID_XSUCCEEDSEQUALY { Text = "<?> succcurlyeq <?> " ; };
String RID_XSUCCEEDSEQUIVY { Text = "<?> succsim <?> " ; };
String RID_XNOTPRECEDESY { Text = "<?> nprec <?> " ; };
String RID_XNOTSUCCEEDSY { Text = "<?> nsucc <?> " ; };
String RID_CATERGORY_UNARY_BINARY_OPERATORS { Text = "Unary/Binary Operators" ; };
String RID_CATERGORY_RELATIONS { Text = "Relations" ; };
String RID_CATERGORY_SET_OPERATIONS { Text = "Set Operations" ; };
String RID_CATERGORY_FUNCTIONS { Text = "Functions" ; };
String RID_CATERGORY_OPERATORS { Text = "Operators" ; };
String RID_CATERGORY_ATTRIBUTES { Text = "Attributes" ; };
String RID_CATERGORY_BRACKETS { Text = "Brackets" ; };
String RID_CATERGORY_FORMATS { Text = "Formats" ; };
String RID_CATERGORY_OTHERS { Text = "Others" ; };
String RID_CATERGORY_EXAMPLES { Text = "Examples" ; };
//////////////////////////////////////////
......
......@@ -481,8 +481,6 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel
rDev.SetDrawMode( nOldDrawMode );
}
Size SmDocShell::GetSize()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::GetSize" );
......@@ -645,7 +643,7 @@ void SmDocShell::SetPrinter( SfxPrinter *pNew )
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::SetPrinter" );
delete pPrinter;
pPrinter = pNew; //Eigentumsuebergang!
pPrinter = pNew; //Transfer ownership
pPrinter->SetMapMode( MapMode(MAP_100TH_MM) );
SetFormulaArranged(false);
Repaint();
......
......@@ -33,6 +33,8 @@
#include <toolbox.hxx>
#include <view.hxx>
#include <ElementsDockingWindow.hxx>
#include <starmath.hrc>
#include <svx/xmlsecctrl.hxx>
......@@ -72,6 +74,7 @@ namespace
SmToolBoxWrapper::RegisterChildWindow(true);
SmCmdBoxWrapper::RegisterChildWindow(true);
SmElementsDockingWindowWrapper::RegisterChildWindow(true);
::sfx2::TaskPaneWrapper::RegisterChildWindow(false, pModule);
}
......
......@@ -77,8 +77,8 @@ ModalDialog RID_FONTDIALOG
Pos = MAP_APPFONT ( 126 , 42 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_FONTDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_FONTDIALOG:1";
Text [ en-US ] = "~Help" ;
};
OKButton 1
{
......@@ -271,8 +271,8 @@ ModalDialog RID_FONTSIZEDIALOG
Pos = MAP_APPFONT ( 114 , 46 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 1
{
......@@ -443,8 +443,8 @@ ModalDialog RID_FONTTYPEDIALOG
Pos = MAP_APPFONT ( 225 , 66 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_FONTYPEDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_FONTYPEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 2
{
......@@ -572,8 +572,8 @@ ModalDialog RID_DISTANCEDIALOG
Pos = MAP_APPFONT ( 184 , 87 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_DISTANCEDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_DISTANCEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 1
{
......@@ -925,8 +925,8 @@ ModalDialog RID_ALIGNDIALOG
Pos = MAP_APPFONT ( 83 , 46 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_ALIGNDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_ALIGNDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 1
{
......@@ -1121,8 +1121,8 @@ ModalDialog RID_SYMBOLDIALOG
Pos = MAP_APPFONT ( 177 , 60 ) ;
Size = MAP_APPFONT ( 56 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_SYMBOLDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_SYMBOLDIALOG:1";
Text [ en-US ] = "~Help" ;
};
};
......@@ -1339,8 +1339,8 @@ ModalDialog RID_SYMDEFINEDIALOG
Pos = MAP_APPFONT ( 310 , 42 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_SYMDEFINEDIALOG:1";
Text [ en-US ] = "~Help" ;
HelpID = "starmath:HelpButton:RID_SYMDEFINEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
OKButton 1
{
......@@ -1569,6 +1569,35 @@ DockingWindow RID_CMDBOXWINDOW\
CMDBOXWINDOW_TEXT
};
DockingWindow RID_ELEMENTSDOCKINGWINDOW
{
OutputSize = TRUE ;
Hide = FALSE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 300 , 300 ) ;
Sizeable = TRUE ;
Moveable = TRUE ;
Closeable = TRUE ;
Zoomable = TRUE ;
Dockable = TRUE ;
Control 1
{
Border = FALSE ;
};
ListBox 1
{
Border = TRUE ;
TabStop = TRUE ;
Sort = FALSE ;
DropDown = TRUE ;
VScroll = TRUE ;
};
Text [ en-US ] = "Symbols" ;
};
String STR_CMDBOXWINDOW
{
......
......@@ -70,12 +70,13 @@
#include "mathmlimport.hxx"
#include "cursor.hxx"
#include "accessibility.hxx"
#include "ElementsDockingWindow.hxx"
#define MINZOOM 25
#define MAXZOOM 800
// space around the edit window, in pixels
#define CMD_BOX_PADDING 4
#define CMD_BOX_PADDING 10
#define SmViewShell
#include "smslots.hxx"
......@@ -382,27 +383,30 @@ void SmGraphicWindow::Paint(const Rectangle&)
rDoc.DrawFormula(*this, aPoint, true); //! modifies aPoint to be the topleft
//! corner of the formula
SetFormulaDrawPos(aPoint);
if(IsInlineEditEnabled()) {
if(IsInlineEditEnabled())
{
//Draw cursor if any...
if(pViewShell->GetDoc()->HasCursor() && IsLineVisible())
pViewShell->GetDoc()->GetCursor().Draw(*this, aPoint, IsCursorVisible());
} else {
SetIsCursorVisible(false); // (old) cursor must be drawn again
const SmEditWindow *pEdit = pViewShell->GetEditWindow();
if (pEdit)
{ // get new position for formula-cursor (for possible altered formula)
sal_Int32 nRow;
sal_uInt16 nCol;
SmGetLeftSelectionPart(pEdit->GetSelection(), nRow, nCol);
nRow++;
nCol++;
const SmNode *pFound = SetCursorPos(static_cast<sal_uInt16>(nRow), nCol);
SmModule *pp = SM_MOD();
if (pFound && pp->GetConfig()->IsShowFormulaCursor())
ShowCursor(true);
}
else
{
SetIsCursorVisible(false); // (old) cursor must be drawn again
const SmEditWindow *pEdit = pViewShell->GetEditWindow();
if (pEdit)
{ // get new position for formula-cursor (for possible altered formula)
sal_Int32 nRow;
sal_uInt16 nCol;
SmGetLeftSelectionPart(pEdit->GetSelection(), nRow, nCol);
nRow++;
nCol++;
const SmNode *pFound = SetCursorPos(static_cast<sal_uInt16>(nRow), nCol);
SmModule *pp = SM_MOD();
if (pFound && pp->GetConfig()->IsShowFormulaCursor())
ShowCursor(true);
}
}
}
......@@ -927,6 +931,7 @@ SFX_IMPL_INTERFACE(SmViewShell, SfxViewShell, SmResId(0))
SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE);
SFX_CHILDWINDOW_REGISTRATION(SmToolBoxWrapper::GetChildWindowId());
SFX_CHILDWINDOW_REGISTRATION(SmCmdBoxWrapper::GetChildWindowId());
SFX_CHILDWINDOW_REGISTRATION(SmElementsDockingWindowWrapper::GetChildWindowId());
}
......@@ -1705,6 +1710,23 @@ void SmViewShell::Execute(SfxRequest& rReq)
break;
}
case SID_INSERTCOMMANDTEXT:
{
const SfxStringItem& rItem = (const SfxStringItem&)rReq.GetArgs()->Get(SID_INSERTCOMMANDTEXT);
if (pWin && (bInsertIntoEditWindow || !IsInlineEditEnabled()))
{
pWin->InsertText(rItem.GetValue());
}
if (IsInlineEditEnabled() && (GetDoc() && !bInsertIntoEditWindow))
{
GetDoc()->GetCursor().InsertCommandText(rItem.GetValue());
GetGraphicWindow().GrabFocus();
}
break;
}
case SID_INSERTSYMBOL:
{
const SfxStringItem& rItem =
......@@ -1837,6 +1859,15 @@ void SmViewShell::Execute(SfxRequest& rReq)
}
break;
case SID_ELEMENTSDOCKINGWINDOW:
{
GetViewFrame()->ToggleChildWindow( SmElementsDockingWindowWrapper::GetChildWindowId() );
GetViewFrame()->GetBindings().Invalidate( SID_ELEMENTSDOCKINGWINDOW );
rReq.Ignore ();
}
break;
case SID_SYMBOLS_CATALOGUE:
{
......@@ -1927,7 +1958,16 @@ void SmViewShell::GetState(SfxItemSet &rSet)
rSet.Put(SfxBoolItem(nWh, pp->GetConfig()->IsShowFormulaCursor()));
}
break;
case SID_ELEMENTSDOCKINGWINDOW:
{
bool bState = false;
SfxChildWindow *pChildWnd = GetViewFrame()->
GetChildWindow( SmElementsDockingWindowWrapper::GetChildWindowId() );
if (pChildWnd && pChildWnd->GetWindow()->IsVisible())
bState = true;
rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState));
}
break;
case SID_TOOLBOX:
{
bool bState = false;
......
......@@ -81,6 +81,7 @@
<menu:menuitem menu:id=".uno:StatusBarVisible"/>
<menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
<menu:menuitem menu:id=".uno:ToolBox"/>
<menu:menuitem menu:id=".uno:ElementsDockingWindow"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:TaskPane"/>
<menu:menuseparator/>
......
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