At first, I want to present myself. Nice to meet you all.

I am implementing an app with Delphi 2007 + Firebird 2.1.
I use TMS Components because I like the aspect of MS apps and I'd found this pack as the better.

I like also usability of MS apps and I'll try to replicate myself with Delphi at my apps.

I can see a functionality that I don't know how to implement, maybe you can do it ;-)

At MS Live Messenger, when you put the mouse over a contact (without clicking it), appears a panel with some options.
I want to do this with, for example a dbGrid (tms grid, devexpress grid, any of), but because Delphi don't have rollover event, I can't do it.


Any suggestion?

Thanks a lot.

Victor.

It is easy enough with the mouse events.

The MouseMove event handler should do something like the following pseudocode:

procedure TFooey.MouseMove( ... );
  begin
  if (nothing prevents you from responding to normal hovering)
    then if (x and y are in the object''s area)
           then begin
                if hover_mode <> hover
                  then begin
                       hover_mode := hover;
                       SetCaptureControl( TControl( self ) );
                       paint;
                       invoke_custom_rollover_event_hander
                       end
                end
           else begin
                if hover_mode <> not_hover
                  then begin
                       hover_mode := not_hover;
                       ReleaseCapture;
                       paint
                       invoke_custom_rollout_event_handler
                       end
                end;
  invoke_custom_mouse_move_event_handler
  end;

If you are doing this for TGrid components, you will also want to track not just the hover state, but also which cell is currently being hovered, if any.

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.