CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 1999
    Posts
    11

    Status Bar - How to ?

    hai,
    I would like to display some help information on a component (lets us say a custom Status Bar) as the cursor moves over a MenuItem. How can this be done ?

    Keep smiling!!!
    Keep working hard!!!
    Keep climbing high!!!

  2. #2

    Re: Status Bar - How to ?

    you could try the mouseMove method in Java 1.0 or the MouseMotionListener in Java 1.1 or Java 2.

    Sameet Nasnodkar
    Senior Executive - Web Development
    AFL Limited

  3. #3
    Join Date
    Aug 1999
    Posts
    11

    Re: Status Bar - How to ?

    hai,
    Regarding ur answer to my question (regarding displaying a message in the status bar when the mouse moves
    over a menu item), the method u suggested, i feel, is not feasible. This is because, u can add listeners only to
    to a Compoent. In my case, a MenuItem is not derived from Component. Hence the compiler will report as
    there is no method called addMouseMotionListener(...) in MenuComponent, or MenuItem or Menu.
    thanx,
    Devi Prasad M. P.

    Keep smiling!!!
    Keep working hard!!!
    Keep climbing high!!!

  4. #4
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Status Bar - How to ?

    I read the documentation for MenuItem. I couldn't figure out if we will get focus events for MenuItem.

    If u want to show help regarding a component or a menuitem
    (provided u get focus event for it), u can just set the text in the
    status-bar on the focus gained event.

    - UnicMan
    http://members.tripod.com/unicman

  5. #5
    Guest

    Re: Status Bar - How to ?

    Hi,
    This is just a suggestion. U have the processEvent() method there in MenuComponent. Override the method in the class whi

  6. #6
    Guest

    Re: Status Bar - How to ?

    Sorry cant read the other replies to this but you could try something like this

    1. for each awt class (TextField etc) that you wish to recieve feedback on create new class which extends it and adds only a single String which will contain description . Update the constructors to set this string and add a getDesc() function to retrieve it.

    2. AddFocusListener Handlers in form which contains components.
    rInhalerY.addFocusListener(this);

    3. add this code to focusGained() // Nothing required in FocusLost() by the way
    e.g public void focusGained(FocusEvent fe)
    {
    if(fe.getSource() instanceof MyTextField)
    {
    MyTextField tField = (MyTextField) fe.getSource();
    theBar.setSBar(tField.getDesc());
    tField.selectAll();
    }

    else if(fe.getSource() instanceof MyButton)
    {
    MyButton mBut = (MyButton) fe.getSource();
    theBar.setSBar(mBut.getDesc());
    }

    else if(fe.getSource() instanceof MyCheckbox)
    {
    MyCheckbox cBox = (MyCheckbox) fe.getSource();
    theBar.setSBar(cBox.getDesc());
    }
    }
    5. Make sure you have created the actual Status Bar component / could be panel etc, with Label on it.

    Hope this was of help my Man. Please ignore if not.
    Rory Shearer
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured