Ticket #10844: 0001-DiskProbe-select-Find-window-text.patch

File 0001-DiskProbe-select-Find-window-text.patch, 1.8 KB (added by gbl08ma, 8 years ago)

Fixes text not being selected on window open

  • src/apps/diskprobe/FindWindow.cpp

    From 7f628780d5765f97ba3c3b5ffd68387ec3868961 Mon Sep 17 00:00:00 2001
    From: Gabriel Maia <gbl08ma@gmail.com>
    Date: Wed, 7 Sep 2016 16:04:25 +0000
    Subject: [PATCH] DiskProbe: select Find window text
    
    Select the text to find as the Find window is opened.
    This makes the behavior more consistent with other apps.
    Fixes the main subject of #10844.
    
    Also removes trailing whitespace.
    ---
     src/apps/diskprobe/FindWindow.cpp | 10 +++++++++-
     src/apps/diskprobe/FindWindow.h   |  1 +
     2 files changed, 10 insertions(+), 1 deletion(-)
    
    diff --git a/src/apps/diskprobe/FindWindow.cpp b/src/apps/diskprobe/FindWindow.cpp
    index eee1c17..1e7d53f 100644
    a b FindWindow::FindWindow(BRect _rect, BMessage& previous, BMessenger& target,  
    509509    message->AddInt8("mode", kAsciiMode);
    510510    if (mode == kAsciiMode)
    511511        item->SetMarked(true);
    512     fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal", 
     512    fMenu->AddItem(item = new BMenuItem(B_TRANSLATE_COMMENT("Hexadecimal",
    513513        "A menu item, as short as possible, noun is recommended if it is "
    514514        "shorter than adjective."), message = new BMessage(kMsgFindMode)));
    515515    message->AddInt8("mode", kHexMode);
    FindWindow::QuitRequested()  
    632632
    633633
    634634void
     635FindWindow::Show()
     636{
     637    fTextView->SelectAll();
     638    BWindow::Show();
     639}
     640
     641
     642void
    635643FindWindow::SetTarget(BMessenger& target)
    636644{
    637645    fTarget = target;
  • src/apps/diskprobe/FindWindow.h

    diff --git a/src/apps/diskprobe/FindWindow.h b/src/apps/diskprobe/FindWindow.h
    index ce8e2b5..09df172 100644
    a b class FindWindow : public BWindow {  
    3030        virtual void WindowActivated(bool active);
    3131        virtual void MessageReceived(BMessage *message);
    3232        virtual bool QuitRequested();
     33        virtual void Show();
    3334
    3435        void SetTarget(BMessenger &target);
    3536