⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvqexforms.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  end;
  inherited Dispatch(Mesg);
end;
{ QWinControl Common }
procedure TJvExScrollBox.CMDesignHitTest(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    Handled := inherited HitTest(XPos, YPos);
    if Handled then
      Result := HTCLIENT;
  end;
end;

procedure TJvExScrollBox.CMHitTest(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    if csDesigning in ComponentState then
      Result := Perform(CM_DESIGNHITTEST, XPos, YPos)
    else
    begin
      Handled := inherited HitTest(XPos, YPos);
      if Handled then
        Result := HTCLIENT;
    end;
  end;
end;

function TJvExScrollBox.DoPaintBackground(Canvas: TCanvas; Param: Integer): Boolean;
begin
  Result := false;
end;

procedure TJvExScrollBox.ShowingChanged;
begin
  Perform(CM_SHOWINGCHANGED, 0 ,0);
  inherited;
end;

procedure TJvExScrollBox.ColorChanged;
begin
  Perform(CM_COLORCHANGED, 0, 0);
  inherited;
end;

procedure TJvExScrollBox.CursorChanged;
begin
  Perform(CM_CURSORCHANGED, 0, 0);
  inherited;
end;

procedure TJvExScrollBox.DoSetFocus(PreviousWnd: QWidgetH);
begin
  { notification }
end;

procedure TJvExScrollBox.DoKillFocus(NextWnd: QWidgetH);
begin
  { notification }
end;

procedure TJvExScrollBox.DoEnter;
begin
  Perform(CM_ENTER, 0 ,0);
  inherited DoEnter;
end;

procedure TJvExScrollBox.DoExit;
begin
  Perform(CM_EXIT, 0 ,0);
  inherited DoExit;
end;

function TJvExScrollBox.EventFilter(Sender: QObjectH; Event: QEventH): Boolean;
begin
  Result := False;
  if Assigned(FOnEvent) then
    FOnEvent(Sender, Event, Result);
  if not Result then
    Result := inherited EventFilter(Sender, Event); 
end;

procedure TJvExScrollBox.FocusChanged;
begin
  NotifyControls(CM_FOCUSCHANGED);
end;

procedure TJvExScrollBox.DoOnFontChanged(Sender: TObject);
begin
  ParentFont := False;
  PostMessage(Self, CM_FONTCHANGED, 0, 0);
end;

procedure TJvExScrollBox.CreateWidget;
begin
  CreateWnd;
end;

procedure TJvExScrollBox.CreateWnd;
begin
  inherited CreateWidget;
end;

procedure TJvExScrollBox.RecreateWnd;
begin
  if not (csRecreating in ControlState) then
    RecreateWidget;
end;

procedure TJvExScrollBox.PaintTo(PaintDevice: QPaintDeviceH; X, Y: Integer);
begin
  WidgetControl_PaintTo(self, PaintDevice, X, Y);
end;

procedure TJvExScrollBox.PaintWindow(PaintDevice: QPaintDeviceH);
begin
  PaintTo(PaintDevice, 0, 0);
end;

function TJvExScrollBox.WidgetFlags: Integer;
begin
  Result := inherited WidgetFlags or
    Integer(WidgetFlags_WRepaintNoErase) or
    Integer(WidgetFlags_WMouseNoMask);
end;

function TJvExScrollBox.ColorToRGB(Value: TColor): TColor;
begin
  Result := QWindows.ColorToRGB(Value, self);
end;
  
{ QControl Common}

function TJvExScrollBox.HitTest(X, Y: integer): Boolean;
begin
   Result := Perform(CM_HITTEST, 0, 0) <> HTNOWHERE;
end;

procedure TJvExScrollBox.CMHintShow(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    Handled := inherited HintShow(HintInfo^);
  end;
end;

procedure TJvExScrollBox.CMSysFontChanged(var Mesg: TMessage);
begin
  if FDesktopFont then
  begin
    Font.Assign(Application.Font);
    FDesktopFont := True;
  end;
end;

procedure TJvExScrollBox.EnabledChanged;
begin
  Perform(CM_ENABLEDCHANGED, 0, 0);
  inherited EnabledChanged;
end;

procedure TJvExScrollBox.TextChanged;
begin
  Perform(CM_TEXTCHANGED, 0, 0);
  inherited TextChanged;
end;

procedure TJvExScrollBox.VisibleChanged;
begin
  Perform(CM_VISIBLECHANGED, 0, 0);
  inherited VisibleChanged;
end;

function TJvExScrollBox.HintShow(var HintInfo : THintInfo): Boolean;
begin
  Result := Perform(CM_HINTSHOW, 0, Integer(@HintInfo)) <> 0;
end;

procedure TJvExScrollBox.MouseEnter(AControl: TControl);
begin
  Perform(CM_MOUSEENTER, 0, 0);
  inherited MouseEnter(AControl);
end;

procedure TJvExScrollBox.MouseLeave(AControl: TControl);
begin
  Perform(CM_MOUSELEAVE, 0, 0);
  inherited MouseLeave(AControl);
end;

procedure TJvExScrollBox.ParentColorChanged;
begin
  inherited ParentColorChanged;
  if Assigned(FOnParentColorChanged) then
    FOnParentColorChanged(Self);
end;

procedure TJvExScrollBox.SetDesktopFont(Value: Boolean);
begin
  if FDesktopFont <> Value then
  begin
    FDesktopFont := Value;
    Perform(CM_SYSFONTCHANGED, 0, 0);
  end;
end;

procedure TJvExScrollBox.Dispatch(var Mesg);
begin
  if Assigned(FWindowProc) then
    FWindowProc(TMessage(Mesg))
  else
    inherited Dispatch(Mesg);
end;

function TJvExScrollBox.Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
var
  Mesg: TMessage;
begin
  Mesg.Msg := Msg;
  Mesg.WParam := WParam;
  Mesg.LParam := LParam;
  Mesg.Result := 0;
  Dispatch(Mesg);
  Result := Mesg.Result;
end;

function TJvExScrollBox.IsRightToLeft: Boolean;
begin
  Result := False;
end;
  
 
{ QWinControl Create }

constructor TJvExScrollingWidget.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FWindowProc := WndProc;
  FInternalFontChanged := Font.OnChange;
  Font.OnChange := DoOnFontChanged;
  FHintColor := clDefault;
  FDoubleBuffered := True;
  FCanvas := TControlCanvas.Create;
  TControlCanvas(FCanvas).Control := Self;
  
end;

destructor TJvExScrollingWidget.Destroy;
begin
  
  FCanvas.Free;
  inherited Destroy;
end;
  
{ WinControl Paint }


procedure TJvExScrollingWidget.Paint;
begin
  TControlCanvas(Canvas).StopPaint;
  inherited Painting(Handle, QPainter_clipRegion(Canvas.Handle));
  TControlCanvas(Canvas).StartPaint;
end;

procedure TJvExScrollingWidget.Painting(Sender: QObjectH; EventRegion: QRegionH);
begin
  if QRegion_isEmpty(EventRegion) then
    Exit;
//  QPainter_setClipping(Canvas.Handle, True);
  TControlCanvas(Canvas).StartPaint;
  try
    QPainter_setClipRegion(Canvas.Handle, EventRegion);
    Canvas.Brush.Assign(Brush);
    Canvas.Font.Assign(Font);
    RequiredState(Canvas, [csHandleValid, csFontValid, csBrushValid]);
    Paint;
  finally
    TControlCanvas(Canvas).StopPaint;
  end;
end;
 
procedure TJvExScrollingWidget.WndProc(var Mesg: TMessage);
begin
  //OutputDebugString(PAnsiChar(Format('WINCONTROL %s: %s Msg $%x',[Name, ClassName, Mesg.Msg])));
  with TJvMessage(Mesg) do
  begin
    case Msg of
      { WinControl Messages }
      WM_KILLFOCUS   : DoKillFocus(FocusedWnd);
      WM_SETFOCUS    : DoSetFocus(FocusedWnd);
      CM_FONTCHANGED : FInternalFontChanged(Font);
      CM_HINTSHOW    : HintInfo^.HintColor := GetHintcolor(Self);
      WM_GETDLGCODE:
      begin
        Result := InputKeysToDlgCodes(InputKeys);
        Exit;
      end;
      WM_ERASEBKGND:
      begin
        Canvas.Start;
        try
          Handled := DoPaintBackGround(Canvas, LParam);
        finally
          Canvas.Stop;
        end;
        Exit;
      end;
      { Control Messages }
      CM_FOCUSCHANGED: FocusChanged;
      CM_MOUSEENTER: FMouseOver := True;
      CM_MOUSELEAVE: FMouseOver := False;
    end;
  end;
  inherited Dispatch(Mesg);
end;
{ QWinControl Common }
procedure TJvExScrollingWidget.CMDesignHitTest(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    Handled := inherited HitTest(XPos, YPos);
    if Handled then
      Result := HTCLIENT;
  end;
end;

procedure TJvExScrollingWidget.CMHitTest(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    if csDesigning in ComponentState then
      Result := Perform(CM_DESIGNHITTEST, XPos, YPos)
    else
    begin
      Handled := inherited HitTest(XPos, YPos);
      if Handled then
        Result := HTCLIENT;
    end;
  end;
end;

function TJvExScrollingWidget.DoPaintBackground(Canvas: TCanvas; Param: Integer): Boolean;
begin
  Result := false;
end;

procedure TJvExScrollingWidget.ShowingChanged;
begin
  Perform(CM_SHOWINGCHANGED, 0 ,0);
  inherited;
end;

procedure TJvExScrollingWidget.ColorChanged;
begin
  Perform(CM_COLORCHANGED, 0, 0);
  inherited;
end;

procedure TJvExScrollingWidget.CursorChanged;
begin
  Perform(CM_CURSORCHANGED, 0, 0);
  inherited;
end;

procedure TJvExScrollingWidget.DoSetFocus(PreviousWnd: QWidgetH);
begin
  { notification }
end;

procedure TJvExScrollingWidget.DoKillFocus(NextWnd: QWidgetH);
begin
  { notification }
end;

procedure TJvExScrollingWidget.DoEnter;
begin
  Perform(CM_ENTER, 0 ,0);
  inherited DoEnter;
end;

procedure TJvExScrollingWidget.DoExit;
begin
  Perform(CM_EXIT, 0 ,0);
  inherited DoExit;
end;

function TJvExScrollingWidget.EventFilter(Sender: QObjectH; Event: QEventH): Boolean;
begin
  Result := False;
  if Assigned(FOnEvent) then
    FOnEvent(Sender, Event, Result);
  if not Result then
    Result := inherited EventFilter(Sender, Event); 
end;

procedure TJvExScrollingWidget.FocusChanged;
begin
  NotifyControls(CM_FOCUSCHANGED);
end;

procedure TJvExScrollingWidget.DoOnFontChanged(Sender: TObject);
begin
  ParentFont := False;
  PostMessage(Self, CM_FONTCHANGED, 0, 0);
end;

procedure TJvExScrollingWidget.CreateWidget;
begin
  CreateWnd;
end;

procedure TJvExScrollingWidget.CreateWnd;
begin
  inherited CreateWidget;
end;

procedure TJvExScrollingWidget.RecreateWnd;
begin
  if not (csRecreating in ControlState) then
    RecreateWidget;
end;

procedure TJvExScrollingWidget.PaintTo(PaintDevice: QPaintDeviceH; X, Y: Integer);
begin
  WidgetControl_PaintTo(self, PaintDevice, X, Y);
end;

procedure TJvExScrollingWidget.PaintWindow(PaintDevice: QPaintDeviceH);
begin
  PaintTo(PaintDevice, 0, 0);
end;

function TJvExScrollingWidget.WidgetFlags: Integer;
begin
  Result := inherited WidgetFlags or
    Integer(WidgetFlags_WRepaintNoErase) or
    Integer(WidgetFlags_WMouseNoMask);
end;

function TJvExScrollingWidget.ColorToRGB(Value: TColor): TColor;
begin
  Result := QWindows.ColorToRGB(Value, self);
end;
  
{ QControl Common}

function TJvExScrollingWidget.HitTest(X, Y: integer): Boolean;
begin
   Result := Perform(CM_HITTEST, 0, 0) <> HTNOWHERE;
end;

procedure TJvExScrollingWidget.CMHintShow(var Mesg: TJvMessage);
begin
  with Mesg do
  begin
    Handled := inherited HintShow(HintInfo^);
  end;
end;

procedure TJvExScrollingWidget.CMSysFontChanged(var Mesg: TMessage);
begin
  if FDesktopFont then
  begin
    Font.Assign(Application.Font);
    FDesktopFont := True;
  end;
end;

procedur

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -