Kaydet (Commit) 0cf14968 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Caolán McNamara

RID_FORMULADLG_FORMULA conversion to .ui

Change-Id: I098c9ee9d22ac0401faf7fc6d65e91bf5b4b2bf8
Reviewed-on: https://gerrit.libreoffice.org/9797Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 55561240
......@@ -608,6 +608,15 @@
<glade-widget-class title="Reference Edit" name="foruilo-RefEdit"
generic-name="Reference Edit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Edit" name="foruilo-ArgEdit"
generic-name="Edit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Value entry" name="foruilo-ValWnd"
generic-name="Value entry" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Edit Box" name="foruilo-EditBox"
generic-name="Edit Box" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
<glade-widget-class title="Another NoSpace Edit" name="cuilo-SvxNoSpaceEdit"
generic-name="Another NoSpace Edit" parent="GtkEntry"
......@@ -712,5 +721,12 @@
generic-name="DriverListControl" parent="GtkEntry"
icon-name="widget-gtk-combobox"/>
<glade-widget-class title="Formula ListBox" name="foruilo-FormulaListBox"
generic-name="Formula ListBox" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Formula ListBox" name="foruilo-StructListBox"
generic-name="Formula ListBox" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
</glade-widget-classes>
</glade-catalog>
......@@ -17,6 +17,7 @@ $(eval $(call gb_Module_add_targets,formula,\
$(eval $(call gb_Module_add_l10n_targets,formula,\
AllLangResTarget_for \
AllLangResTarget_forui \
UIConfig_formula \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_UIConfig_UIConfig,formula))
$(eval $(call gb_UIConfig_add_uifiles,formula,\
formula/uiconfig/ui/formuladialog \
formula/uiconfig/ui/functionpage \
formula/uiconfig/ui/structpage \
formula/uiconfig/ui/parameter \
))
# vim: set noet sw=4 ts=4:
......@@ -29,12 +29,14 @@ namespace formula
class ValWnd : public Window
{
public:
ValWnd( Window* pParent, const ResId& rId );
ValWnd( Window* pParent, WinBits nBits );
void SetValue( const OUString& rStrVal );
protected:
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
private:
OUString aStrValue;
......@@ -62,7 +64,7 @@ protected:
public:
EditBox( Window* pParent, const ResId& rResId );
EditBox( Window* pParent, WinBits nBits );
virtual ~EditBox();
......@@ -80,7 +82,7 @@ public:
class ArgEdit : public RefEdit
{
public:
ArgEdit( Window* pParent, const ResId& rResId );
ArgEdit( Window* pParent, WinBits nBits );
void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
ScrollBar& rArgSlider, sal_uInt16 nArgCount );
......@@ -111,7 +113,7 @@ private:
Link aEdModifyLink;
FixedText* pFtArg;
ImageButton* pBtnFx;
PushButton* pBtnFx;
ArgEdit* pEdArg;
RefButton* pRefBtn;
......@@ -138,7 +140,7 @@ public:
virtual ~ArgInput() {}
void InitArgInput ( FixedText* pftArg,
ImageButton* pbtnFx,
PushButton* pbtnFx,
ArgEdit* pedArg,
RefButton* prefBtn);
......
......@@ -20,8 +20,6 @@
#define FT_RESULT 1
#define WND_RESULT 2
#define FT_EDITNAME 3
#define STR_TITLE1 4
#define STR_TITLE2 5
#define BTN_HELP 6
#define BTN_CANCEL 7
#define BTN_BACKWARD 8
......@@ -39,29 +37,9 @@
#define RB_REF 20
#define FT_FORMULA_RESULT 21
#define WND_FORMULA_RESULT 22
#define STR_END 23
// Fuer Tabpage
#define TP_FUNCTION 1
#define TP_STRUCT 2
// Funktions-Tabpage
#define FT_FUNCTION 1
#define FT_CATEGORY 2
#define LB_CATEGORY 3
#define LB_FUNCTION 4
// Struktur-Tabpage
#define FT_STRUCT 1
#define TLB_STRUCT 2
// Bitmaps
#define BMP_STR_CLOSE 1
#define BMP_STR_OPEN 2
#define BMP_STR_END 3
#define BMP_STR_ERROR 4
// Texte
#define STR_STRUCT_ERR1 1
#define STR_STRUCT_ERR2 2
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -23,97 +23,40 @@
#define STD_MASKCOLOR Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
TabPage RID_FORMULATAB_FUNCTION
Image BMP_STR_CLOSE
{
Hide = TRUE ;
Size = MAP_APPFONT ( 96 , 180 ) ;
HelpId = HID_FORMULATAB_FUNCTION ;
// Titel wird dynamisch gesetzt (s.u.)
// 1. Seite
ListBox LB_CATEGORY
{
HelpId = HID_FORMULA_LB_CATEGORY;
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 14 ) ;
Size = MAP_APPFONT ( 86 , 112 ) ;
DropDown = TRUE ;
StringList [ en-US ] =
{
< "Last Used" ; Default ; > ;
< "All" ; Default ; > ;
};
};
ListBox LB_FUNCTION
{
HelpId = HID_FORMULA_LB_FUNCTION;
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 43 ) ;
Size = MAP_APPFONT ( 86 , 133 ) ;
Sort = TRUE;
};
FixedText FT_CATEGORY
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 84 , 8 ) ;
Text [ en-US ] = "~Category" ;
};
FixedText FT_FUNCTION
{
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 72 , 8 ) ;
Text [ en-US ] = "~Function" ;
};
ImageBitmap = Bitmap { File = "fapclose.bmp"; };
MaskColor = STD_MASKCOLOR;
};
TabPage RID_FORMULATAB_STRUCT
Image BMP_STR_OPEN
{
Hide = TRUE ;
Size = MAP_APPFONT ( 96 , 180 ) ;
HelpId = HID_FORMULATAB_STRUCT ;
// Titel wird dynamisch gesetzt (s.u.)
// 1. Seite
Control TLB_STRUCT
{
Border = TRUE ;
TabStop = TRUE ;
Pos = MAP_APPFONT ( 6 , 14 ) ;
Size = MAP_APPFONT ( 86 , 162 ) ;
HelpId = HID_FORMULA_FAP_STRUCT ;
};
FixedText FT_STRUCT
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 86 , 8 ) ;
Text [ en-US ] = "~Structure" ;
};
Image BMP_STR_CLOSE
{
ImageBitmap = Bitmap { File = "fapclose.bmp"; };
MaskColor = STD_MASKCOLOR;
};
Image BMP_STR_OPEN
{
ImageBitmap = Bitmap { File = "fapopen.bmp"; };
MaskColor = STD_MASKCOLOR;
};
Image BMP_STR_END
{
ImageBitmap = Bitmap { File = "fapok.bmp"; };
MaskColor = STD_MASKCOLOR;
};
Image BMP_STR_ERROR
{
ImageBitmap = Bitmap { File = "faperror.bmp"; };
MaskColor = STD_MASKCOLOR;
};
String STR_STRUCT_ERR1
{
Text [ en-US ] = "=?" ;
};
String STR_STRUCT_ERR2
{
Text [ en-US ] = "Error" ;
};
ImageBitmap = Bitmap { File = "fapopen.bmp"; };
MaskColor = STD_MASKCOLOR;
};
Image BMP_STR_END
{
ImageBitmap = Bitmap { File = "fapok.bmp"; };
MaskColor = STD_MASKCOLOR;
};
Image BMP_STR_ERROR
{
ImageBitmap = Bitmap { File = "faperror.bmp"; };
MaskColor = STD_MASKCOLOR;
};
String STR_STRUCT_ERR1
{
Text [ en-US ] = "=?" ;
};
String STR_STRUCT_ERR2
{
Text [ en-US ] = "Error" ;
};
ModalDialog RID_FORMULADLG_FORMULA_MODAL
{
SVLook = TRUE ;
......@@ -280,170 +223,20 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL
};
};
ModelessDialog RID_FORMULADLG_FORMULA
String STR_TITLE1
{
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 321 , 228 ) ;
HelpId = HID_FORMULADLG_FORMULA ;
Moveable = TRUE ;
TabControl TC_FUNCTION
{
HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA:TC_FUNCTION";
Pos = MAP_APPFONT ( 6 , 5 ) ;
Size = MAP_APPFONT ( 102 , 199 ) ;
PageList =
{
PageItem
{
Identifier = TP_FUNCTION ;
Text [ en-US ] = "Functions" ;
};
PageItem
{
Identifier = TP_STRUCT ;
Text [ en-US ] = "Structure" ;
};
};
};
FixedText FT_HEADLINE
{
Pos = MAP_APPFONT ( 115 , 24 ) ;
Size = MAP_APPFONT ( 194 , 8 ) ;
WordBreak = TRUE ;
};
FixedText FT_FUNCNAME
{
Pos = MAP_APPFONT ( 115 , 38 ) ;
Size = MAP_APPFONT ( 194 , 24 ) ;
WordBreak = TRUE ;
};
FixedText FT_FUNCDESC
{
Pos = MAP_APPFONT ( 115 , 68 ) ;
Size = MAP_APPFONT ( 194 , 64 ) ;
WordBreak = TRUE ;
};
FixedText FT_EDITNAME
{
Pos = MAP_APPFONT ( 113 , 6 ) ;
Size = MAP_APPFONT ( 83 , 10 ) ;
};
GroupBox GB_EDIT
{
Pos = MAP_APPFONT ( 112 , 18 ) ;
Size = MAP_APPFONT ( 203 , 128 ) ;
};
FixedText FT_FORMULA
{
Pos = MAP_APPFONT ( 112 , 151 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "For~mula" ;
};
Control ED_FORMULA
{
Border = TRUE ;
Pos = MAP_APPFONT ( 112 , 161 ) ;
Size = MAP_APPFONT ( 203 , 43 ) ;
HelpId = HID_FORMULA_FAP_FORMULA ;
};
FixedText FT_RESULT
{
Pos = MAP_APPFONT ( 198 , 6 ) ;
Size = MAP_APPFONT ( 55 , 10 ) ;
Right = TRUE ;
Text [ en-US ] = "Function result" ;
};
Window WND_RESULT
{
Border = TRUE ;
Pos = MAP_APPFONT ( 255 , 4 ) ;
Size = MAP_APPFONT ( 60 , 12 ) ;
};
FixedText FT_FORMULA_RESULT
{
Pos = MAP_APPFONT ( 217 , 149 ) ;
Size = MAP_APPFONT ( 35 , 10 ) ;
Text [ en-US ] = "Result" ;
Right = TRUE ;
};
Window WND_FORMULA_RESULT
{
Border = TRUE ;
Pos = MAP_APPFONT ( 255 , 147 ) ;
Size = MAP_APPFONT ( 60 , 12 ) ;
};
CheckBox BTN_MATRIX
{
HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA:BTN_MATRIX";
Pos = MAP_APPFONT ( 6 , 208 ) ;
Size = MAP_APPFONT ( 50 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Array" ;
};
Edit ED_REF
{
HelpID = "formula:Edit:RID_FORMULADLG_FORMULA:ED_REF";
Border = TRUE ;
Pos = MAP_APPFONT ( 76 , 205 ) ;
Size = MAP_APPFONT ( 66 , 12 ) ;
};
ImageButton RB_REF
{
HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA:RB_REF";
Pos = MAP_APPFONT ( 144 , 205 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = FALSE ;
QuickHelpText [ en-US ] = "Maximize" ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 72 , 208 ) ;
Size = MAP_APPFONT ( 45 , 14 ) ;
TabStop = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 121 , 208 ) ;
Size = MAP_APPFONT ( 45 , 14 ) ;
TabStop = TRUE ;
};
PushButton BTN_BACKWARD
{
HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_BACKWARD";
Pos = MAP_APPFONT ( 171 , 208 ) ;
Size = MAP_APPFONT ( 45 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "<< ~Back" ;
};
PushButton BTN_FORWARD
{
HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_FORWARD";
Pos = MAP_APPFONT ( 219 , 208 ) ;
Size = MAP_APPFONT ( 45 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Next >>" ;
};
OKButton BTN_END
{
Pos = MAP_APPFONT ( 270 , 208 ) ;
Size = MAP_APPFONT ( 45 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
String STR_TITLE1
{
Text [ en-US ] = "Function Wizard" ;
};
String STR_TITLE2
{
Text [ en-US ] = "Function Wizard -" ;
};
String STR_END
{
Text [ en-US ] = "~End" ;
};
Text [ en-US ] = "Function Wizard" ;
};
String STR_TITLE2
{
Text [ en-US ] = "Function Wizard -" ;
};
String STR_END
{
Text [ en-US ] = "~End" ;
};
Image RID_BMP_REFBTN1
......
......@@ -31,8 +31,8 @@
namespace formula
{
FormulaListBox::FormulaListBox( Window* pParent, const ResId& rResId ):
ListBox(pParent,rResId)
FormulaListBox::FormulaListBox( Window* pParent, WinBits nBits ):
ListBox(pParent, nBits)
{}
void FormulaListBox::KeyInput( const KeyEvent& rKEvt )
......@@ -57,6 +57,11 @@ bool FormulaListBox::PreNotify( NotifyEvent& rNEvt )
return nResult;
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFormulaListBox(Window *pParent, VclBuilder::stringmap &)
{
return new FormulaListBox(pParent, WB_BORDER | WB_SORT);
}
inline sal_uInt16 Lb2Cat( sal_uInt16 nLbPos )
{
// Category 0 == LRU, otherwise Categories == LbPos-1
......@@ -67,16 +72,17 @@ inline sal_uInt16 Lb2Cat( sal_uInt16 nLbPos )
}
FuncPage::FuncPage(Window* pParent,const IFunctionManager* _pFunctionManager):
TabPage(pParent,ModuleRes(RID_FORMULATAB_FUNCTION)),
aFtCategory ( this, ModuleRes( FT_CATEGORY ) ),
aLbCategory ( this, ModuleRes( LB_CATEGORY ) ),
aFtFunction ( this, ModuleRes( FT_FUNCTION ) ),
aLbFunction ( this, ModuleRes( LB_FUNCTION ) ),
TabPage(pParent, "FunctionPage", "formula/ui/functionpage.ui"),
m_pFunctionManager(_pFunctionManager)
{
FreeResource();
m_aHelpId = aLbFunction.GetHelpId();
aLbFunction.SetUniqueId(m_aHelpId);
get(m_pLbCategory, "category");
get(m_pLbFunction, "function");
m_pLbFunction->SetStyle(m_pLbFunction->GetStyle() | WB_SORT);
Size aSize(LogicToPixel(Size(86 , 133), MAP_APPFONT));
m_pLbFunction->set_height_request(aSize.Height());
m_pLbFunction->set_width_request(aSize.Width());
m_aHelpId = m_pLbFunction->GetHelpId();
m_pLbFunction->SetUniqueId(m_aHelpId);
InitLRUList();
......@@ -84,14 +90,14 @@ FuncPage::FuncPage(Window* pParent,const IFunctionManager* _pFunctionManager):
for(sal_uInt32 j= 0; j < nCategoryCount; ++j)
{
const IFunctionCategory* pCategory = m_pFunctionManager->getCategory(j);
aLbCategory.SetEntryData(aLbCategory.InsertEntry(pCategory->getName()),(void*)pCategory);
m_pLbCategory->SetEntryData(m_pLbCategory->InsertEntry(pCategory->getName()),(void*)pCategory);
}
aLbCategory.SelectEntryPos(1);
m_pLbCategory->SelectEntryPos(1);
UpdateFunctionList();
aLbCategory.SetSelectHdl( LINK( this, FuncPage, SelHdl ) );
aLbFunction.SetSelectHdl( LINK( this, FuncPage, SelHdl ) );
aLbFunction.SetDoubleClickHdl( LINK( this, FuncPage, DblClkHdl ) );
m_pLbCategory->SetSelectHdl( LINK( this, FuncPage, SelHdl ) );
m_pLbFunction->SetSelectHdl( LINK( this, FuncPage, SelHdl ) );
m_pLbFunction->SetDoubleClickHdl( LINK( this, FuncPage, DblClkHdl ) );
}
void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory)
......@@ -100,22 +106,22 @@ void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory)
for(sal_uInt32 i = 0 ; i < nCount; ++i)
{
TFunctionDesc pDesc(_pCategory->getFunction(i));
aLbFunction.SetEntryData(
aLbFunction.InsertEntry(pDesc->getFunctionName() ),(void*)pDesc );
m_pLbFunction->SetEntryData(
m_pLbFunction->InsertEntry(pDesc->getFunctionName() ),(void*)pDesc );
}
}
void FuncPage::UpdateFunctionList()
{
sal_Int32 nSelPos = aLbCategory.GetSelectEntryPos();
const IFunctionCategory* pCategory = static_cast<const IFunctionCategory*>(aLbCategory.GetEntryData(nSelPos));
sal_Int32 nSelPos = m_pLbCategory->GetSelectEntryPos();
const IFunctionCategory* pCategory = static_cast<const IFunctionCategory*>(m_pLbCategory->GetEntryData(nSelPos));
sal_Int32 nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
? Lb2Cat( nSelPos ) : 0;
(void)nCategory;
aLbFunction.Clear();
aLbFunction.SetUpdateMode( false );
m_pLbFunction->Clear();
m_pLbFunction->SetUpdateMode( false );
if ( nSelPos > 0 )
......@@ -143,35 +149,35 @@ void FuncPage::UpdateFunctionList()
const IFunctionDescription* pDesc = *aIter;
if (pDesc) // may be null if a function is no longer available
{
aLbFunction.SetEntryData(
aLbFunction.InsertEntry( pDesc->getFunctionName() ), (void*)pDesc );
m_pLbFunction->SetEntryData(
m_pLbFunction->InsertEntry( pDesc->getFunctionName() ), (void*)pDesc );
}
}
}
aLbFunction.SetUpdateMode( true );
aLbFunction.SelectEntryPos(0);
m_pLbFunction->SetUpdateMode( true );
m_pLbFunction->SelectEntryPos(0);
if(IsVisible()) SelHdl(&aLbFunction);
if(IsVisible()) SelHdl(m_pLbFunction);
}
IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb )
{
if(pLb==&aLbFunction)
if(pLb==m_pLbFunction)
{
const IFunctionDescription* pDesc = GetFuncDesc( GetFunction() );
if ( pDesc )
{
const OString sHelpId = pDesc->getHelpId();
if ( !sHelpId.isEmpty() )
aLbFunction.SetHelpId(sHelpId);
m_pLbFunction->SetHelpId(sHelpId);
}
aSelectionLink.Call(this);
}
else
{
aLbFunction.SetHelpId(m_aHelpId);
m_pLbFunction->SetHelpId(m_aHelpId);
UpdateFunctionList();
}
return 0;
......@@ -185,49 +191,49 @@ IMPL_LINK_NOARG(FuncPage, DblClkHdl)
void FuncPage::SetCategory(sal_Int32 nCat)
{
aLbCategory.SelectEntryPos(nCat);
m_pLbCategory->SelectEntryPos(nCat);
UpdateFunctionList();
}
sal_Int32 FuncPage::GetFuncPos(const IFunctionDescription* _pDesc)
{
return aLbFunction.GetEntryPos(_pDesc);
return m_pLbFunction->GetEntryPos(_pDesc);
}
void FuncPage::SetFunction(sal_Int32 nFunc)
{
aLbFunction.SelectEntryPos(nFunc);
m_pLbFunction->SelectEntryPos(nFunc);
}
void FuncPage::SetFocus()
{
aLbFunction.GrabFocus();
m_pLbFunction->GrabFocus();
}
sal_Int32 FuncPage::GetCategory()
{
return aLbCategory.GetSelectEntryPos();
return m_pLbCategory->GetSelectEntryPos();
}
sal_Int32 FuncPage::GetFunction()
{
return aLbFunction.GetSelectEntryPos();
return m_pLbFunction->GetSelectEntryPos();
}
sal_Int32 FuncPage::GetFunctionEntryCount()
{
return aLbFunction.GetSelectEntryCount();
return m_pLbFunction->GetSelectEntryCount();
}
OUString FuncPage::GetSelFunctionName() const
{
return aLbFunction.GetSelectEntry();
return m_pLbFunction->GetSelectEntry();
}
const IFunctionDescription* FuncPage::GetFuncDesc( sal_Int32 nPos ) const
{
// not pretty, but hopefully rare
return (const IFunctionDescription*) aLbFunction.GetEntryData(nPos);
return (const IFunctionDescription*) m_pLbFunction->GetEntryData(nPos);
}
void FuncPage::InitLRUList()
......
......@@ -50,7 +50,7 @@ protected:
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
public:
FormulaListBox( Window* pParent, const ResId& rResId );
FormulaListBox( Window* pParent, WinBits nBits );
};
......@@ -64,10 +64,8 @@ private:
OModuleClient m_aModuleClient;
Link aDoubleClickLink;
Link aSelectionLink;
FixedText aFtCategory;
ListBox aLbCategory;
FixedText aFtFunction;
FormulaListBox aLbFunction;
ListBox *m_pLbCategory;
FormulaListBox *m_pLbFunction;
const IFunctionManager*
m_pFunctionManager;
......
......@@ -33,13 +33,15 @@ namespace formula
{
// class ValWnd
ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId )
ValWnd::ValWnd(Window* pParent, WinBits nBits)
: Window(pParent, nBits)
{
Font aFnt( GetFont() );
aFnt.SetTransparent( true );
aFnt.SetWeight( WEIGHT_LIGHT );
if ( pParent->IsBackground() )
{
fprintf(stderr, "one\n");
Wallpaper aBack = pParent->GetBackground();
SetFillColor( aBack.GetColor() );
SetBackground( aBack );
......@@ -47,12 +49,25 @@ ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId )
}
else
{
fprintf(stderr, "two\n");
SetFillColor();
SetBackground();
}
SetFont( aFnt );
SetLineColor();
SetAccessibleRole( ::com::sun::star::accessibility::AccessibleRole::LABEL );
}
Size ValWnd::GetOptimalSize() const
{
return LogicToPixel(Size(60, 12), MAP_APPFONT);
}
void ValWnd::Resize()
{
Window::Resize();
Size aSzWnd = GetOutputSizePixel();
long nHeight = GetTextHeight();
long nDiff = aSzWnd.Height()-nHeight;
......@@ -60,7 +75,11 @@ ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId )
aRectOut = Rectangle( Point( 1, ( nDiff<2 ) ? 1 : nDiff/2),
Size ( aSzWnd.Width()-2, nHeight ) );
SetClipRegion( Region( aRectOut ) );
SetAccessibleRole( ::com::sun::star::accessibility::AccessibleRole::LABEL );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeValWnd(Window *pParent, VclBuilder::stringmap &)
{
return new ValWnd(pParent, WB_BORDER);
}
void ValWnd::Paint( const Rectangle& )
......@@ -80,8 +99,8 @@ void ValWnd::SetValue( const OUString& rStrVal )
// class ArgEdit
ArgEdit::ArgEdit( Window* pParent, const ResId& rResId )
: RefEdit( pParent, NULL, NULL, rResId ),
ArgEdit::ArgEdit( Window* pParent, WinBits nBits )
: RefEdit( pParent, NULL, nBits ),
pEdPrev ( NULL ),
pEdNext ( NULL ),
pSlider ( NULL ),
......@@ -89,6 +108,11 @@ ArgEdit::ArgEdit( Window* pParent, const ResId& rResId )
{
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeArgEdit(Window *pParent, VclBuilder::stringmap &)
{
return new ArgEdit(pParent, WB_BORDER);
}
void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
ScrollBar& rArgSlider, sal_uInt16 nArgCount )
{
......@@ -183,7 +207,7 @@ ArgInput::ArgInput()
pRefBtn=NULL;
}
void ArgInput::InitArgInput( FixedText* pftArg, ImageButton* pbtnFx,
void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx,
ArgEdit* pedArg, RefButton* prefBtn)
{
pFtArg =pftArg;
......@@ -374,8 +398,9 @@ IMPL_LINK( ArgInput, EdModifyHdl,ArgEdit*, pEd )
}
// class EditBox
EditBox::EditBox( Window* pParent, const ResId& rResId )
:Control(pParent,rResId),
EditBox::EditBox( Window* pParent, WinBits nBits )
:Control(pParent,nBits),
bMouseFlag(false)
{
WinBits nStyle=GetStyle();
......@@ -395,6 +420,11 @@ EditBox::EditBox( Window* pParent, const ResId& rResId )
SetHelpId( "" );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeEditBox(Window *pParent, VclBuilder::stringmap &)
{
return new EditBox(pParent, WB_BORDER);
}
EditBox::~EditBox()
{
MultiLineEdit* pTheEdit=pMEdit;
......@@ -493,16 +523,6 @@ void EditBox::UpdateOldSel()
#define SC_ENABLE_TIME 100
RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent,
Window* pShrinkModeLabel, const ResId& rResId )
: Edit( _pParent, rResId )
, pAnyRefDlg( pParent )
, pLabelWidget(pShrinkModeLabel)
{
aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) );
aTimer.SetTimeout( SC_ENABLE_TIME );
}
RefEdit::RefEdit( Window* _pParent, Window* pShrinkModeLabel, WinBits nStyle )
: Edit( _pParent, nStyle )
, pAnyRefDlg( NULL )
......@@ -608,18 +628,6 @@ IMPL_LINK_NOARG(RefEdit, UpdateHdl)
//class RefButton
RefButton::RefButton( Window* _pParent, const ResId& rResId) :
ImageButton( _pParent, rResId ),
aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ).toString() ),
aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ).toString() ),
pAnyRefDlg( NULL ),
pRefEdit( NULL )
{
SetStartImage();
}
RefButton::RefButton( Window* _pParent, WinBits nStyle ) :
ImageButton( _pParent, nStyle ),
aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
......@@ -637,18 +645,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeRefButton(Window *pParent,
return new RefButton(pParent, 0);
}
RefButton::RefButton( Window* _pParent, const ResId& rResId, RefEdit* pEdit, IControlReferenceHandler* _pDlg ) :
ImageButton( _pParent, rResId ),
aImgRefStart( ModuleRes( RID_BMP_REFBTN1 ) ),
aImgRefDone( ModuleRes( RID_BMP_REFBTN2 ) ),
aShrinkQuickHelp( ModuleRes( RID_STR_SHRINK ).toString() ),
aExpandQuickHelp( ModuleRes( RID_STR_EXPAND ).toString() ),
pAnyRefDlg( _pDlg ),
pRefEdit( pEdit )
{
SetStartImage();
}
void RefButton::SetStartImage()
{
SetModeImage( aImgRefStart );
......
......@@ -23,7 +23,6 @@
#include <vcl/settings.hxx>
#include "parawin.hxx"
#include "parawin.hrc"
#include "helpids.hrc"
#include "formula/formdata.hxx"
#include "formula/IFunctionDescription.hxx"
......@@ -36,55 +35,69 @@ namespace formula
{
ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos):
TabPage (pParent,ModuleRes(RID_FORMULATAB_PARAMETER)),
ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg):
TabPage (pParent, "ParameterPage", "formula/ui/parameter.ui"),
pFuncDesc ( NULL ),
pMyParent (_pDlg),
aFtEditDesc ( this, ModuleRes( FT_EDITDESC ) ),
aFtArgName ( this, ModuleRes( FT_PARNAME ) ),
aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ),
aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
aFtArg1 ( this, ModuleRes( FT_ARG1 ) ),
aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ),
aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
aEdArg2 ( this, ModuleRes( ED_ARG2 ) ),
aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ),
aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ),
aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ),
aSlider ( this, ModuleRes( WND_SLIDER ) ),
m_sOptional ( ModuleRes( STR_OPTIONAL ) ),
m_sRequired ( ModuleRes( STR_REQUIRED ) ),
bRefMode (false)
{
FreeResource();
aDefaultString=aFtEditDesc.GetText();
SetPosPixel(aPos);
get(m_pFtEditDesc, "editdesc");
get(m_pFtArgName, "parname");
get(m_pFtArgDesc, "pardesc");
//Space for two lines of text
m_pFtArgDesc->SetText("X\nX\n");
long nHeight = m_pFtArgDesc->GetOptimalSize().Height();
m_pFtEditDesc->set_height_request(nHeight);
m_pFtArgDesc->set_height_request(nHeight);
m_pFtArgDesc->SetText("");
get(m_pBtnFx1, "FX1");
m_pBtnFx1->SetModeImage(Image(ModuleRes( BMP_FX )));
get(m_pBtnFx2, "FX2");
m_pBtnFx2->SetModeImage(Image(ModuleRes( BMP_FX )));
get(m_pBtnFx3, "FX3");
m_pBtnFx3->SetModeImage(Image(ModuleRes( BMP_FX )));
get(m_pBtnFx4, "FX4");
m_pBtnFx4->SetModeImage(Image(ModuleRes( BMP_FX )));
get(m_pFtArg1, "FT_ARG1");
get(m_pFtArg2, "FT_ARG2");
get(m_pFtArg3, "FT_ARG3");
get(m_pFtArg4, "FT_ARG4");
get(m_pEdArg1, "ED_ARG1");
get(m_pEdArg2, "ED_ARG2");
get(m_pEdArg3, "ED_ARG3");
get(m_pEdArg4, "ED_ARG4");
get(m_pRefBtn1, "RB_ARG1");
get(m_pRefBtn2, "RB_ARG2");
get(m_pRefBtn3, "RB_ARG3");
get(m_pRefBtn4, "RB_ARG4");
get(m_pSlider, "scrollbar");
//lock down initial preferences
Window *pGrid = get<Window>("paramgrid");
pGrid->set_height_request(pGrid->get_preferred_size().Height());
Size aSize(get_preferred_size());
set_width_request(aSize.Width());
set_height_request(aSize.Height());
aDefaultString=m_pFtEditDesc->GetText();
nEdFocus=NOT_FOUND;
nActiveLine=0;
Size aSize = aSlider.GetSizePixel();
aSize.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
aSlider.SetSizePixel( aSize );
aSlider.SetEndScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
aSlider.SetScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
InitArgInput( 0, aFtArg1, aBtnFx1, aEdArg1, aRefBtn1);
InitArgInput( 1, aFtArg2, aBtnFx2, aEdArg2, aRefBtn2);
InitArgInput( 2, aFtArg3, aBtnFx3, aEdArg3, aRefBtn3);
InitArgInput( 3, aFtArg4, aBtnFx4, aEdArg4, aRefBtn4);
m_pSlider->SetEndScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
m_pSlider->SetScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
InitArgInput( 0, *m_pFtArg1, *m_pBtnFx1, *m_pEdArg1, *m_pRefBtn1);
InitArgInput( 1, *m_pFtArg2, *m_pBtnFx2, *m_pEdArg2, *m_pRefBtn2);
InitArgInput( 2, *m_pFtArg3, *m_pBtnFx3, *m_pEdArg3, *m_pRefBtn3);
InitArgInput( 3, *m_pFtArg4, *m_pBtnFx4, *m_pEdArg4, *m_pRefBtn4);
ClearAll();
}
......@@ -211,10 +224,10 @@ ParaWin::~ParaWin()
// #i66422# if the focus changes during destruction of the controls,
// don't call the focus handlers
Link aEmptyLink;
aBtnFx1.SetGetFocusHdl( aEmptyLink );
aBtnFx2.SetGetFocusHdl( aEmptyLink );
aBtnFx3.SetGetFocusHdl( aEmptyLink );
aBtnFx4.SetGetFocusHdl( aEmptyLink );
m_pBtnFx1->SetGetFocusHdl( aEmptyLink );
m_pBtnFx2->SetGetFocusHdl( aEmptyLink );
m_pBtnFx3->SetGetFocusHdl( aEmptyLink );
m_pBtnFx4->SetGetFocusHdl( aEmptyLink );
}
......@@ -309,20 +322,20 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc)
}
nArgs = pFuncDesc->getSuppressedArgumentCount();
pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping);
aSlider.Hide();
m_pSlider->Hide();
OString sHelpId = pFuncDesc->getHelpId();
SetHelpId( sHelpId );
aEdArg1.SetHelpId( sHelpId );
aEdArg2.SetHelpId( sHelpId );
aEdArg3.SetHelpId( sHelpId );
aEdArg4.SetHelpId( sHelpId );
m_pEdArg1->SetHelpId( sHelpId );
m_pEdArg2->SetHelpId( sHelpId );
m_pEdArg3->SetHelpId( sHelpId );
m_pEdArg4->SetHelpId( sHelpId );
// Unique-IDs muessen gleich bleiben fuer Automatisierung
SetUniqueId( HID_FORMULA_FAP_PAGE );
aEdArg1.SetUniqueId( HID_FORMULA_FAP_EDIT1 );
aEdArg2.SetUniqueId( HID_FORMULA_FAP_EDIT2 );
aEdArg3.SetUniqueId( HID_FORMULA_FAP_EDIT3 );
aEdArg4.SetUniqueId( HID_FORMULA_FAP_EDIT4 );
m_pEdArg1->SetUniqueId( HID_FORMULA_FAP_EDIT1 );
m_pEdArg2->SetUniqueId( HID_FORMULA_FAP_EDIT2 );
m_pEdArg3->SetUniqueId( HID_FORMULA_FAP_EDIT3 );
m_pEdArg4->SetUniqueId( HID_FORMULA_FAP_EDIT4 );
SetActiveLine(0);
}
else
......@@ -334,17 +347,17 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc)
void ParaWin::SetArgumentText(const OUString& aText)
{
aFtArgName.SetText(aText);
m_pFtArgName->SetText(aText);
}
void ParaWin::SetArgumentDesc(const OUString& aText)
{
aFtArgDesc.SetText(aText);
m_pFtArgDesc->SetText(aText);
}
void ParaWin::SetEditDesc(const OUString& aText)
{
aFtEditDesc.SetText(aText);
m_pFtEditDesc->SetText(aText);
}
void ParaWin::SetArgName(sal_uInt16 no,const OUString& aText)
......@@ -381,7 +394,7 @@ void ParaWin::SetEdFocus(sal_uInt16 no)
}
void ParaWin::InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
void ParaWin::InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, PushButton& rBtnFx,
ArgEdit& rEdArg, RefButton& rRefBtn)
{
......@@ -408,7 +421,7 @@ void ParaWin::ClearAll()
void ParaWin::SetArgumentOffset(sal_uInt16 nOffset)
{
DelParaArray();
aSlider.SetThumbPos(0);
m_pSlider->SetThumbPos(0);
aParaArray.resize(nArgs);
......@@ -421,22 +434,22 @@ void ParaWin::SetArgumentOffset(sal_uInt16 nOffset)
aArgInput[i].GetArgEdPtr()->Init(
(i==0) ? (ArgEdit *)NULL : aArgInput[i-1].GetArgEdPtr(),
(i==3 || i==nArgs-1) ? (ArgEdit *)NULL : aArgInput[i+1].GetArgEdPtr(),
aSlider, nArgs );
*m_pSlider, nArgs );
}
}
if ( nArgs < 5 )
{
aSlider.Hide();
m_pSlider->Hide();
}
else
{
aSlider.SetPageSize( 4 );
aSlider.SetVisibleSize( 4 );
aSlider.SetLineSize( 1 );
aSlider.SetRange( Range( 0, nArgs ) );
aSlider.SetThumbPos( nOffset );
aSlider.Show();
m_pSlider->SetPageSize( 4 );
m_pSlider->SetVisibleSize( 4 );
m_pSlider->SetLineSize( 1 );
m_pSlider->SetRange( Range( 0, nArgs ) );
m_pSlider->SetThumbPos( nOffset );
m_pSlider->Show();
}
UpdateParas();
......@@ -462,16 +475,16 @@ void ParaWin::UpdateParas()
sal_uInt16 ParaWin::GetSliderPos()
{
return (sal_uInt16) aSlider.GetThumbPos();
return (sal_uInt16) m_pSlider->GetThumbPos();
}
void ParaWin::SetSliderPos(sal_uInt16 nSliderPos)
{
sal_uInt16 nOffset = GetSliderPos();
if(aSlider.IsVisible() && nOffset!=nSliderPos)
if(m_pSlider->IsVisible() && nOffset!=nSliderPos)
{
aSlider.SetThumbPos(nSliderPos);
m_pSlider->SetThumbPos(nSliderPos);
for ( sal_uInt16 i=0; i<4; i++ )
{
UpdateArgInput( nSliderPos, i );
......
/* -*- 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 .
*/
#define FT_PARNAME 1
#define FT_PARDESC 2
#define FT_EDITDESC 3
#define FT_ARG1 4
#define FT_ARG2 5
#define FT_ARG3 6
#define FT_ARG4 7
#define BTN_FX1 8
#define BTN_FX2 9
#define BTN_FX3 10
#define BTN_FX4 11
#define ED_ARG1 12
#define ED_ARG2 13
#define ED_ARG3 14
#define ED_ARG4 15
#define RB_ARG1 16
#define RB_ARG2 17
#define RB_ARG3 18
#define RB_ARG4 19
#define WND_SLIDER 20
#define STR_OPTIONAL 1
#define STR_REQUIRED 2
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -56,31 +56,31 @@ private:
Font aFntBold;
Font aFntLight;
FixedInfo aFtEditDesc;
FixedText aFtArgName;
FixedInfo aFtArgDesc;
ImageButton aBtnFx1;
FixedText aFtArg1;
ArgEdit aEdArg1;
RefButton aRefBtn1;
ImageButton aBtnFx2;
FixedText aFtArg2;
ArgEdit aEdArg2;
RefButton aRefBtn2;
ImageButton aBtnFx3;
FixedText aFtArg3;
ArgEdit aEdArg3;
RefButton aRefBtn3;
ImageButton aBtnFx4;
FixedText aFtArg4;
ArgEdit aEdArg4;
RefButton aRefBtn4;
ScrollBar aSlider;
FixedText *m_pFtEditDesc;
FixedText *m_pFtArgName;
FixedText *m_pFtArgDesc;
PushButton *m_pBtnFx1;
FixedText *m_pFtArg1;
ArgEdit *m_pEdArg1;
RefButton *m_pRefBtn1;
PushButton *m_pBtnFx2;
FixedText *m_pFtArg2;
ArgEdit *m_pEdArg2;
RefButton *m_pRefBtn2;
PushButton *m_pBtnFx3;
FixedText *m_pFtArg3;
ArgEdit *m_pEdArg3;
RefButton *m_pRefBtn3;
PushButton *m_pBtnFx4;
FixedText *m_pFtArg4;
ArgEdit *m_pEdArg4;
RefButton *m_pRefBtn4;
ScrollBar *m_pSlider;
OUString m_sOptional;
OUString m_sRequired;
bool bRefMode;
......@@ -105,7 +105,7 @@ protected:
virtual void ArgumentModified();
virtual void FxClick();
void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, PushButton& rBtnFx,
ArgEdit& rEdArg, RefButton& rRefBtn);
void DelParaArray();
......@@ -123,7 +123,7 @@ protected:
void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
public:
ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos);
ParaWin(Window* pParent,IControlReferenceHandler* _pDlg);
virtual ~ParaWin();
void SetFunctionDesc(const IFunctionDescription* pFDesc);
......
......@@ -17,148 +17,25 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "parawin.hrc"
#include "ForResId.hrc"
#include "helpids.hrc"
#define STD_MASKCOLOR Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
#define FT_ARGBLOCK( y ) \
Pos = MAP_APPFONT (6 , y ) ; \
Size = MAP_APPFONT ( 74 , 8 ) ; \
Right = TRUE ;
#define FXBUTTONBLOCK( y ) \
Pos = MAP_APPFONT (83 , y-1 ) ; \
Size = MAP_APPFONT ( 13 , 15 ) ; \
TabStop = TRUE ; \
ButtonImage = Image\
{\
ImageBitmap = Bitmap\
{\
File = "fx.bmp" ; \
};\
MaskColor = STD_MASKCOLOR;\
};
#define ED_ARGBLOCK( y ) \
Border = TRUE; \
Pos = MAP_APPFONT( 98, y ); \
Size = MAP_APPFONT( 66, 12 ); \
TabStop = TRUE;
#define RB_ARGBLOCK( y ) \
Pos = MAP_APPFONT ( 166 , y-1 ) ; \
Size = MAP_APPFONT ( 13 , 15 ) ; \
TabStop = FALSE ; \
QuickHelpText [ en-US ] = "Select"; \
// jetzt alles zusammen
TabPage RID_FORMULATAB_PARAMETER
Image BMP_FX
{
HelpID = "formula:TabPage:RID_FORMULATAB_PARAMETER";
Border = FALSE;
Size = MAP_APPFONT( 203, 128 );
DialogControl = TRUE;
SVLook = TRUE;
FixedText FT_EDITDESC
{
Pos = MAP_APPFONT (3 , 6 ) ;
Size = MAP_APPFONT ( 198 , 20 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Function not known";
};
FixedText FT_PARNAME
{
Pos = MAP_APPFONT ( 3, 29) ;
Size = MAP_APPFONT ( 198 , 10 ) ;
};
FixedText FT_PARDESC
{
Pos = MAP_APPFONT ( 3, 42 ) ;
Size = MAP_APPFONT ( 198 , 20 ) ;
WordBreak = TRUE ;
};
FixedText FT_ARG1 { FT_ARGBLOCK ( 66 ) };
FixedText FT_ARG2 { FT_ARGBLOCK ( 81 ) };
FixedText FT_ARG3 { FT_ARGBLOCK ( 96 ) };
FixedText FT_ARG4 { FT_ARGBLOCK ( 111 ) };
ImageButton BTN_FX1
{
HelpId=HID_FORMULA_FAP_BTN_FX1;
FXBUTTONBLOCK ( 64 )
};
ImageButton BTN_FX2
{
HelpId=HID_FORMULA_FAP_BTN_FX2;
FXBUTTONBLOCK ( 79 )
};
ImageButton BTN_FX3
{
HelpId=HID_FORMULA_FAP_BTN_FX3;
FXBUTTONBLOCK ( 94 )
};
ImageButton BTN_FX4
{
HelpId=HID_FORMULA_FAP_BTN_FX4;
FXBUTTONBLOCK ( 109 )
};
Edit ED_ARG1 { ED_ARGBLOCK ( 64 )
HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG1";
};
Edit ED_ARG2 { ED_ARGBLOCK ( 79 )
HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG2";
};
Edit ED_ARG3 { ED_ARGBLOCK ( 94 )
HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG3";
};
Edit ED_ARG4 { ED_ARGBLOCK ( 109 )
HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG4";
};
ImageButton RB_ARG1
{
HelpId=HID_FORMULA_FAP_BTN_REF1;
RB_ARGBLOCK ( 64 )
};
ImageButton RB_ARG2
{
HelpId=HID_FORMULA_FAP_BTN_REF2;
RB_ARGBLOCK ( 79 )
};
ImageButton RB_ARG3
{
HelpId=HID_FORMULA_FAP_BTN_REF3;
RB_ARGBLOCK ( 94 )
};
ImageButton RB_ARG4
{
HelpId=HID_FORMULA_FAP_BTN_REF4;
RB_ARGBLOCK ( 109 )
};
ScrollBar WND_SLIDER
{
Pos = MAP_APPFONT ( 183, 63 ) ;
Size = MAP_APPFONT ( 8 , 59 ) ;
VScroll = TRUE ;
};
ImageBitmap = Bitmap { File = "fx.bmp" ; };
MaskColor = STD_MASKCOLOR;
};
String STR_OPTIONAL
{
Text [ en-US ] = "(optional)" ;
};
String STR_REQUIRED
{
Text [ en-US ] = "(required)" ;
};
String STR_OPTIONAL
{
Text [ en-US ] = "(optional)" ;
};
String STR_REQUIRED
{
Text [ en-US ] = "(required)" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -32,8 +32,8 @@
namespace formula
{
StructListBox::StructListBox(Window* pParent, const ResId& rResId ):
SvTreeListBox(pParent,rResId )
StructListBox::StructListBox(Window* pParent, WinBits nBits ):
SvTreeListBox(pParent, nBits)
{
bActiveFlag=false;
......@@ -77,55 +77,59 @@ void StructListBox::LoseFocus()
SvTreeListBox::LoseFocus();
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStructListBox(Window *pParent, VclBuilder::stringmap &)
{
return new StructListBox(pParent, WB_BORDER);
}
StructPage::StructPage(Window* pParent):
TabPage(pParent,ModuleRes(RID_FORMULATAB_STRUCT)),
aFtStruct ( this, ModuleRes( FT_STRUCT ) ),
aTlbStruct ( this, ModuleRes( TLB_STRUCT ) ),
TabPage(pParent, "StructPage", "formula/ui/structpage.ui"),
maImgEnd ( ModuleRes( BMP_STR_END ) ),
maImgError ( ModuleRes( BMP_STR_ERROR ) ),
pSelectedToken ( NULL )
{
aTlbStruct.SetStyle(aTlbStruct.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|
get(m_pTlbStruct, "struct");
Size aSize(LogicToPixel(Size(86, 162), MAP_APPFONT));
m_pTlbStruct->set_height_request(aSize.Height());
m_pTlbStruct->set_width_request(aSize.Width());
m_pTlbStruct->SetStyle(m_pTlbStruct->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|
WB_HASBUTTONS|WB_HSCROLL|WB_NOINITIALSELECTION);
aTlbStruct.SetNodeDefaultImages();
aTlbStruct.SetDefaultExpandedEntryBmp( Image( ModuleRes( BMP_STR_OPEN ) ) );
aTlbStruct.SetDefaultCollapsedEntryBmp( Image( ModuleRes( BMP_STR_CLOSE ) ) );
m_pTlbStruct->SetNodeDefaultImages();
m_pTlbStruct->SetDefaultExpandedEntryBmp( Image( ModuleRes( BMP_STR_OPEN ) ) );
m_pTlbStruct->SetDefaultCollapsedEntryBmp( Image( ModuleRes( BMP_STR_CLOSE ) ) );
FreeResource();
aTlbStruct.SetSelectHdl(LINK( this, StructPage, SelectHdl ) );
m_pTlbStruct->SetSelectHdl(LINK( this, StructPage, SelectHdl ) );
}
void StructPage::ClearStruct()
{
aTlbStruct.SetActiveFlag(false);
aTlbStruct.Clear();
m_pTlbStruct->SetActiveFlag(false);
m_pTlbStruct->Clear();
}
SvTreeListEntry* StructPage::InsertEntry( const OUString& rText, SvTreeListEntry* pParent,
sal_uInt16 nFlag,sal_uLong nPos,IFormulaToken* pIFormulaToken)
{
aTlbStruct.SetActiveFlag( false );
m_pTlbStruct->SetActiveFlag( false );
SvTreeListEntry* pEntry = NULL;
switch( nFlag )
{
case STRUCT_FOLDER:
pEntry = aTlbStruct.InsertEntry( rText, pParent, false, nPos, pIFormulaToken );
pEntry = m_pTlbStruct->InsertEntry( rText, pParent, false, nPos, pIFormulaToken );
break;
case STRUCT_END:
pEntry = aTlbStruct.InsertStaticEntry( rText, maImgEnd, pParent, nPos, pIFormulaToken );
pEntry = m_pTlbStruct->InsertStaticEntry( rText, maImgEnd, pParent, nPos, pIFormulaToken );
break;
case STRUCT_ERROR:
pEntry = aTlbStruct.InsertStaticEntry( rText, maImgError, pParent, nPos, pIFormulaToken );
pEntry = m_pTlbStruct->InsertStaticEntry( rText, maImgError, pParent, nPos, pIFormulaToken );
break;
}
if( pEntry && pParent )
aTlbStruct.Expand( pParent );
m_pTlbStruct->Expand( pParent );
return pEntry;
}
......@@ -133,13 +137,13 @@ OUString StructPage::GetEntryText(SvTreeListEntry* pEntry) const
{
OUString aString;
if(pEntry!=NULL)
aString = aTlbStruct.GetEntryText(pEntry);
aString = m_pTlbStruct->GetEntryText(pEntry);
return aString;
}
SvTreeListEntry* StructPage::GetParent(SvTreeListEntry* pEntry) const
{
return aTlbStruct.GetParent(pEntry);
return m_pTlbStruct->GetParent(pEntry);
}
IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry)
{
......@@ -150,7 +154,7 @@ IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry)
{
if ( !(pToken->isFunction() || pToken->getArgumentCount() > 1 ) )
{
return GetFunctionEntry(aTlbStruct.GetParent(pEntry));
return GetFunctionEntry(m_pTlbStruct->GetParent(pEntry));
}
else
{
......@@ -163,11 +167,11 @@ IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry)
IMPL_LINK( StructPage, SelectHdl, SvTreeListBox*, pTlb )
{
if(aTlbStruct.GetActiveFlag())
if(m_pTlbStruct->GetActiveFlag())
{
if(pTlb==&aTlbStruct)
if(pTlb==m_pTlbStruct)
{
SvTreeListEntry* pCurEntry=aTlbStruct.GetCurEntry();
SvTreeListEntry* pCurEntry=m_pTlbStruct->GetCurEntry();
if(pCurEntry!=NULL)
{
pSelectedToken=(IFormulaToken *)pCurEntry->GetUserData();
......
......@@ -48,7 +48,7 @@ protected:
public:
StructListBox(Window* pParent, const ResId& rResId );
StructListBox(Window* pParent, WinBits nBits );
/** Inserts an entry with static image (no difference between collapsed/expanded). */
SvTreeListEntry* InsertStaticEntry(
......@@ -73,8 +73,7 @@ private:
OModuleClient m_aModuleClient;
Link aSelLink;
FixedText aFtStruct;
StructListBox aTlbStruct;
StructListBox *m_pTlbStruct;
Image maImgEnd;
Image maImgError;
......
......@@ -42,16 +42,24 @@
// strings
#define RID_STR_SHRINK (RID_STRING_START + 0)
#define RID_STR_EXPAND (RID_STRING_START + 1)
#define STR_STRUCT_ERR1 (RID_STRING_START + 2)
#define STR_STRUCT_ERR2 (RID_STRING_START + 3)
#define STR_OPTIONAL (RID_STRING_START + 4)
#define STR_REQUIRED (RID_STRING_START + 5)
#define STR_END (RID_STRING_START + 6)
#define STR_TITLE1 (RID_STRING_START + 7)
#define STR_TITLE2 (RID_STRING_START + 8)
// bitmap
#define RID_BMP_REFBTN1 (RID_BITMAP_START + 0)
#define RID_BMP_REFBTN2 (RID_BITMAP_START + 2)
#define BMP_STR_CLOSE (RID_BITMAP_START + 3)
#define BMP_STR_OPEN (RID_BITMAP_START + 4)
#define BMP_STR_END (RID_BITMAP_START + 5)
#define BMP_STR_ERROR (RID_BITMAP_START + 6)
#define BMP_FX (RID_BITMAP_START + 7)
// pages
#define RID_FORMULATAB_STRUCT (RID_PAGE_START + 0)
#define RID_FORMULATAB_FUNCTION (RID_PAGE_START + 1)
#define RID_FORMULADLG_FORMULA (RID_PAGE_START + 2)
#define RID_FORMULATAB_PARAMETER (RID_PAGE_START + 3)
#define RID_FORMULADLG_FORMULA_MODAL (RID_PAGE_START + 4)
#endif // FORMULA_FORRESID_HRC
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="FunctionPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Category</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">category</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="category">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<items>
<item translatable="yes">Last Used</item>
<item translatable="yes">All</item>
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Function</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">function</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="foruilo-FormulaListBox" id="function">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Formula ListBox-selection1"/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</interface>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="StructPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Structure</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">struct</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="foruilo-StructListBox" id="struct">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Formula ListBox-selection1"/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</interface>
......@@ -44,7 +44,6 @@ protected:
virtual void LoseFocus() SAL_OVERRIDE;
public:
RefEdit( Window* _pParent,IControlReferenceHandler* pParent, Window* pShrinkModeLabel, const ResId& rResId );
RefEdit( Window* _pParent, Window* pShrinkModeLabel, WinBits nStyle = WB_BORDER );
virtual ~RefEdit();
......@@ -95,10 +94,7 @@ protected:
virtual void LoseFocus() SAL_OVERRIDE;
public:
RefButton(Window* _pParent, const ResId& rResId);
RefButton(Window* _pParent, WinBits nStyle = 0);
RefButton(Window* _pParent, const ResId& rResId,
RefEdit* pEdit, IControlReferenceHandler* pDlg);
void SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit );
......
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