Stylefixes, no functional change.

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