89ff195c8d
If the user has permission to change a room's subject or name, they can now edit the text views displaying them (toward the top of the window). When enter is pressed, the changes will be sent to the protocol. To do this, a BTextView subclass was added to libinterface (splitting somewhat from SendTextView)― EnterTextView sends a message containing the text to the given target when the user hits enter sans modifiers.
32 lines
766 B
C++
32 lines
766 B
C++
/*
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef _ENTER_TEXT_VIEW_H
|
|
#define _ENTER_TEXT_VIEW_H
|
|
|
|
#include <TextView.h>
|
|
|
|
|
|
class EnterTextView : public BTextView {
|
|
public:
|
|
EnterTextView(const char* name);
|
|
EnterTextView(const char* name, const BFont* initialFont,
|
|
const rgb_color* initialColor,
|
|
uint32 flags = B_WILL_DRAW);
|
|
|
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
|
|
|
void SetTarget(BHandler* handler) { fTarget = handler; }
|
|
|
|
BMessage Message() { return fMessage; }
|
|
void SetMessage(BMessage msg, const char* textSlot = NULL);
|
|
|
|
private:
|
|
BMessage fMessage;
|
|
BHandler* fTarget;
|
|
BString fTextSlot;
|
|
};
|
|
|
|
#endif // _ENTER_TEXT_VIEW_H
|