Browse Source

Merge pull request #171 from boq/tabcompletion

Plasma part of chat name completion
Adam Johnson 13 years ago
parent
commit
2807fb455b
  1. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt
  2. 10
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp
  3. 1
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h
  4. 5
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
  5. 3
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h
  6. 1
      Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt
  7. 2
      Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt

@ -43,7 +43,7 @@ set(pfGameGUIMgr_HEADERS
pfGUICtrlGenerator.h pfGUICtrlGenerator.h
pfGUIDialogHandlers.h pfGUIDialogHandlers.h
pfGUIDialogMod.h pfGUIDialogMod.h
pfGUIDialogNotifyProc.cpp pfGUIDialogNotifyProc.h
pfGUIDragBarCtrl.h pfGUIDragBarCtrl.h
pfGUIDraggableMod.h pfGUIDraggableMod.h
pfGUIDynDisplayCtrl.h pfGUIDynDisplayCtrl.h

10
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp

@ -97,6 +97,16 @@ void pfGUIDialogNotifyProc::DoSomething( pfGUIControlMod *ctrl )
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kValueChanged ); ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kValueChanged );
} }
void pfGUIDialogNotifyProc::HandleExtendedEvent( pfGUIControlMod *ctrl, uint32_t event )
{
pfGUIEditBoxMod *edit = pfGUIEditBoxMod::ConvertNoRef( ctrl );
if(edit != nil && event == pfGUIEditBoxMod::kWantAutocomplete)
{
//send notify, somebody will do something with that (like python script)
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kSpecialAction );
}
}
void pfGUIDialogNotifyProc::OnInit( void ) void pfGUIDialogNotifyProc::OnInit( void )
{ {
if ( fDialog ) if ( fDialog )

1
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h

@ -70,6 +70,7 @@ class pfGUIDialogNotifyProc : public pfGUIDialogProc
pfGUIDialogNotifyProc( plKey &r ); pfGUIDialogNotifyProc( plKey &r );
virtual void DoSomething( pfGUIControlMod *ctrl ); virtual void DoSomething( pfGUIControlMod *ctrl );
virtual void HandleExtendedEvent( pfGUIControlMod *ctrl, uint32_t event );
virtual void OnInit( void ); virtual void OnInit( void );
virtual void OnShow( void ); virtual void OnShow( void );
virtual void OnHide( void ); virtual void OnHide( void );

5
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp

@ -379,6 +379,11 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef
DoSomething(); // Query WasEscaped() to see if it was escape vs enter DoSomething(); // Query WasEscaped() to see if it was escape vs enter
return true; return true;
} }
else if (key == KEY_TAB)
{
//Send notify for python scripts
HandleExtendedEvent(kWantAutocomplete);
}
else if (modifiers & pfGameGUIMgr::kCtrlDown) else if (modifiers & pfGameGUIMgr::kCtrlDown)
{ {
if (key == KEY_C) if (key == KEY_C)

3
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h

@ -129,7 +129,8 @@ class pfGUIEditBoxMod : public pfGUIControlMod
// Extended event types // Extended event types
enum ExtendedEvents enum ExtendedEvents
{ {
kValueChanging kValueChanging,
kWantAutocomplete
}; };
}; };

1
Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt

@ -14,6 +14,7 @@ set(pfMessage_SOURCES
set(pfMessage_HEADERS set(pfMessage_HEADERS
pfBackdoorMsg.h pfBackdoorMsg.h
pfGameGUIMsg.h pfGameGUIMsg.h
pfGUINotifyMsg.h
pfKIMsg.h pfKIMsg.h
pfMarkerMsg.h pfMarkerMsg.h
pfMessageCreatable.h pfMessageCreatable.h

2
Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h

@ -83,6 +83,7 @@ public:
kFocusChange, // when one of its controls loses focus to another kFocusChange, // when one of its controls loses focus to another
kExitMode, // GUI Exit Mode key was pressed kExitMode, // GUI Exit Mode key was pressed
kInterestingEvent, // GUI interesting-ness has changed kInterestingEvent, // GUI interesting-ness has changed
kSpecialAction, // meaning depends on control functionality (see below)
kEndEventList kEndEventList
}; };
@ -97,6 +98,7 @@ public:
// kAction - single click on item(s) // kAction - single click on item(s)
// kEditBox // kEditBox
// kAction - enter key hit // kAction - enter key hit
// kSpecialAction - tab key hit (for autocompletion on Python side)
// kUpDownPair // kUpDownPair
// kValueChanged - the value of the pair has been changed // kValueChanged - the value of the pair has been changed
// kKnob // kKnob

Loading…
Cancel
Save