Lines 127-132
Link Here
|
127 |
#define ITEMID_FONTLIST SID_ATTR_CHAR_FONTLIST |
127 |
#define ITEMID_FONTLIST SID_ATTR_CHAR_FONTLIST |
128 |
#define ITEMID_FONT SID_ATTR_CHAR_FONT |
128 |
#define ITEMID_FONT SID_ATTR_CHAR_FONT |
129 |
#define ITEMID_FONTHEIGHT SID_ATTR_CHAR_FONTHEIGHT |
129 |
#define ITEMID_FONTHEIGHT SID_ATTR_CHAR_FONTHEIGHT |
|
|
130 |
#define ITEMID_LANGUAGE SID_ATTR_CHAR_LANGUAGE |
130 |
#define ITEMID_COLOR SID_ATTR_CHAR_COLOR |
131 |
#define ITEMID_COLOR SID_ATTR_CHAR_COLOR |
131 |
#define ITEMID_BRUSH SID_ATTR_BRUSH |
132 |
#define ITEMID_BRUSH SID_ATTR_BRUSH |
132 |
#define ITEMID_BOX SID_ATTR_BORDER_OUTER |
133 |
#define ITEMID_BOX SID_ATTR_BORDER_OUTER |
Lines 137-142
Link Here
|
137 |
#include "xtable.hxx" |
138 |
#include "xtable.hxx" |
138 |
#include "fontitem.hxx" |
139 |
#include "fontitem.hxx" |
139 |
#include "fhgtitem.hxx" |
140 |
#include "fhgtitem.hxx" |
|
|
141 |
#include "langitem.hxx" |
140 |
#include "brshitem.hxx" |
142 |
#include "brshitem.hxx" |
141 |
#include "boxitem.hxx" |
143 |
#include "boxitem.hxx" |
142 |
#include "colritem.hxx" |
144 |
#include "colritem.hxx" |
Lines 146-151
Link Here
|
146 |
#include "tbcontrl.hxx" |
148 |
#include "tbcontrl.hxx" |
147 |
#include "dlgutil.hxx" |
149 |
#include "dlgutil.hxx" |
148 |
#include "dialmgr.hxx" |
150 |
#include "dialmgr.hxx" |
|
|
151 |
#include "langbox.hxx" |
149 |
|
152 |
|
150 |
// ------------------------------------------------------------------------ |
153 |
// ------------------------------------------------------------------------ |
151 |
|
154 |
|
Lines 166-171
Link Here
|
166 |
SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); |
169 |
SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); |
167 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); |
170 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); |
168 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontHeightToolBoxControl, SvxFontHeightItem ); |
171 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontHeightToolBoxControl, SvxFontHeightItem ); |
|
|
172 |
SFX_IMPL_TOOLBOX_CONTROL( SvxLanguageToolBoxControl, SvxLanguageItem ); |
169 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorToolBoxControl, SvxColorItem ); |
173 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorToolBoxControl, SvxColorItem ); |
170 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorExtToolBoxControl, SvxColorItem ); |
174 |
SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorExtToolBoxControl, SvxColorItem ); |
171 |
SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem ); |
175 |
SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem ); |
Lines 282-287
Link Here
|
282 |
}; |
286 |
}; |
283 |
|
287 |
|
284 |
//======================================================================== |
288 |
//======================================================================== |
|
|
289 |
// class SvxLanguageBox_Impl --------------------------------------------- |
290 |
//======================================================================== |
291 |
|
292 |
class SvxLanguageToolBoxControl; |
293 |
|
294 |
class SvxLanguageBox_Impl : public SvxLanguageBox |
295 |
{ |
296 |
private: |
297 |
SvxLanguageToolBoxControl* pCtrl; |
298 |
BOOL bRelease; |
299 |
SfxBindings& rBindings; |
300 |
Size aControlSize; |
301 |
|
302 |
void ReleaseFocus_Impl(); |
303 |
|
304 |
protected: |
305 |
virtual void Select(); |
306 |
virtual void DataChanged( const DataChangedEvent& rDCEvt ); |
307 |
|
308 |
public: |
309 |
SvxLanguageBox_Impl( Window* pParent, |
310 |
SvxLanguageToolBoxControl& rCtrl, SfxBindings& rBind ); |
311 |
|
312 |
void StateChanged_Impl( SfxItemState eState, |
313 |
const SfxPoolItem* pState ); |
314 |
void Update( const SvxLanguageItem& rLanguageItem ); |
315 |
|
316 |
virtual long Notify( NotifyEvent& rNEvt ); |
317 |
}; |
318 |
|
319 |
//======================================================================== |
285 |
// class SvxColorWindow_Impl -------------------------------------------------- |
320 |
// class SvxColorWindow_Impl -------------------------------------------------- |
286 |
//======================================================================== |
321 |
//======================================================================== |
287 |
|
322 |
|
Lines 1002-1007
Link Here
|
1002 |
} |
1037 |
} |
1003 |
|
1038 |
|
1004 |
//======================================================================== |
1039 |
//======================================================================== |
|
|
1040 |
// class SvxLanguageBox_Impl -------------------------------------------------- |
1041 |
//======================================================================== |
1042 |
|
1043 |
SvxLanguageBox_Impl::SvxLanguageBox_Impl( Window* pParent, SvxLanguageToolBoxControl &rCtrl, SfxBindings& rBind ) : |
1044 |
SvxLanguageBox( pParent, WinBits(WB_DROPDOWN) ), |
1045 |
pCtrl ( &rCtrl ), |
1046 |
bRelease ( TRUE ), |
1047 |
rBindings ( rBind ) |
1048 |
{ |
1049 |
SvxLanguageBox::SetLanguageList( LANG_LIST_ALL, TRUE, FALSE, TRUE ); |
1050 |
|
1051 |
aControlSize = CalcMinimumSize(); |
1052 |
aControlSize.setWidth( aControlSize.getWidth() * 0.8 ); |
1053 |
SetSizePixel( aControlSize ); |
1054 |
SetDropDownLineCount( 20 ); |
1055 |
} |
1056 |
|
1057 |
// ----------------------------------------------------------------------- |
1058 |
|
1059 |
void SvxLanguageBox_Impl::ReleaseFocus_Impl() |
1060 |
{ |
1061 |
if ( !bRelease ) |
1062 |
{ |
1063 |
bRelease = TRUE; |
1064 |
return; |
1065 |
} |
1066 |
|
1067 |
SfxViewShell* pCurSh = SfxViewShell::Current(); |
1068 |
|
1069 |
if ( pCurSh ) |
1070 |
{ |
1071 |
Window* pShellWnd = pCurSh->GetWindow(); |
1072 |
|
1073 |
if ( pShellWnd ) |
1074 |
pShellWnd->GrabFocus(); |
1075 |
} |
1076 |
} |
1077 |
|
1078 |
// ----------------------------------------------------------------------- |
1079 |
|
1080 |
void SvxLanguageBox_Impl::Select() |
1081 |
{ |
1082 |
SvxLanguageBox::Select(); |
1083 |
|
1084 |
if ( !IsTravelSelect() ) |
1085 |
{ |
1086 |
SvxLanguageItem aLanguageItem( SvxLanguageBox::GetSelectLanguage() ); |
1087 |
rBindings.GetDispatcher()->Execute( |
1088 |
SID_ATTR_CHAR_LANGUAGE, SFX_CALLMODE_RECORD, &aLanguageItem, 0L ); |
1089 |
ReleaseFocus_Impl(); |
1090 |
} |
1091 |
} |
1092 |
// ----------------------------------------------------------------------- |
1093 |
|
1094 |
void SvxLanguageBox_Impl::StateChanged_Impl( SfxItemState eState, const SfxPoolItem* pState ) |
1095 |
{ |
1096 |
} |
1097 |
|
1098 |
// ----------------------------------------------------------------------- |
1099 |
|
1100 |
void SvxLanguageBox_Impl::Update( const SvxLanguageItem& rLanguageItem ) |
1101 |
{ |
1102 |
LanguageType eLangType = (LanguageType)rLanguageItem.GetValue(); |
1103 |
if ( eLangType != LANGUAGE_DONTKNOW ) |
1104 |
{ |
1105 |
for ( USHORT i = 0; i < GetEntryCount(); ++i ) |
1106 |
{ |
1107 |
if ( (LanguageType)(ULONG)GetEntryData(i) == eLangType ) |
1108 |
{ |
1109 |
SelectEntryPos(i); |
1110 |
break; |
1111 |
} |
1112 |
} |
1113 |
} |
1114 |
} |
1115 |
|
1116 |
// ----------------------------------------------------------------------- |
1117 |
|
1118 |
long SvxLanguageBox_Impl::Notify( NotifyEvent& rNEvt ) |
1119 |
{ |
1120 |
SvxLanguageBox::Notify( rNEvt ); |
1121 |
} |
1122 |
/* -----------------------------08.03.2002 13:24------------------------------ |
1123 |
|
1124 |
---------------------------------------------------------------------------*/ |
1125 |
void SvxLanguageBox_Impl::DataChanged( const DataChangedEvent& rDCEvt ) |
1126 |
{ |
1127 |
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) |
1128 |
SetSizePixel( aControlSize ); |
1129 |
|
1130 |
SvxLanguageBox::DataChanged( rDCEvt ); |
1131 |
} |
1132 |
|
1133 |
//======================================================================== |
1005 |
// class SvxColorWindow_Impl -------------------------------------------------- |
1134 |
// class SvxColorWindow_Impl -------------------------------------------------- |
1006 |
//======================================================================== |
1135 |
//======================================================================== |
1007 |
#ifndef WB_NO_DIRECTSELECT |
1136 |
#ifndef WB_NO_DIRECTSELECT |
Lines 2431-2436
Link Here
|
2431 |
Window* SvxFontHeightToolBoxControl::CreateItemWindow( Window *pParent ) |
2560 |
Window* SvxFontHeightToolBoxControl::CreateItemWindow( Window *pParent ) |
2432 |
{ |
2561 |
{ |
2433 |
pBox = new SvxFontSizeBox_Impl( pParent, *this, GetBindings() ); |
2562 |
pBox = new SvxFontSizeBox_Impl( pParent, *this, GetBindings() ); |
|
|
2563 |
return pBox; |
2564 |
} |
2565 |
|
2566 |
//======================================================================== |
2567 |
// class SvxLangaugeToolBoxControl --------------------------------------- |
2568 |
//======================================================================== |
2569 |
|
2570 |
SvxLanguageToolBoxControl::SvxLanguageToolBoxControl( |
2571 |
USHORT nId, |
2572 |
ToolBox& rTbx , |
2573 |
SfxBindings& rBindings) |
2574 |
: SfxToolBoxControl( nId, rTbx, rBindings ) |
2575 |
{ |
2576 |
} |
2577 |
|
2578 |
// ----------------------------------------------------------------------- |
2579 |
|
2580 |
void SvxLanguageToolBoxControl::StateChanged( |
2581 |
USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ) |
2582 |
{ |
2583 |
USHORT nId = GetId(); |
2584 |
ToolBox& rTbx = GetToolBox(); |
2585 |
SvxLanguageBox_Impl* pBox = (SvxLanguageBox_Impl*)(rTbx.GetItemWindow( nId )); |
2586 |
|
2587 |
DBG_ASSERT( pBox, "Control not found!" ); |
2588 |
|
2589 |
if ( SFX_ITEM_DISABLED == eState ) |
2590 |
{ |
2591 |
pBox->Disable(); |
2592 |
pBox->Update( NULL ); |
2593 |
} |
2594 |
else |
2595 |
{ |
2596 |
pBox->Enable(); |
2597 |
|
2598 |
if ( SFX_ITEM_AVAILABLE == eState ) |
2599 |
{ |
2600 |
SvxLanguageItem *pLangItem = (eState == SFX_ITEM_AVAILABLE) ? (SvxLanguageItem*)pState : NULL; |
2601 |
|
2602 |
if( ! pLangItem->ISA(SvxLanguageItem) ) |
2603 |
fprintf( stderr, "SvxLanguageToolBoxControl::StateChanged() - bad ItemType, expected SvxLanguageItem" ); |
2604 |
|
2605 |
if ( pLangItem ) |
2606 |
pBox->Update( *pLangItem ); |
2607 |
} |
2608 |
else |
2609 |
pBox->SelectLanguage( LANGUAGE_DONTKNOW ); |
2610 |
pBox->SaveValue(); |
2611 |
} |
2612 |
|
2613 |
rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); |
2614 |
} |
2615 |
|
2616 |
// ----------------------------------------------------------------------- |
2617 |
|
2618 |
Window* SvxLanguageToolBoxControl::CreateItemWindow( Window *pParent ) |
2619 |
{ |
2620 |
SvxLanguageBox_Impl* pBox = new SvxLanguageBox_Impl( pParent, *this, GetBindings() ); |
2434 |
return pBox; |
2621 |
return pBox; |
2435 |
} |
2622 |
} |
2436 |
|
2623 |
|