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 |
|
301 |
void ReleaseFocus_Impl(); |
302 |
|
303 |
protected: |
304 |
virtual void Select(); |
305 |
virtual void DataChanged( const DataChangedEvent& rDCEvt ); |
306 |
|
307 |
public: |
308 |
SvxLanguageBox_Impl( Window* pParent, |
309 |
SvxLanguageToolBoxControl& rCtrl, SfxBindings& rBind ); |
310 |
|
311 |
void StateChanged_Impl( SfxItemState eState, |
312 |
const SfxPoolItem* pState ); |
313 |
void Update( const SvxLanguageItem& rLanguageItem ); |
314 |
|
315 |
virtual long Notify( NotifyEvent& rNEvt ); |
316 |
}; |
317 |
|
318 |
//======================================================================== |
285 |
// class SvxColorWindow_Impl -------------------------------------------------- |
319 |
// class SvxColorWindow_Impl -------------------------------------------------- |
286 |
//======================================================================== |
320 |
//======================================================================== |
287 |
|
321 |
|
Lines 1002-1007
Link Here
|
1002 |
} |
1036 |
} |
1003 |
|
1037 |
|
1004 |
//======================================================================== |
1038 |
//======================================================================== |
|
|
1039 |
// class SvxLanguageBox_Impl -------------------------------------------------- |
1040 |
//======================================================================== |
1041 |
|
1042 |
SvxLanguageBox_Impl::SvxLanguageBox_Impl( Window* pParent, SvxLanguageToolBoxControl &rCtrl, SfxBindings& rBind ) : |
1043 |
SvxLanguageBox( pParent, WinBits(WB_DROPDOWN) ), |
1044 |
pCtrl ( &rCtrl ), |
1045 |
bRelease ( TRUE ), |
1046 |
rBindings ( rBind ) |
1047 |
{ |
1048 |
SvxLanguageBox::SetDropDownLineCount( 15 ); |
1049 |
} |
1050 |
|
1051 |
// ----------------------------------------------------------------------- |
1052 |
|
1053 |
void SvxLanguageBox_Impl::ReleaseFocus_Impl() |
1054 |
{ |
1055 |
if ( !bRelease ) |
1056 |
{ |
1057 |
bRelease = TRUE; |
1058 |
return; |
1059 |
} |
1060 |
|
1061 |
SfxViewShell* pCurSh = SfxViewShell::Current(); |
1062 |
|
1063 |
if ( pCurSh ) |
1064 |
{ |
1065 |
Window* pShellWnd = pCurSh->GetWindow(); |
1066 |
|
1067 |
if ( pShellWnd ) |
1068 |
pShellWnd->GrabFocus(); |
1069 |
} |
1070 |
} |
1071 |
|
1072 |
// ----------------------------------------------------------------------- |
1073 |
|
1074 |
void SvxLanguageBox_Impl::Select() |
1075 |
{ |
1076 |
SvxLanguageBox::Select(); |
1077 |
|
1078 |
if ( !IsTravelSelect() ) |
1079 |
{ |
1080 |
SvxLanguageItem aLanguageItem( SvxLanguageBox::GetSelectLanguage() ); |
1081 |
rBindings.GetDispatcher()->Execute( |
1082 |
SID_ATTR_CHAR_LANGUAGE, SFX_CALLMODE_RECORD, &aLanguageItem, 0L ); |
1083 |
ReleaseFocus_Impl(); |
1084 |
} |
1085 |
} |
1086 |
// ----------------------------------------------------------------------- |
1087 |
|
1088 |
void SvxLanguageBox_Impl::StateChanged_Impl( SfxItemState eState, const SfxPoolItem* pState ) |
1089 |
{ |
1090 |
} |
1091 |
|
1092 |
// ----------------------------------------------------------------------- |
1093 |
|
1094 |
void SvxLanguageBox_Impl::Update( const SvxLanguageItem& rLanguageItem ) |
1095 |
{ |
1096 |
SvxLanguageBox::SetLanguageList( LANG_LIST_ALL, TRUE, FALSE, TRUE ); |
1097 |
|
1098 |
LanguageType eLangType = (LanguageType)rLanguageItem.GetValue(); |
1099 |
if ( eLangType != LANGUAGE_DONTKNOW ) |
1100 |
{ |
1101 |
for ( USHORT i = 0; i < GetEntryCount(); ++i ) |
1102 |
{ |
1103 |
if ( (LanguageType)(ULONG)GetEntryData(i) == eLangType ) |
1104 |
{ |
1105 |
SelectEntryPos(i); |
1106 |
break; |
1107 |
} |
1108 |
} |
1109 |
} |
1110 |
} |
1111 |
|
1112 |
// ----------------------------------------------------------------------- |
1113 |
|
1114 |
long SvxLanguageBox_Impl::Notify( NotifyEvent& rNEvt ) |
1115 |
{ |
1116 |
long nHandled = 0; |
1117 |
|
1118 |
#if 0 |
1119 |
if ( rNEvt.GetType() == EVENT_KEYINPUT ) |
1120 |
{ |
1121 |
USHORT nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); |
1122 |
|
1123 |
switch ( nCode ) |
1124 |
{ |
1125 |
case KEY_RETURN: |
1126 |
case KEY_TAB: |
1127 |
{ |
1128 |
if ( KEY_TAB == nCode ) |
1129 |
bRelease = FALSE; |
1130 |
else |
1131 |
nHandled = 1; |
1132 |
Select(); |
1133 |
break; |
1134 |
} |
1135 |
|
1136 |
case KEY_ESCAPE: |
1137 |
SetText( aCurText ); |
1138 |
ReleaseFocus_Impl(); |
1139 |
nHandled = 1; |
1140 |
break; |
1141 |
} |
1142 |
} |
1143 |
else if(EVENT_LOSEFOCUS == rNEvt.GetType()) |
1144 |
{ |
1145 |
Window* pFocusWin = Application::GetFocusWindow(); |
1146 |
if(!HasFocus() && GetSubEdit() != pFocusWin) |
1147 |
SetText(GetSavedValue()); |
1148 |
} |
1149 |
#endif |
1150 |
|
1151 |
return nHandled ? nHandled : SvxLanguageBox::Notify( rNEvt ); |
1152 |
} |
1153 |
/* -----------------------------08.03.2002 13:24------------------------------ |
1154 |
|
1155 |
---------------------------------------------------------------------------*/ |
1156 |
void SvxLanguageBox_Impl::DataChanged( const DataChangedEvent& rDCEvt ) |
1157 |
{ |
1158 |
SvxLanguageBox::DataChanged( rDCEvt ); |
1159 |
} |
1160 |
|
1161 |
//======================================================================== |
1005 |
// class SvxColorWindow_Impl -------------------------------------------------- |
1162 |
// class SvxColorWindow_Impl -------------------------------------------------- |
1006 |
//======================================================================== |
1163 |
//======================================================================== |
1007 |
#ifndef WB_NO_DIRECTSELECT |
1164 |
#ifndef WB_NO_DIRECTSELECT |
Lines 2431-2436
Link Here
|
2431 |
Window* SvxFontHeightToolBoxControl::CreateItemWindow( Window *pParent ) |
2588 |
Window* SvxFontHeightToolBoxControl::CreateItemWindow( Window *pParent ) |
2432 |
{ |
2589 |
{ |
2433 |
pBox = new SvxFontSizeBox_Impl( pParent, *this, GetBindings() ); |
2590 |
pBox = new SvxFontSizeBox_Impl( pParent, *this, GetBindings() ); |
|
|
2591 |
return pBox; |
2592 |
} |
2593 |
|
2594 |
//======================================================================== |
2595 |
// class SvxLangaugeToolBoxControl --------------------------------------- |
2596 |
//======================================================================== |
2597 |
|
2598 |
SvxLanguageToolBoxControl::SvxLanguageToolBoxControl( |
2599 |
USHORT nId, |
2600 |
ToolBox& rTbx , |
2601 |
SfxBindings& rBindings) |
2602 |
: SfxToolBoxControl( nId, rTbx, rBindings ) |
2603 |
{ |
2604 |
} |
2605 |
|
2606 |
// ----------------------------------------------------------------------- |
2607 |
|
2608 |
void SvxLanguageToolBoxControl::StateChanged( |
2609 |
USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ) |
2610 |
{ |
2611 |
USHORT nId = GetId(); |
2612 |
ToolBox& rTbx = GetToolBox(); |
2613 |
SvxLanguageBox_Impl* pBox = (SvxLanguageBox_Impl*)(rTbx.GetItemWindow( nId )); |
2614 |
|
2615 |
DBG_ASSERT( pBox, "Control not found!" ); |
2616 |
|
2617 |
if ( SFX_ITEM_DISABLED == eState ) |
2618 |
{ |
2619 |
pBox->Disable(); |
2620 |
pBox->Update( (const SvxLanguageItem*)NULL ); |
2621 |
} |
2622 |
else |
2623 |
{ |
2624 |
pBox->Enable(); |
2625 |
|
2626 |
if ( SFX_ITEM_AVAILABLE == eState ) |
2627 |
{ |
2628 |
SvxLanguageItem *pLangItem = (eState == SFX_ITEM_AVAILABLE) ? (SvxLanguageItem*)pState : NULL; |
2629 |
|
2630 |
if( ! pLangItem->ISA(SvxLanguageItem) ) |
2631 |
fprintf( stderr, "SvxLanguageToolBoxControl::StateChanged() - bad ItemType, expected SvxLanguageItem" ); |
2632 |
|
2633 |
if ( pLangItem ) |
2634 |
pBox->Update( *pLangItem ); |
2635 |
} |
2636 |
else |
2637 |
pBox->SelectLanguage( LANGUAGE_DONTKNOW ); |
2638 |
pBox->SaveValue(); |
2639 |
} |
2640 |
|
2641 |
rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); |
2642 |
} |
2643 |
|
2644 |
// ----------------------------------------------------------------------- |
2645 |
|
2646 |
Window* SvxLanguageToolBoxControl::CreateItemWindow( Window *pParent ) |
2647 |
{ |
2648 |
SvxLanguageBox_Impl* pBox = new SvxLanguageBox_Impl( pParent, *this, GetBindings() ); |
2434 |
return pBox; |
2649 |
return pBox; |
2435 |
} |
2650 |
} |
2436 |
|
2651 |
|