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:
class SmShowChar : public Control
{
virtual void Paint(const Rectangle&) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
public:
SmShowChar(Window *pParent, WinBits nStyle)
......@@ -424,7 +425,6 @@ class SmSymDefineDialog : public ModalDialog
DECL_LINK(AddClickHdl, Button *);
DECL_LINK(ChangeClickHdl, Button *);
DECL_LINK(DeleteClickHdl, Button *);
DECL_LINK(HelpButtonClickHdl, Button *);
void FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
void FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
......
......@@ -21,7 +21,6 @@
#define HID_SMA_FONTDIALOG "STARMATH_HID_SMA_FONTDIALOG"
#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_COMMAND_WIN_EDIT "STARMATH_HID_SMA_COMMAND_WIN_EDIT"
......
......@@ -269,7 +269,6 @@ void SmShowFont::SetFont(const Font& rFont)
SetTextColor( aTxtColor );
}
IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox )
{
Face.SetName(pComboBox->GetText());
......@@ -1615,8 +1614,16 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont )
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)
{
......@@ -1963,17 +1970,6 @@ void SmSymDefineDialog::UpdateButtons()
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,
OutputDevice *pFntListDevice, SmSymbolManager &rMgr) :
ModalDialog (pParent, "EditSymbols", "modules/smath/ui/symdefinedialog.ui"),
......@@ -1995,13 +1991,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
get(pSymbolName, "symbolName");
get(pSymbolDisplay, "symbolDisplay");
get(pSymbolSetName, "symbolSetName");
get(pHelpBtn, "help");
get(pAddBtn, "add");
get(pChangeBtn, "modify");
get(pDeleteBtn, "delete");
pHelpBtn->SetClickHdl(LINK(this, SmSymDefineDialog, HelpButtonClickHdl));
pFontList = new FontList( pFntListDevice );
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)
}
SvxShowCharSet::SvxShowCharSet(Window* pParent)
: Control(pParent, WB_TABSTOP)
: Control(pParent, WB_TABSTOP | WB_BORDER)
, m_pAccessible(NULL)
, 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