Announcement

Collapse
No announcement yet.

Wheel-Mouse und IRRwitziges TDBLookupComboBox Verhalten!?!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wheel-Mouse und IRRwitziges TDBLookupComboBox Verhalten!?!

    Hi!

    Ich habe eine D4-MSAccess Anwendung. Wenn ich in dieser in einem aufgeklapptem TDBLookupComboBox DropDown das Rädchen der Maus bediene, verabschiedet sich zuerst das DropDown, dann der Focus meiner Anwendung. Ich kann diesen auch nicht mehr erhalten. Zu allem Überfluß, finde ich in der Task-Liste (Strg-Alt-Entf) folgende Zeile "SupplierQ: TQuery" ober dem Eintrag meiner Anwendung - *wonders*

    Wenn ich mit Norton-Antifreeze drüberfahre, dann komme ich in der Fensterhirarchie eine Stufe zurueck und das alte Fenster bleibt als wäre nichts geschehen(kann auch kein Windowsfehler sein, wo Windows vergessen hat das Fenster als Grafik vom Bildschirm zu löschen - denn nach einem weiterem ShowForm wird dieses Window in den Vordergrund gestellt - ohne FOCUS-Möglichkeit)

    das passiert aber nur in TDBLookupComboBoxen!! Hat das schon jemand mal erlebt?

    mfg
    -Thomas

  • #2
    Hallo,

    handelt es sich um eine <b>Microsoft IntelliMouse</b>? Wenn ja, hilft vielleicht das folgende Zitat aus dem <b>Delphi Tech Alert</b> (Published: 9/21/99):

    Description: Conflict between latest InteliMouse
    driver and TDBLookupComboBox.<br>
    Severity: Serious/Highly Visible<br>
    Steps to Reproduce: Install InteliMouse Driver v2.2d. Create or open an application which uses a TDBLookupComboBox. Click on the arrow in the box to show the drop down list. Now move the mouse wheel, and the application freezes. The application must be killed to recover.
    This issue does not occur with a TComboBox (TDBLookupComboBox is not a TComboBox descendent).

    Workaround: A permanent solution to this issue is currently
    in development. Here is a workaround which requires adding a couple lines to DBCTRLS.PAS:
    <pre>
    { This part takes care of the AV. ListLink.DataSet
    could be nil after the WM_MOUSEWHEEL wasn't
    handled and the Intellimouse driver decided to
    send a WM_VSCROLL }
    procedure TDBLookupListBox.WMVScroll(var Message: TWMVScroll);
    begin
    SearchText := '';
    <<<< ADD >>>>
    if ListLink.DataSet = nil then Exit;
    <<<< END ADD >>>>
    with Message, ListLink.DataSet do
    case ScrollCode of
    SB_LINEUP: MoveBy(-FRecordIndex - 1);
    SB_LINEDOWN: MoveBy(FRecordCount - FRecordIndex);
    SB_PAGEUP: MoveBy(-FRecordIndex - FRecordCount+ 1);
    SB_PAGEDOWN: MoveBy(FRecordCount - FRecordIndex+ FRecordCount - 2);
    SB_THUMBPOSITION:
    begin
    case Pos of
    0: First;
    1: MoveBy(-FRecordIndex - FRecordCount + 1);
    2: Exit;
    3: MoveBy(FRecordCount - FRecordIndex + FRecordCount - 2);
    4: Last;
    end;
    end;
    SB_BOTTOM: Last;
    SB_TOP: First;
    end;
    end;
    { This takes care of the "hang". For some unknown
    reason, the control gets a WM_KILLFOCUS immediately
    after the *second* WM_MOUSEWHEEL. I wasn't able to
    determine where the message came from. However,
    focus is retained by the drop-down list, making it
    appear that the application had stopped responding }
    procedure TDBLookupComboBox.CloseUp(Accept: Boolean);
    var
    Msg: TMsg;
    ListValue: Variant;
    begin
    if FListVisible then
    begin
    if GetCapture <> 0 then SendMessage(GetCapture,WM_CANCELMODE, 0, 0);
    <<<< ADD >>>>
    SetFocus;
    <<<< END ADD >>>>
    ListValue := FDataList.KeyValue;
    SetWindowPos(FDataList.Handle, 0, 0, 0, 0, 0, SWP_NOZORDERor
    SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATEor SWP_HIDEWINDOW);
    FListVisible := False;
    FDataList.ListSource := nil;
    Invalidate;
    SearchText := '';
    if Accept and CanModify then SelectKeyValue(ListValue);
    if Assigned(FOnCloseUp) then FOnCloseUp(Self);
    end;
    end;
    </pre>
    &#10

    Comment


    • #3
      Vielen Dank Hr. Kosch!

      Es ist immer wieder ein Vergnuegen ihre mehr als produktiven Hilfestellungen zu lesen - soviele Foren ich gelesen habe ... man könnte den Eindruck gewinnen, daß sie alleine fast alle Fragen beantworten!

      Workaround hat funktioniert ;_)

      mfg
      -Thomas Brislinge

      Comment

      Working...
      X