[haiku-commits] r35000 - haiku/trunk/src/apps/mail

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 11 Jan 2010 00:30:04 +0100 (CET)

Author: kirilla
Date: 2010-01-11 00:30:04 +0100 (Mon, 11 Jan 2010)
New Revision: 35000
Changeset: http://dev.haiku-os.org/changeset/35000/haiku

Removed:
   haiku/trunk/src/apps/mail/AutoTextControl.cpp
   haiku/trunk/src/apps/mail/AutoTextControl.h
Modified:
   haiku/trunk/src/apps/mail/FindWindow.cpp
   haiku/trunk/src/apps/mail/FindWindow.h
   haiku/trunk/src/apps/mail/Jamfile
Log:
Explicitly check BApplication::WindowAt() against NULL, as suggested by Axel. 
Replacing AutoTextControl with a standard BTextControl and window flag 
B_CLOSE_ON_QUIT.

Modified: haiku/trunk/src/apps/mail/FindWindow.cpp
===================================================================
--- haiku/trunk/src/apps/mail/FindWindow.cpp    2010-01-10 23:02:21 UTC (rev 
34999)
+++ haiku/trunk/src/apps/mail/FindWindow.cpp    2010-01-10 23:30:04 UTC (rev 
35000)
@@ -41,7 +41,6 @@
 #include "MailApp.h"
 #include "MailWindow.h"
 #include "Messages.h"
-#include "AutoTextControl.h"
 
 #include <Application.h>
 #include <Box.h>
@@ -60,29 +59,6 @@
 };
 
 
-void TextBevel(BView& view, BRect r)
-{
-       r.InsetBy(-1,-1);
-       view.SetHighColor(96,96,96);
-       view.MovePenTo(r.left,r.bottom);
-       view.StrokeLine(BPoint(r.left,r.top));
-       view.StrokeLine(BPoint(r.right,r.top));
-       view.SetHighColor(216,216,216);
-       view.StrokeLine(BPoint(r.right,r.bottom));
-       view.StrokeLine(BPoint(r.left,r.bottom));
-       r.InsetBy(-1,-1);
-       view.SetHighColor(192,192,192);
-       view.MovePenTo(r.left,r.bottom);
-       view.StrokeLine(BPoint(r.left,r.top));
-       view.StrokeLine(BPoint(r.right,r.top));
-       view.SetHighColor(255,255,255);
-       view.StrokeLine(BPoint(r.right,r.bottom));
-       view.StrokeLine(BPoint(r.left,r.bottom));
-       view.SetHighColor(0,0,0);
-}
-
-//     FindWindow is modeless...
-
 #define FINDBUTTON 'find'
 
 static BString sPreviousFind = "";
@@ -94,7 +70,7 @@
 {
        if (window == NULL) {
                long i=0;
-               while ((bool)(window = be_app->WindowAt(i++))) {
+               while ((window = be_app->WindowAt(i++)) != NULL) {
                        // Send the text to a waiting window
                        if (window != mFindWindow)
                                if (dynamic_cast<TMailWindow *>(window) != NULL)
@@ -128,13 +104,12 @@
 {
        BRect r = Bounds().InsetByCopy(10,10);
 
-       mBTextControl = new AutoTextControl(r,"BTextControl",NULL,
+       mBTextControl = new BTextControl(r, "BTextControl", NULL,
                sPreviousFind.String(), new BMessage(M_FIND_STRING_CHANGED),
                B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
 
        mBTextControl->SetText(sPreviousFind.String());
        mBTextControl->MakeFocus();
-       mBTextControl->SetEscapeCancel(true);
        AddChild(mBTextControl);
        
        mFindButton = new BButton(BRect(0,0,90,20),"FINDBUTTON",
@@ -233,10 +208,9 @@
 
 
 FindWindow::FindWindow()
-       : BWindow(FindWindow::mLastPosition, 
-               TR("Find"),
-               B_FLOATING_WINDOW,
-               B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK)
+       : BWindow(FindWindow::mLastPosition, TR("Find"), B_FLOATING_WINDOW,
+               B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK
+                       | B_CLOSE_ON_ESCAPE)
 {
        mFindPanel = new FindPanel(Bounds());
        AddChild(mFindPanel);

Modified: haiku/trunk/src/apps/mail/FindWindow.h
===================================================================
--- haiku/trunk/src/apps/mail/FindWindow.h      2010-01-10 23:02:21 UTC (rev 
34999)
+++ haiku/trunk/src/apps/mail/FindWindow.h      2010-01-10 23:30:04 UTC (rev 
35000)
@@ -42,10 +42,10 @@
 
 #include <AppDefs.h>
 #include <Box.h>
+#include <TextControl.h>
 #include <Window.h>
 
 class FindPanel;
-class AutoTextControl;
 
 
 class FindWindow : public BWindow {
@@ -83,7 +83,7 @@
 
 protected:
                BButton* mFindButton;
-               AutoTextControl* mBTextControl;
+               BTextControl* mBTextControl;
 };
 
 

Modified: haiku/trunk/src/apps/mail/Jamfile
===================================================================
--- haiku/trunk/src/apps/mail/Jamfile   2010-01-10 23:02:21 UTC (rev 34999)
+++ haiku/trunk/src/apps/mail/Jamfile   2010-01-10 23:30:04 UTC (rev 35000)
@@ -12,7 +12,6 @@
 AddResources Mail : pictures.rdef  ;
 
 Application Mail : 
-       AutoTextControl.cpp
        BmapButton.cpp
        ButtonBar.cpp
        ComboBox.cpp


Other related posts:

  • » [haiku-commits] r35000 - haiku/trunk/src/apps/mail - jonas