Kaydet (Commit) 519f4b75 authored tarafından Caolán McNamara's avatar Caolán McNamara

teach SmShowChar how to resize

and other cleanups

Change-Id: I1f6a57a6cb7c06a37e9c845fa93815d31008e6e1
üst 26fdfce8
...@@ -373,6 +373,7 @@ public: ...@@ -373,6 +373,7 @@ public:
class SmShowChar : public Control class SmShowChar : public Control
{ {
virtual void Paint(const Rectangle&) SAL_OVERRIDE; virtual void Paint(const Rectangle&) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
public: public:
SmShowChar(Window *pParent, WinBits nStyle) SmShowChar(Window *pParent, WinBits nStyle)
...@@ -424,7 +425,6 @@ class SmSymDefineDialog : public ModalDialog ...@@ -424,7 +425,6 @@ class SmSymDefineDialog : public ModalDialog
DECL_LINK(AddClickHdl, Button *); DECL_LINK(AddClickHdl, Button *);
DECL_LINK(ChangeClickHdl, Button *); DECL_LINK(ChangeClickHdl, Button *);
DECL_LINK(DeleteClickHdl, Button *); DECL_LINK(DeleteClickHdl, Button *);
DECL_LINK(HelpButtonClickHdl, Button *);
void FillSymbols(ComboBox &rComboBox, bool bDeleteText = true); void FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
void FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true); void FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define HID_SMA_FONTDIALOG "STARMATH_HID_SMA_FONTDIALOG" #define HID_SMA_FONTDIALOG "STARMATH_HID_SMA_FONTDIALOG"
#define HID_SMA_DISTANCEDIALOG "STARMATH_HID_SMA_DISTANCEDIALOG" #define HID_SMA_DISTANCEDIALOG "STARMATH_HID_SMA_DISTANCEDIALOG"
#define HID_SMA_SYMDEFINEDIALOG "STARMATH_HID_SMA_SYMDEFINEDIALOG"
#define HID_SMA_WIN_DOCUMENT "STARMATH_HID_SMA_WIN_DOCUMENT" #define HID_SMA_WIN_DOCUMENT "STARMATH_HID_SMA_WIN_DOCUMENT"
#define HID_SMA_COMMAND_WIN_EDIT "STARMATH_HID_SMA_COMMAND_WIN_EDIT" #define HID_SMA_COMMAND_WIN_EDIT "STARMATH_HID_SMA_COMMAND_WIN_EDIT"
......
...@@ -269,7 +269,6 @@ void SmShowFont::SetFont(const Font& rFont) ...@@ -269,7 +269,6 @@ void SmShowFont::SetFont(const Font& rFont)
SetTextColor( aTxtColor ); SetTextColor( aTxtColor );
} }
IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox ) IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox )
{ {
Face.SetName(pComboBox->GetText()); Face.SetName(pComboBox->GetText());
...@@ -1615,8 +1614,16 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont ) ...@@ -1615,8 +1614,16 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont )
Invalidate(); Invalidate();
} }
void SmShowChar::Resize()
{
Control::Resize();
const OUString &rText = GetText();
if (rText.isEmpty())
return;
sal_Int32 nStrIndex = 0;
sal_UCS4 cChar = rText.iterateCodePoints(&nStrIndex);
SetSymbol(cChar, GetFont()); //force recalculation of size
}
void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, bool bDeleteText) void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, bool bDeleteText)
{ {
...@@ -1963,17 +1970,6 @@ void SmSymDefineDialog::UpdateButtons() ...@@ -1963,17 +1970,6 @@ void SmSymDefineDialog::UpdateButtons()
pDeleteBtn->Enable(bDelete); pDeleteBtn->Enable(bDelete);
} }
IMPL_LINK( SmSymDefineDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/ )
{
// start help system
Help* pHelp = Application::GetHelp();
if( pHelp )
{
pHelp->Start( OUString( "HID_SMA_SYMDEFINEDIALOG" ), pHelpBtn );
}
return 0;
}
SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
OutputDevice *pFntListDevice, SmSymbolManager &rMgr) : OutputDevice *pFntListDevice, SmSymbolManager &rMgr) :
ModalDialog (pParent, "EditSymbols", "modules/smath/ui/symdefinedialog.ui"), ModalDialog (pParent, "EditSymbols", "modules/smath/ui/symdefinedialog.ui"),
...@@ -1995,13 +1991,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, ...@@ -1995,13 +1991,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
get(pSymbolName, "symbolName"); get(pSymbolName, "symbolName");
get(pSymbolDisplay, "symbolDisplay"); get(pSymbolDisplay, "symbolDisplay");
get(pSymbolSetName, "symbolSetName"); get(pSymbolSetName, "symbolSetName");
get(pHelpBtn, "help");
get(pAddBtn, "add"); get(pAddBtn, "add");
get(pChangeBtn, "modify"); get(pChangeBtn, "modify");
get(pDeleteBtn, "delete"); get(pDeleteBtn, "delete");
pHelpBtn->SetClickHdl(LINK(this, SmSymDefineDialog, HelpButtonClickHdl));
pFontList = new FontList( pFntListDevice ); pFontList = new FontList( pFntListDevice );
pOrigSymbol = 0; pOrigSymbol = 0;
......
/* -*- 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 _DIALOG_HRC_
#define _DIALOG_HRC_
#define FT_FONTS_SUBSET 110
#define LB_FONTS_SUBSET 111
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -65,7 +65,7 @@ SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId) ...@@ -65,7 +65,7 @@ SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId)
} }
SvxShowCharSet::SvxShowCharSet(Window* pParent) SvxShowCharSet::SvxShowCharSet(Window* pParent)
: Control(pParent, WB_TABSTOP) : Control(pParent, WB_TABSTOP | WB_BORDER)
, m_pAccessible(NULL) , m_pAccessible(NULL)
, aVscrollSB( this, WB_VERT) , aVscrollSB( this, WB_VERT)
{ {
......
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