From 360e569a2c9a417677574e71e4cdd5c7856470af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 4 Jun 2006 19:46:07 +0000 Subject: [PATCH] Patch from Momoziro. Fixes highlighting bug in CannaIM's Kouhou window. Changes windows look to better values git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17722 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/input_server/methods/canna/CannaLooper.cpp | 2 +- src/add-ons/input_server/methods/canna/KouhoWindow.cpp | 9 ++++----- src/add-ons/input_server/methods/canna/PaletteWindow.cpp | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/add-ons/input_server/methods/canna/CannaLooper.cpp b/src/add-ons/input_server/methods/canna/CannaLooper.cpp index 324a3af375..4a2d36e480 100644 --- a/src/add-ons/input_server/methods/canna/CannaLooper.cpp +++ b/src/add-ons/input_server/methods/canna/CannaLooper.cpp @@ -487,7 +487,7 @@ CannaLooper::HandleMethodActivated( bool active ) else { ForceKakutei(); - uint32 result = canna->ChangeMode( CANNA_MODE_HenkanMode ); + canna->ChangeMode( CANNA_MODE_HenkanMode ); BMessage m( PALETTE_WINDOW_BUTTON_UPDATE ); m.AddInt32( "mode", CANNA_MODE_HenkanMode ); thePalette->PostMessage( &m ); diff --git a/src/add-ons/input_server/methods/canna/KouhoWindow.cpp b/src/add-ons/input_server/methods/canna/KouhoWindow.cpp index 6a350bcb15..d297987ebc 100644 --- a/src/add-ons/input_server/methods/canna/KouhoWindow.cpp +++ b/src/add-ons/input_server/methods/canna/KouhoWindow.cpp @@ -19,7 +19,7 @@ KouhoWindow::KouhoWindow( BFont *font, BLooper *looper ) :BWindow( DUMMY_RECT, - "kouho", kLeftTitledWindowLook, + "kouho", B_MODAL_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL, B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_AVOID_FOCUS | @@ -132,7 +132,7 @@ SERIAL_PRINT(( "kouhoWindow: KOUHO_WINDOW_SHOWAT recieved.\n" )); case KOUHO_WINDOW_SETTEXT: const char* newtext; - bool hideindex, limitsize, partialhighlight; + bool hideindex, limitsize; msg->FindString( "text", &newtext ); kouhoView->SetText( newtext ); @@ -262,7 +262,7 @@ void KouhoView::HighlightLine( int32 line ) if ( line != -1 ) { begin = OffsetAt( line ); - if ( line == CountLines() ) + if ( line == CountLines() - 1 ) end = TextLength() + 1; else end = OffsetAt( line + 1 ) - 1; @@ -289,17 +289,16 @@ KouhoView::HighlightPartial( int32 begin, int32 end ) void KouhoView::Draw( BRect rect ) { + BTextView::Draw( rect ); rgb_color viewcolor = ViewColor(); SetHighColor( selection_color ); SetDrawingMode( B_OP_MIN ); FillRect( highlightRect ); - BTextView::Draw( rect ); // SetViewColor( viewcolor ); } void KouhoView::MouseDown( BPoint point ) { - BWindow *win; KouhoIndexView *iview; iview = (KouhoIndexView *)(Window()->FindView( "index" )); if ( iview->IsNumberDisplayHidden() ) diff --git a/src/add-ons/input_server/methods/canna/PaletteWindow.cpp b/src/add-ons/input_server/methods/canna/PaletteWindow.cpp index 4198e3b941..a2ca66ee03 100644 --- a/src/add-ons/input_server/methods/canna/PaletteWindow.cpp +++ b/src/add-ons/input_server/methods/canna/PaletteWindow.cpp @@ -14,8 +14,10 @@ #include #include +#include "WindowPrivate.h" + PaletteWindow::PaletteWindow( BRect rect, BLooper *looper ) - :BWindow( rect, B_EMPTY_STRING, (window_look) 25 /*B_FLOATING_WINDOW_LOOK*/, + :BWindow( rect, B_EMPTY_STRING, kLeftTitledWindowLook, B_FLOATING_ALL_WINDOW_FEEL, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_NOT_CLOSABLE | B_AVOID_FOCUS | B_WILL_ACCEPT_FIRST_CLICK )