Stylefixes, no functional change.
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
|
||||
#include <Message.h>
|
||||
|
||||
ColorMenuItem::ColorMenuItem(const char *label, rgb_color color, BMessage *message)
|
||||
ColorMenuItem::ColorMenuItem(const char *label, rgb_color color,
|
||||
BMessage *message)
|
||||
: BMenuItem(label, message, 0, 0),
|
||||
fItemColor(color)
|
||||
{
|
||||
@@ -21,7 +22,7 @@ ColorMenuItem::ColorMenuItem(const char *label, rgb_color color, BMessage *messa
|
||||
void
|
||||
ColorMenuItem::DrawContent()
|
||||
{
|
||||
BMenu *menu = Menu();
|
||||
BMenu* menu = Menu();
|
||||
if (menu) {
|
||||
rgb_color menuColor = menu->HighColor();
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ class BMessage;
|
||||
|
||||
class ColorMenuItem: public BMenuItem {
|
||||
public:
|
||||
ColorMenuItem(const char *label, rgb_color color,
|
||||
BMessage *message);
|
||||
ColorMenuItem(const char* label, rgb_color color,
|
||||
BMessage* message);
|
||||
|
||||
protected:
|
||||
virtual void DrawContent();
|
||||
|
||||
@@ -54,10 +54,10 @@ const uint32 kMsgSetBold = 'Fbld';
|
||||
// fontcolors
|
||||
const rgb_color BLACK = {0, 0, 0, 255};
|
||||
const rgb_color RED = {255, 0, 0, 255};
|
||||
const rgb_color GREEN = {0, 255, 0, 255};
|
||||
const rgb_color BLUE = {0, 0, 255, 255};
|
||||
const rgb_color CYAN = {0, 255, 255, 255};
|
||||
const rgb_color MAGENTA = {255, 0, 255, 255};
|
||||
const rgb_color GREEN = {0, 255, 0, 255};
|
||||
const rgb_color BLUE = {0, 0, 255, 255};
|
||||
const rgb_color CYAN = {0, 255, 255, 255};
|
||||
const rgb_color MAGENTA = {255, 0, 255, 255};
|
||||
const rgb_color YELLOW = {255, 255, 0, 255};
|
||||
|
||||
// "Document"-menu
|
||||
|
||||
@@ -20,8 +20,9 @@ class BTextControl;
|
||||
|
||||
class FindWindow : public BWindow {
|
||||
public:
|
||||
FindWindow(BRect frame, BHandler* handler, BString *searchString,
|
||||
bool caseState, bool wrapState, bool backState);
|
||||
FindWindow(BRect frame, BHandler* handler,
|
||||
BString* searchString, bool caseState,
|
||||
bool wrapState, bool backState);
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void DispatchMessage(BMessage* message, BHandler* handler);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define B_TRANSLATION_CONTEXT "FindandReplaceWindow"
|
||||
|
||||
ReplaceWindow::ReplaceWindow(BRect frame, BHandler* _handler,
|
||||
BString* searchString, BString *replaceString,
|
||||
BString* searchString, BString* replaceString,
|
||||
bool caseState, bool wrapState, bool backState)
|
||||
: BWindow(frame, "ReplaceWindow", B_MODAL_WINDOW,
|
||||
B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS,
|
||||
|
||||
@@ -23,12 +23,12 @@ class BTextControl;
|
||||
|
||||
class ReplaceWindow : public BWindow {
|
||||
public:
|
||||
ReplaceWindow(BRect frame, BHandler *_handler,
|
||||
BString *searchString, BString *replaceString,
|
||||
ReplaceWindow(BRect frame, BHandler* _handler,
|
||||
BString* searchString, BString* replaceString,
|
||||
bool caseState, bool wrapState, bool backState);
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void DispatchMessage(BMessage* message, BHandler *handler);
|
||||
virtual void DispatchMessage(BMessage* message, BHandler* handler);
|
||||
|
||||
private:
|
||||
void _SendMessage(uint32 what);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
using namespace BPrivate;
|
||||
|
||||
|
||||
BRect gWindowRect(7-15, 26-15, 507, 426);
|
||||
BRect gWindowRect(7 - 15, 26 - 15, 507, 426);
|
||||
|
||||
|
||||
namespace
|
||||
@@ -117,8 +117,8 @@ StyledEditApp::StyledEditApp()
|
||||
name.Append(mime);
|
||||
name.Append(")");
|
||||
}
|
||||
BMenuItem* item =
|
||||
new BMenuItem(name.String(), new BMessage(OPEN_AS_ENCODING));
|
||||
BMenuItem* item
|
||||
= new BMenuItem(name.String(), new BMessage(OPEN_AS_ENCODING));
|
||||
item->SetTarget(this);
|
||||
fOpenPanelEncodingMenu->AddItem(item);
|
||||
if (charset.GetFontID() == fOpenAsEncoding)
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
using namespace BPrivate;
|
||||
|
||||
|
||||
StyledEditView::StyledEditView(BRect viewFrame, BRect textBounds, BHandler *handler)
|
||||
StyledEditView::StyledEditView(BRect viewFrame, BRect textBounds,
|
||||
BHandler* handler)
|
||||
: BTextView(viewFrame, "textview", textBounds,
|
||||
B_FOLLOW_ALL, B_FRAME_EVENTS | B_WILL_DRAW)
|
||||
{
|
||||
@@ -162,7 +163,7 @@ StyledEditView::GetEncoding() const
|
||||
|
||||
const BCharacterSet* set =
|
||||
BCharacterSetRoster::FindCharacterSetByName(fEncoding.String());
|
||||
if(set != NULL)
|
||||
if (set != NULL)
|
||||
return set->GetFontID();
|
||||
|
||||
return 0;
|
||||
@@ -181,8 +182,8 @@ StyledEditView::DeleteText(int32 start, int32 finish)
|
||||
|
||||
|
||||
void
|
||||
StyledEditView::InsertText(const char *text, int32 length, int32 offset,
|
||||
const text_run_array *runs)
|
||||
StyledEditView::InsertText(const char* text, int32 length, int32 offset,
|
||||
const text_run_array* runs)
|
||||
{
|
||||
if (!fSuppressChanges)
|
||||
fMessenger->SendMessage(TEXT_CHANGED);
|
||||
|
||||
@@ -23,14 +23,14 @@ class BPositionIO;
|
||||
class StyledEditView : public BTextView {
|
||||
public:
|
||||
StyledEditView(BRect viewframe, BRect textframe,
|
||||
BHandler *handler);
|
||||
BHandler* handler);
|
||||
virtual ~StyledEditView();
|
||||
|
||||
virtual void Select(int32 start, int32 finish);
|
||||
virtual void DeleteText(int32 start, int32 finish);
|
||||
virtual void FrameResized(float width, float height);
|
||||
virtual void InsertText(const char *text, int32 length, int32 offset,
|
||||
const text_run_array *runs = NULL);
|
||||
virtual void InsertText(const char* text, int32 length, int32 offset,
|
||||
const text_run_array* runs = NULL);
|
||||
|
||||
void Reset();
|
||||
void SetSuppressChanges(bool suppressChanges);
|
||||
|
||||
@@ -862,7 +862,8 @@ StyledEditWindow::Print(const char* documentName)
|
||||
int32 currentLine = 0;
|
||||
while (currentLine < linesInDocument) {
|
||||
float currentHeight = 0;
|
||||
while (currentHeight < printableRect.Height() && currentLine < linesInDocument) {
|
||||
while (currentHeight < printableRect.Height() && currentLine
|
||||
< linesInDocument) {
|
||||
currentHeight += fTextView->LineHeight(currentLine);
|
||||
if (currentHeight < printableRect.Height())
|
||||
currentLine++;
|
||||
@@ -1027,8 +1028,8 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
new BMessage(MENU_NEW), 'N'));
|
||||
menuItem->SetTarget(be_app);
|
||||
|
||||
menu->AddItem(menuItem = new BMenuItem(fRecentMenu =
|
||||
new BMenu(B_TRANSLATE("Open" B_UTF8_ELLIPSIS)),
|
||||
menu->AddItem(menuItem = new BMenuItem(fRecentMenu
|
||||
= new BMenu(B_TRANSLATE("Open" B_UTF8_ELLIPSIS)),
|
||||
new BMessage(MENU_OPEN)));
|
||||
menuItem->SetShortcut('O', 0);
|
||||
menuItem->SetTarget(be_app);
|
||||
@@ -1042,8 +1043,8 @@ StyledEditWindow::_InitWindow(uint32 encoding)
|
||||
menuItem->SetShortcut('S', B_SHIFT_KEY);
|
||||
menuItem->SetEnabled(true);
|
||||
|
||||
menu->AddItem(fRevertItem =
|
||||
new BMenuItem(B_TRANSLATE("Revert to saved" B_UTF8_ELLIPSIS),
|
||||
menu->AddItem(fRevertItem
|
||||
= new BMenuItem(B_TRANSLATE("Revert to saved" B_UTF8_ELLIPSIS),
|
||||
new BMessage(MENU_REVERT)));
|
||||
fRevertItem->SetEnabled(false);
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
|
||||
@@ -1505,7 +1506,7 @@ StyledEditWindow::_ReplaceAll(BString findThis, BString replaceWith,
|
||||
fTextView->SetSuppressChanges(true);
|
||||
|
||||
// start from the beginning of text
|
||||
fTextView->Select(0,0);
|
||||
fTextView->Select(0, 0);
|
||||
|
||||
int32 start, finish;
|
||||
|
||||
|
||||
@@ -118,17 +118,17 @@ private:
|
||||
BString fReplaceString;
|
||||
|
||||
// undo modes
|
||||
bool fUndoFlag; // we just did an undo action
|
||||
bool fCanUndo; // we can do an undo action next
|
||||
bool fRedoFlag; // we just did a redo action
|
||||
bool fCanRedo; // we can do a redo action next
|
||||
bool fUndoFlag; // we just did an undo action
|
||||
bool fCanUndo; // we can do an undo action next
|
||||
bool fRedoFlag; // we just did a redo action
|
||||
bool fCanRedo; // we can do a redo action next
|
||||
|
||||
// clean modes
|
||||
bool fUndoCleans;
|
||||
// an undo action will put us in a clean state
|
||||
bool fRedoCleans;
|
||||
// a redo action will put us in a clean state
|
||||
bool fClean; // we are in a clean state
|
||||
bool fClean; // we are in a clean state
|
||||
|
||||
bool fCaseSensitive;
|
||||
bool fWrapAround;
|
||||
|
||||
Reference in New Issue
Block a user