style cleanup ; undo, revert, redo, save, quit functions fixed up ; no more extra windows ; quit when all windows are closed ; fix grey lines when scrolling
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1848 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,36 +1,27 @@
|
||||
#ifndef STYLED_EDIT_VIEW_H
|
||||
#include "StyledEditView.h"
|
||||
#endif
|
||||
|
||||
#ifndef _MESSAGE_H
|
||||
#include <Message.h>
|
||||
#endif
|
||||
|
||||
#ifndef CONSTANTS_H
|
||||
#include "Constants.h"
|
||||
#endif
|
||||
|
||||
#ifndef _MESSENGER_H
|
||||
#include <Messenger.h>
|
||||
#endif
|
||||
|
||||
#ifndef _RECT_H
|
||||
#include <Rect.h>
|
||||
#endif
|
||||
#include <TranslationUtils.h>
|
||||
|
||||
#include "StyledEditView.h"
|
||||
#include "Constants.h"
|
||||
|
||||
StyledEditView::StyledEditView(BRect viewFrame, BRect textBounds, BHandler *handler)
|
||||
: BTextView(viewFrame, "textview", textBounds,
|
||||
B_FOLLOW_ALL, B_FRAME_EVENTS|B_WILL_DRAW)
|
||||
{
|
||||
fHandler= handler;
|
||||
fMessenger= new BMessenger(handler);
|
||||
fSuppressChanges = false;
|
||||
}/***StyledEditView()***/
|
||||
|
||||
StyledEditView::StyledEditView(BRect viewFrame, BRect textBounds, BHandler *handler) : BTextView(viewFrame, "textview",
|
||||
textBounds, B_FOLLOW_ALL, B_FRAME_EVENTS|B_WILL_DRAW){
|
||||
fHandler= handler;
|
||||
fMessenger= new BMessenger(handler);
|
||||
}/***StyledEditView()***/
|
||||
StyledEditView::~StyledEditView(){
|
||||
|
||||
StyledEditView::~StyledEditView(){
|
||||
|
||||
}/***~StyledEditView***/
|
||||
}/***~StyledEditView***/
|
||||
|
||||
void StyledEditView::FrameResized(float width, float height){
|
||||
void
|
||||
StyledEditView::FrameResized(float width, float height)
|
||||
{
|
||||
BTextView::FrameResized(width, height);
|
||||
|
||||
if(DoesWordWrap()){
|
||||
@@ -42,8 +33,27 @@ void StyledEditView::FrameResized(float width, float height){
|
||||
}
|
||||
}
|
||||
|
||||
void StyledEditView::Select(int32 start, int32 finish){
|
||||
|
||||
status_t
|
||||
StyledEditView::GetStyledText(BPositionIO * stream)
|
||||
{
|
||||
status_t result = B_OK;
|
||||
fSuppressChanges = true;
|
||||
result = BTranslationUtils::GetStyledText(stream, this, NULL);
|
||||
fSuppressChanges = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
StyledEditView::Reset()
|
||||
{
|
||||
fSuppressChanges = true;
|
||||
SetText("");
|
||||
fSuppressChanges = false;
|
||||
}
|
||||
|
||||
void
|
||||
StyledEditView::Select(int32 start, int32 finish)
|
||||
{
|
||||
if(start==finish)
|
||||
fChangeMessage= new BMessage(DISABLE_ITEMS);
|
||||
else
|
||||
@@ -54,40 +64,20 @@ void StyledEditView::Select(int32 start, int32 finish){
|
||||
BTextView::Select(start, finish);
|
||||
}
|
||||
|
||||
void StyledEditView::InsertText(const char *text, int32 length, int32 offset, const text_run_array *runs){
|
||||
|
||||
fMessenger-> SendMessage(new BMessage(TEXT_CHANGED));
|
||||
void StyledEditView::InsertText(const char *text, int32 length, int32 offset, const text_run_array *runs)
|
||||
{
|
||||
if (!fSuppressChanges)
|
||||
fMessenger-> SendMessage(new BMessage(TEXT_CHANGED));
|
||||
|
||||
BTextView::InsertText(text, length, offset, runs);
|
||||
|
||||
}/****StyledEditView::InsertText()***/
|
||||
|
||||
void StyledEditView::DeleteText(int32 start, int32 finish){
|
||||
|
||||
fMessenger-> SendMessage(new BMessage(TEXT_CHANGED));
|
||||
void StyledEditView::DeleteText(int32 start, int32 finish)
|
||||
{
|
||||
if (!fSuppressChanges)
|
||||
fMessenger-> SendMessage(new BMessage(TEXT_CHANGED));
|
||||
|
||||
BTextView::DeleteText(start, finish);
|
||||
|
||||
}/***StyledEditView::DeleteText***/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user