1 #include "FirstUiBuilder.h"
2 #include "ObjectInspector.h"
4 #include "UIBaseObject.h"
9 #include "UIImageStyle.h"
13 #include "AddPropertyDialogBox.h"
14 #include "EditPropertyDialogBox.h"
15 #include "SelectRegion.h"
21 extern void CheckOutSelectedFile();
22 extern bool gDrawHighlightRect
;
23 extern HWND gObjectTree
;
24 extern HANDLE gFrameRenderingMutex
;
25 extern UIBaseObject::UISmartObjectList gCurrentSelection
;
28 HTREEITEM
GetObjectInTreeControlFromHandle( HWND hTree
, HTREEITEM hParentItem
, UIBaseObject
*o
);
29 void SetSelection( UIBaseObject
*NewSelection
, bool pushHistory
);
30 void LoadTopLevelObjectsToTabControl( void );
31 void ClearDefPushButtonLook( HWND hwndDlg
, UINT nControlID
);
33 extern const char * gVisualEditLockPropertyName
;
35 void recordUndo(UIBaseObject
* const object
, bool force
= false);
36 extern bool volatile s_UndoReady
;
41 bool s_updateAllFromTextControl
= true;
45 UINT CALLBACK
ColorDialogHookProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
50 if( uMsg
== WM_INITDIALOG
)
57 GetWindowRect( GetDesktopWindow(), &rcDesktop
);
58 GetWindowRect( hwnd
, &rcWindow
);
60 WindowWidth
= rcWindow
.right
- rcWindow
.left
;
61 WindowHeight
= rcWindow
.bottom
- rcWindow
.top
;
63 rcWindow
.left
= (rcDesktop
.right
- rcDesktop
.left
) / 2 - WindowWidth
/ 2;
64 rcWindow
.top
= (rcDesktop
.bottom
- rcDesktop
.top
) / 2 - WindowHeight
/ 2;
66 MoveWindow( hwnd
, rcWindow
.left
, rcWindow
.top
, WindowWidth
, WindowHeight
, TRUE
);
71 ObjectInspector::ObjectInspector( HWND hWnd
)
73 HWND hParent
= GetParent( hWnd
);
74 mPropertyListbox
= hWnd
;
78 SetWindowLong( mPropertyListbox
, GWL_STYLE
, GetWindowLong( mPropertyListbox
, GWL_STYLE
) | WS_CLIPCHILDREN
);
80 mOldWindowProc
= (WNDPROC
)GetWindowLong( hParent
, GWL_WNDPROC
);
81 SetProp( hParent
, "ObjectInspector::this", this );
82 SetWindowLong( hParent
, GWL_WNDPROC
, (long)StaticWindowProc
);
84 SetTimer( hParent
, mTimerID
, 100, 0 );
86 mTextOverlay
= CreateWindowEx( WS_EX_TOPMOST
, "Edit", "", WS_CHILD
| WS_BORDER
| ES_AUTOHSCROLL
| ES_LEFT
,
87 0, 0, 0, 0, mPropertyListbox
, (HMENU
)1001, GetModuleHandle(0), 0 );
89 // HFONT hFont = (HFONT)SendMessage( mPropertyListbox, WM_GETFONT, 0, 0 );
91 const int height
= HIWORD (GetDialogBaseUnits ());
93 HFONT fixedFont
= CreateFont (height
* 3 / 4, 0,
103 SendMessage (hWnd
, WM_SETFONT
, reinterpret_cast<WPARAM
>(fixedFont
), 1);
105 SendMessage( mTextOverlay
, WM_SETFONT
, (WPARAM
)fixedFont
, 0 );
107 SetProp( mTextOverlay
, "ObjectInspector::this", this );
108 mOldTextboxWindowProc
= (WNDPROC
)GetWindowLong( mTextOverlay
, GWL_WNDPROC
);
109 SetWindowLong( mTextOverlay
, GWL_WNDPROC
, (long)StaticTextboxWindowProc
);
111 UpdateButtonEnabledState();
114 ObjectInspector::~ObjectInspector( void )
116 HWND hParent
= GetParent( mPropertyListbox
);
118 assert( (WNDPROC
)GetWindowLong( hParent
, GWL_WNDPROC
) == StaticWindowProc
);
120 KillTimer( hParent
, mTimerID
);
121 SetWindowLong( hParent
, GWL_WNDPROC
, (long)mOldWindowProc
);
122 RemoveProp( hParent
, "ObjectInspector::this" );
124 RemoveProp( mTextOverlay
, "ObjectInspector::this" );
125 DestroyWindow( mTextOverlay
);
128 //-----------------------------------------------------------------
130 void ObjectInspector::SetObject( UIBaseObject
*o
)
134 s_updateAllFromTextControl
= false;
135 UpdatePropertyFromTextControl();
137 LoadListboxWithObjectProperties();
140 UpdateTextControlFromProperty();
143 //-----------------------------------------------------------------
145 UIBaseObject
*ObjectInspector::GetObject( void ) const
147 return const_cast<UIBaseObject
*>(mObject
.pointer());
150 //-----------------------------------------------------------------
152 bool ObjectInspector::GetSelectedPropertyName( UINarrowString
&Out
)
154 long CurrentSelection
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
156 if( CurrentSelection
!= -1 )
158 int BufferSize
= SendMessage( mPropertyListbox
, LB_GETTEXTLEN
, CurrentSelection
, 0 );
159 char *PropertyName
= new char[BufferSize
+1];
161 SendMessage( mPropertyListbox
, LB_GETTEXT
, CurrentSelection
, (LPARAM
)PropertyName
);
170 void ObjectInspector::UpdateButtonEnabledState( void )
172 BOOL EnableAddButton
= FALSE
;
173 BOOL EnableRemoveButton
= FALSE
;
174 BOOL EnableLockButton
= FALSE
;
175 BOOL PressLockButton
= FALSE
;
179 UINarrowString PropertyName
;
181 EnableAddButton
= TRUE
;
183 if( GetSelectedPropertyName( PropertyName
) )
185 if( mObject
->IsPropertyRemovable( UILowerString (PropertyName
)))
186 EnableRemoveButton
= TRUE
;
189 if( mObject
->IsA( TUIWidget
) )
190 EnableLockButton
= TRUE
;
192 if( mObject
->HasProperty( UILowerString (gVisualEditLockPropertyName
) ))
193 PressLockButton
= TRUE
;
196 HWND hParent
= GetParent( mPropertyListbox
);
198 EnableWindow( GetDlgItem( hParent
, IDC_ADDPROPERTY
), EnableAddButton
);
199 EnableWindow( GetDlgItem( hParent
, IDC_REMOVEPROPERTY
), EnableRemoveButton
);
200 EnableWindow( GetDlgItem( hParent
, IDC_LOCK
), EnableLockButton
);
202 if( PressLockButton
)
203 CheckDlgButton( hParent
, IDC_LOCK
, BST_CHECKED
);
205 CheckDlgButton( hParent
, IDC_LOCK
, BST_UNCHECKED
);
208 void ObjectInspector::LoadListboxWithObjectProperties( void )
210 int Selection
= SendMessage(mPropertyListbox
, LB_GETCURSEL
, 0, 0);
212 if( Selection
== -1 )
215 SendMessage( mPropertyListbox
, LB_RESETCONTENT
, 0, 0 );
219 UpdateButtonEnabledState();
223 UIBaseObject::UIPropertyNameVector PropertyNames
;
224 mObject
->GetPropertyNames( PropertyNames
, false );
226 for( UIBaseObject::UIPropertyNameVector::const_iterator i
= PropertyNames
.begin(); i
!= PropertyNames
.end(); ++i
)
228 UILowerString
const & lname
= *i
;
229 char const * const lnameStr
= lname
.c_str();
230 if (lname
!= UIBaseObject::PropertyName::SourceFile
&&
231 (_stricmp( lname
.c_str (), gVisualEditLockPropertyName
) != 0) &&
232 (lnameStr
&& *lnameStr
!= '!'))
233 SendMessage( mPropertyListbox
, LB_ADDSTRING
, 0, (long)lname
.c_str () );
236 SendMessage( mPropertyListbox
, LB_SETCURSEL
, Selection
, 0 );
238 HWND hParent
= GetParent( mPropertyListbox
);
240 char ObjectType
[256];
241 sprintf(ObjectType
, "%s", mObject
->GetTypeName());
242 SetWindowText( GetDlgItem( hParent
, IDC_OBJECTTYPE
), ObjectType
);
245 if (UIManager::gUIManager().GetRootPage() == mObject
)
247 sourcePath
= Unicode::narrowToWide("ui_root");
251 mObject
->GetProperty(UIBaseObject::PropertyName::SourceFile
, sourcePath
);
254 sprintf(ObjectType
, "%s", Unicode::wideToNarrow(sourcePath
).c_str(), mObject
->GetTypeName());
255 SetWindowText(GetDlgItem( hParent
, IDC_OBJECTPROPERTIES_LABEL
), ObjectType
);
257 UpdateButtonEnabledState();
260 LRESULT CALLBACK
ObjectInspector::StaticWindowProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
262 ObjectInspector
*pThis
= reinterpret_cast<ObjectInspector
*>( GetProp( hwnd
, "ObjectInspector::this" ) );
263 return pThis
->WindowProc( hwnd
, uMsg
, wParam
, lParam
);
266 LRESULT CALLBACK
ObjectInspector::StaticTextboxWindowProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
268 ObjectInspector
*pThis
= reinterpret_cast<ObjectInspector
*>( GetProp( hwnd
, "ObjectInspector::this" ) );
271 return pThis
->TextboxWindowProc( hwnd
, uMsg
, wParam
, lParam
);
276 //-----------------------------------------------------------------
280 void setPropertyOnSelection (const UILowerString
& Name
, const Unicode::String
& Value
)
282 for (UIBaseObject::UISmartObjectList::iterator it
= gCurrentSelection
.begin (); it
!= gCurrentSelection
.end (); ++it
)
284 recordUndo(*it
, true);
285 (*it
)->SetProperty (Name
, Value
);
289 void removePropertyOnSelection (const UILowerString
& Name
)
291 for (UIBaseObject::UISmartObjectList::iterator it
= gCurrentSelection
.begin (); it
!= gCurrentSelection
.end (); ++it
)
293 recordUndo(*it
, true);
294 (*it
)->RemoveProperty (Name
);
299 //-----------------------------------------------------------------
301 LRESULT
ObjectInspector::WindowProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
303 if( (uMsg
== WM_DRAWITEM
) && GetDlgItem( hwnd
, wParam
) == mPropertyListbox
)
306 LPDRAWITEMSTRUCT pdis
= (LPDRAWITEMSTRUCT
)lParam
;
307 HBITMAP DoubleBufferBitmap
, OldBitmap
;
314 ItemSize
.x
= pdis
->rcItem
.right
- pdis
->rcItem
.left
;
315 ItemSize
.y
= pdis
->rcItem
.bottom
- pdis
->rcItem
.top
;
317 SetRect( &rcFill
, 0, 0, ItemSize
.x
, ItemSize
.y
);
318 SetRect( &rcClip
, 2, 0, ItemSize
.x
/ 2, ItemSize
.y
);
320 DoubleBufferDC
= CreateCompatibleDC( pdis
->hDC
);
321 DoubleBufferBitmap
= CreateCompatibleBitmap( pdis
->hDC
, ItemSize
.x
, ItemSize
.y
);
323 OldBitmap
= (HBITMAP
)SelectObject( DoubleBufferDC
, DoubleBufferBitmap
);
324 OldFont
= (HFONT
)SelectObject( DoubleBufferDC
, GetCurrentObject( pdis
->hDC
, OBJ_FONT
) );
326 if( pdis
->itemState
& ODS_SELECTED
)
328 HWND hwndFocus
= GetFocus();
330 if( (hwndFocus
== mTextOverlay
) || (hwndFocus
== mPropertyListbox
) )
332 FillRect( DoubleBufferDC
, &rcFill
, GetSysColorBrush( COLOR_HIGHLIGHT
) );
333 SetTextColor( DoubleBufferDC
, GetSysColor( COLOR_HIGHLIGHTTEXT
) );
337 FillRect( DoubleBufferDC
, &rcFill
, GetSysColorBrush( COLOR_BTNFACE
) );
338 SetTextColor( DoubleBufferDC
, GetSysColor( COLOR_BTNTEXT
) );
340 SetTextColor( DoubleBufferDC
, GetSysColor( COLOR_HIGHLIGHTTEXT
) );
344 FillRect( DoubleBufferDC
, &rcFill
, GetSysColorBrush( COLOR_WINDOW
) );
345 SetTextColor( DoubleBufferDC
, GetSysColor( COLOR_WINDOWTEXT
) );
348 SetBkMode( DoubleBufferDC
, TRANSPARENT
);
350 if( pdis
->itemID
!= -1 )
352 char *PropertyName
= new char[ SendMessage( mPropertyListbox
, LB_GETTEXTLEN
, pdis
->itemID
, 0 ) + 1 ];
353 SendMessage( mPropertyListbox
, LB_GETTEXT
, pdis
->itemID
, (long)PropertyName
);
354 DrawText( DoubleBufferDC
, PropertyName
, -1, &rcClip
, DT_SINGLELINE
);
356 rcClip
.left
= rcClip
.right
;
357 rcClip
.right
= ItemSize
.x
;
360 mObject
->GetProperty( UILowerString (PropertyName
), Value
);
361 DrawText( DoubleBufferDC
, UIUnicode::wideToNarrow (Value
).c_str(), -1, &rcClip
, DT_SINGLELINE
);
366 BitBlt( pdis
->hDC
, pdis
->rcItem
.left
, pdis
->rcItem
.top
, ItemSize
.x
, ItemSize
.y
, DoubleBufferDC
, 0, 0, SRCCOPY
);
368 SelectObject( DoubleBufferDC
, OldFont
);
369 SelectObject( DoubleBufferDC
, OldBitmap
);
370 DeleteObject( DoubleBufferBitmap
);
371 DeleteDC( DoubleBufferDC
);
375 else if( (uMsg
== WM_COMMAND
) )
377 if( LOWORD( wParam
) == IDC_ADDPROPERTY
&& mObject
)
379 AddPropertyDialogBox AddProp
;
380 UINarrowString NewName
;
383 if( AddProp
.GetNewProperty( hwnd
, NewName
, NewValue
) )
385 setPropertyOnSelection (UILowerString (NewName
), NewValue
);
386 LoadListboxWithObjectProperties();
389 SetFocus(mPropertyListbox
);
390 ClearDefPushButtonLook( hwnd
, IDC_ADDPROPERTY
);
393 else if( LOWORD( wParam
) == IDC_REMOVEPROPERTY
&& mObject
)
395 long CurrentSelection
;
399 CurrentSelection
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
401 if( CurrentSelection
>= 0 )
403 BufferSize
= SendMessage( mPropertyListbox
, LB_GETTEXTLEN
, CurrentSelection
, 0 );
405 SelectionText
= new char[BufferSize
+1];
406 SendMessage( mPropertyListbox
, LB_GETTEXT
, CurrentSelection
, (LPARAM
)SelectionText
);
407 removePropertyOnSelection(UILowerString (SelectionText
));
408 LoadListboxWithObjectProperties();
409 delete SelectionText
;
412 SetFocus(mPropertyListbox
);
413 ClearDefPushButtonLook( hwnd
, IDC_REMOVEPROPERTY
);
416 else if( (LOWORD( wParam
) == IDC_CHECKOUT
) && (HIWORD( wParam
) == BN_CLICKED
) )
418 CheckOutSelectedFile();
421 else if( LOWORD( wParam
) == IDC_LOCK
&& mObject
)
423 if( mObject
->HasProperty( UILowerString (gVisualEditLockPropertyName
) ) )
424 removePropertyOnSelection(UILowerString (gVisualEditLockPropertyName
));
426 setPropertyOnSelection (UILowerString (gVisualEditLockPropertyName
), UI_UNICODE_T("true") );
428 LoadListboxWithObjectProperties();
429 SetFocus(mPropertyListbox
);
430 ClearDefPushButtonLook( hwnd
, IDC_REMOVEPROPERTY
);
432 else if( (HWND
)lParam
== mPropertyListbox
)
434 switch( HIWORD(wParam
) )
437 s_updateAllFromTextControl
= false;
438 UpdatePropertyFromTextControl();
439 UpdateTextControlFromProperty();
440 UpdateButtonEnabledState();
442 SetFocus( mTextOverlay
);
445 ShowWindow( mTextOverlay
, SW_HIDE
);
449 long CurrentSelection
;
453 CurrentSelection
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
454 BufferSize
= SendMessage( mPropertyListbox
, LB_GETTEXTLEN
, CurrentSelection
, 0 );
456 SelectionText
= new char[BufferSize
+1];
457 SendMessage( mPropertyListbox
, LB_GETTEXT
, CurrentSelection
, (LPARAM
)SelectionText
);
461 UIString PropertyValue
;
463 const UILowerString
& lowerSelectionText
= UILowerString (SelectionText
);
465 if( mObject
->GetProperty( lowerSelectionText
, PropertyValue
) )
467 if( UIUnicode::icmp (PropertyValue
, UI_UNICODE_T ("true")) == 0)
468 setPropertyOnSelection (lowerSelectionText
, UI_UNICODE_T("false" ) );
469 else if( UIUnicode::icmp (PropertyValue
, UI_UNICODE_T ("false")) == 0)
470 setPropertyOnSelection (lowerSelectionText
, UI_UNICODE_T("true" ) );
473 UIBaseObject
*NewObject
= 0;
475 if( !PropertyValue
.empty() )
476 NewObject
= mObject
->GetObjectFromPath( PropertyValue
.c_str() );
480 SetSelection (NewObject
, true);
481 HTREEITEM hItemToSelect
= GetObjectInTreeControlFromHandle( gObjectTree
, 0, NewObject
);
482 TreeView_SelectItem( gObjectTree
, hItemToSelect
);
488 if( !_stricmp( SelectionText
, "SourceRect" ) )
490 // Show graphical source rect editor
491 bool UpdateProperty
= false;
493 SelectRegionDialogBox SelectRegion
;
495 if( mObject
->IsA( TUIImageStyle
) )
497 UpdateProperty
= SelectRegion
.EditProperty(hwnd
, UI_ASOBJECT(UIImageStyle
, mObject
), PropertyValue
);
499 else if( mObject
->IsA( TUIImageFragment
) )
501 UIBaseObject
*obj
= mObject
;
503 while( obj
&& !obj
->IsA( TUIImageStyle
) )
505 obj
= obj
->GetParent();
510 UpdateProperty
= SelectRegion
.EditProperty( hwnd
, static_cast<UIImageStyle
*>( obj
), PropertyValue
);
513 else if( mObject
->IsA( TUIImage
) )
515 UpdateProperty
= SelectRegion
.EditProperty(hwnd
, UI_ASOBJECT(UIImage
, mObject
), PropertyValue
);
519 setPropertyOnSelection( lowerSelectionText
, PropertyValue
);
521 else if( UIUtils::ParseColor( PropertyValue
, theColor
) )
523 static COLORREF CustomColors
[16] = {0};
524 CHOOSECOLOR cc
= { sizeof( cc
) };
526 cc
.rgbResult
= RGB( theColor
.r
, theColor
.g
, theColor
.b
);
527 cc
.Flags
= CC_FULLOPEN
| CC_RGBINIT
| CC_ANYCOLOR
| CC_ENABLEHOOK
;
528 cc
.lpCustColors
= CustomColors
;
529 cc
.lpfnHook
= ColorDialogHookProc
;
531 if( ChooseColor( &cc
) )
533 theColor
.r
= GetRValue( cc
.rgbResult
);
534 theColor
.g
= GetGValue( cc
.rgbResult
);
535 theColor
.b
= GetBValue( cc
.rgbResult
);
537 UIUtils::FormatColor( PropertyValue
, theColor
);
538 setPropertyOnSelection( lowerSelectionText
, PropertyValue
);
543 EditPropertyDialogBox EditProp
;
545 if( EditProp
.EditProperty( hwnd
, SelectionText
, PropertyValue
) )
546 setPropertyOnSelection( lowerSelectionText
, PropertyValue
);
551 delete [] SelectionText
;
559 else if( (uMsg
== WM_TIMER
) && (wParam
== mTimerID
) )
561 if (GetFocus () != mTextOverlay
)
562 InvalidateRect( mPropertyListbox
, 0, FALSE
);
566 return CallWindowProc( mOldWindowProc
, hwnd
, uMsg
, wParam
, lParam
);
569 //-----------------------------------------------------------------
571 LRESULT
ObjectInspector::TextboxWindowProc( HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
573 if( uMsg
== WM_KILLFOCUS
)
575 s_updateAllFromTextControl
= false;
576 UpdatePropertyFromTextControl();
577 ShowWindow( hwnd
, SW_HIDE
);
579 else if( uMsg
== WM_KEYDOWN
)
581 if( wParam
== VK_TAB
)
583 SendMessage( GetParent( mPropertyListbox
), WM_NEXTDLGCTL
, GetAsyncKeyState(VK_SHIFT
) & 0x80000000, FALSE
);
586 else if( wParam
== VK_ESCAPE
)
587 UpdateTextControlFromProperty();
588 else if( (wParam
== VK_UP
) || (wParam
== VK_DOWN
) )
589 return SendMessage( mPropertyListbox
, uMsg
, wParam
, lParam
);
591 else if( uMsg
== WM_KEYUP
)
593 if( (wParam
== VK_UP
) || (wParam
== VK_DOWN
) )
594 return SendMessage( mPropertyListbox
, uMsg
, wParam
, lParam
);
596 else if( (uMsg
== WM_CHAR
) && (wParam
== VK_RETURN
) )
598 UpdatePropertyFromTextControl();
599 UpdateTextControlFromProperty();
603 else if( uMsg
== WM_GETDLGCODE
)
604 return DLGC_WANTALLKEYS
| CallWindowProc( mOldTextboxWindowProc
, hwnd
, uMsg
, wParam
, lParam
);
606 return CallWindowProc( mOldTextboxWindowProc
, hwnd
, uMsg
, wParam
, lParam
);
609 void ObjectInspector::UpdateTextControlFromProperty( void )
613 int itemID
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
617 char *PropertyName
= new char[ SendMessage( mPropertyListbox
, LB_GETTEXTLEN
, itemID
, 0 ) + 1 ];
618 SendMessage( mPropertyListbox
, LB_GETTEXT
, itemID
, (long)PropertyName
);
620 mCurrentPropertyName
= PropertyName
;
623 mObject
->GetProperty( UILowerString (PropertyName
), Value
);
625 SetWindowText( mTextOverlay
, UIUnicode::wideToNarrow (Value
).c_str() );
632 void ObjectInspector::ShowTextControl( void )
634 int itemID
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
641 SendMessage( mPropertyListbox
, LB_GETITEMRECT
, itemID
, (LPARAM
)&itemRect
);
643 editSize
.x
= (itemRect
.right
- itemRect
.left
) / 2 + 3;
644 editSize
.y
= (itemRect
.bottom
- itemRect
.top
);
646 MoveWindow( mTextOverlay
, (itemRect
.right
- itemRect
.left
) - editSize
.x
, itemRect
.top
, editSize
.x
, editSize
.y
, TRUE
);
647 SendMessage( mTextOverlay
, EM_SETSEL
, 0, -1 );
648 ShowWindow( mTextOverlay
, SW_SHOW
);
652 void ObjectInspector::UpdatePropertyFromTextControl( void )
654 if( IsWindowVisible( mTextOverlay
) )
656 int itemID
= SendMessage( mPropertyListbox
, LB_GETCURSEL
, 0, 0 );
658 if( itemID
!= -1 && !mCurrentPropertyName
.empty() )
660 long TextLen
= SendMessage( mTextOverlay
, WM_GETTEXTLENGTH
, 0, 0 );
662 char * const PropertyValue
= new char[ TextLen
+ 1 ];
663 SendMessage( mTextOverlay
, WM_GETTEXT
, TextLen
+ 1, (LPARAM
)PropertyValue
);
665 WaitForSingleObject( gFrameRenderingMutex
, INFINITE
);
667 if (s_updateAllFromTextControl
)
668 setPropertyOnSelection (UILowerString (mCurrentPropertyName
), UIUnicode::narrowToWide (PropertyValue
) );
671 recordUndo(mObject
, true);
672 mObject
->SetProperty (UILowerString (mCurrentPropertyName
), UIUnicode::narrowToWide (PropertyValue
) );
675 delete PropertyValue
;
677 if( mCurrentPropertyName
== UIBaseObject::PropertyName::Name
.get ())
679 InvalidateRect( gObjectTree
, NULL
, TRUE
);
681 if( mObject
->IsA( TUIPage
) && (mObject
->GetParent() == UIManager::gUIManager().GetRootPage() ) )
682 LoadTopLevelObjectsToTabControl();
685 ReleaseMutex( gFrameRenderingMutex
);
689 s_updateAllFromTextControl
= true;
692 void ObjectInspector::SendKeyDown( unsigned KeyCode
)
695 SetFocus( mTextOverlay
);
697 BYTE keyboardstate
[256];
700 GetKeyboardState( keyboardstate
);
702 if( ToAscii( KeyCode
, 0, keyboardstate
, &outchars
, 0 ) != 1 )
705 char Keystroke
= static_cast<char> (outchars
& 0xFF);
707 SendMessage( mTextOverlay
, WM_CHAR
, Keystroke
, 0 );