Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29919/run Modified Files: JvActions.pas JvArrowButton.pas JvDynControlEngineIntf.pas JvDynControlEngineVCL.pas JvInspector.pas Log Message: CLX compatible, removed JvCLXUtils dependencies Index: JvDynControlEngineVCL.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDynControlEngineVCL.pas,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JvDynControlEngineVCL.pas 11 Jan 2004 10:56:58 -0000 1.9 --- JvDynControlEngineVCL.pas 29 Jan 2004 22:45:49 -0000 1.10 *************** *** 24,28 **** {$I jvcl.inc} ! {$I windowsonly.inc} unit JvDynControlEngineVCL; --- 24,32 ---- {$I jvcl.inc} ! ! {$IFDEF COMPILER6_UP} ! {$WARN UNIT_PLATFORM OFF} ! {$WARN SYMBOL_PLATFORM OFF} ! {$ENDIF COMPILER6_UP} unit JvDynControlEngineVCL; Index: JvActions.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvActions.pas,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JvActions.pas 28 Jan 2004 09:23:50 -0000 1.9 --- JvActions.pas 29 Jan 2004 22:45:49 -0000 1.10 *************** *** 32,37 **** uses - JclMapi, {$IFDEF MSWINDOWS} Windows, ShellAPI, ActnList, {$ENDIF MSWINDOWS} --- 32,37 ---- uses {$IFDEF MSWINDOWS} + JclMapi, Windows, ShellAPI, ActnList, {$ENDIF MSWINDOWS} *************** *** 91,95 **** property MailOptions: TJvSendMailOptions read FMailOptions write FMailOptions; end; ! {$ENDIF WINDOWS} TJvWebAction = class(TAction) --- 91,95 ---- property MailOptions: TJvSendMailOptions read FMailOptions write FMailOptions; end; ! {$ENDIF WINDOWS} TJvWebAction = class(TAction) Index: JvArrowButton.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvArrowButton.pas,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JvArrowButton.pas 5 Jan 2004 22:37:41 -0000 1.11 --- JvArrowButton.pas 29 Jan 2004 22:45:49 -0000 1.12 *************** *** 38,51 **** uses SysUtils, Classes, - {$IFDEF MSWINDOWS} - Windows, Messages, - {$ENDIF MSWINDOWS} {$IFDEF VCL} ! Controls, Forms, Graphics, Buttons, CommCtrl, Menus, {$ENDIF VCL} {$IFDEF VisualCLX} ! Types, QControls, QForms, QGraphics, QButtons, QMenus, {$ENDIF VisualCLX} ! JvClxUtils, JvComponent, JvTypes; type --- 38,49 ---- uses SysUtils, Classes, {$IFDEF VCL} ! Windows, Messages, Controls, Forms, Graphics, Buttons, CommCtrl, Menus, {$ENDIF VCL} {$IFDEF VisualCLX} ! QTypes, QControls, QForms, QGraphics, QButtons, QImgList, QMenus, Types, ! QWindows, {$ENDIF VisualCLX} ! JvComponent, JvTypes; type *************** *** 90,94 **** --- 88,94 ---- protected FState: TButtonState; + {$IFDEF VCL} function GetPalette: HPALETTE; override; + {$ENDIF VCL} procedure Loaded; override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; *************** *** 155,158 **** --- 155,159 ---- destructor Destroy; override; function AddMasked(Image: TBitmap; MaskColor: TColor): Integer; + {$IFDEF VisualCLX} override; {$ENDIF VisualCLX} procedure Delete(Index: Integer); property Count: Integer read FCount; *************** *** 202,205 **** --- 203,219 ---- end; + function DrawText(Canvas: TCanvas; Caption: TCaption; var R: TRect; + Flags: Integer): Integer; + begin + {$IFDEF VCL} + Result := Windows.DrawText(Canvas.Handle, PChar(Caption), Length(Caption), R, Flags); + {$ENDIF VCL} + {$IFDEF VisualCLX} + Canvas.Start; + Result := QWindows.DrawText(Canvas.Handle, WideString(Caption), Length(Caption), R, Flags); + Canvas.Stop; + {$ENDIF VisualCLX} + end; + procedure DrawLine(Canvas: TCanvas; X, Y, X2, Y2: Integer); begin *************** *** 452,456 **** --- 466,472 ---- IRect := Rect(0, 0, IWidth, IHeight); TmpImage.Canvas.Brush.Color := clBtnFace; + {$IFDEF VCL} TmpImage.Palette := CopyPalette(FOriginal.Palette); + {$ENDIF VCL} I := State; if Ord(I) >= NumGlyphs then *************** *** 474,478 **** --- 490,496 ---- DDB := TBitmap.Create; DDB.Assign(FOriginal); + {$IFDEF VCL} DDB.HandleType := bmDDB; + {$ENDIF VCL} if NumGlyphs > 1 then with TmpImage.Canvas do *************** *** 520,524 **** --- 538,544 ---- Assign(FOriginal); GrayedBitmap(MonoBmp); + {$IFDEF VCL} HandleType := bmDDB; + {$ENDIF VCL} Canvas.Brush.Color := clBlack; Width := IWidth; *************** *** 571,574 **** --- 591,595 ---- Index := CreateButtonGlyph(State); with GlyphPos do + {$IFDEF VCL} if Transparent or (State = bsExclusive) then ImageList_DrawEx(FGlyphList.Handle, Index, Canvas.Handle, X, Y, 0, 0, *************** *** 577,580 **** --- 598,611 ---- ImageList_DrawEx(FGlyphList.Handle, Index, Canvas.Handle, X, Y, 0, 0, ColorToRGB(clBtnFace), clNone, ILD_Normal); + {$ENDIF VCL} + {$IFDEF VisualCLX} + // (ahuser) transparent not really supported under CLX + if Transparent or (State = bsExclusive) then + begin + FGlyphList.Draw(Canvas, X, Y, Index, itImage, True); + end + else + FGlyphList.Draw(Canvas, X, Y, Index, itImage, True); + {$ENDIF VisualCLX} end; *************** *** 592,602 **** OffsetRect(TextBounds, 1, 1); Font.Color := clBtnHighlight; ! ClxDrawText(Canvas, S, TextBounds, 0); OffsetRect(TextBounds, -1, -1); Font.Color := clBtnShadow; ! ClxDrawText(Canvas, S, TextBounds, 0); end else ! ClxDrawText(Canvas, S, TextBounds, DT_CENTER or DT_VCENTER or DT_SINGLELINE); end; --- 623,633 ---- OffsetRect(TextBounds, 1, 1); Font.Color := clBtnHighlight; ! DrawText(Canvas, S, TextBounds, 0); OffsetRect(TextBounds, -1, -1); Font.Color := clBtnShadow; ! DrawText(Canvas, S, TextBounds, 0); end else ! DrawText(Canvas, S, TextBounds, DT_CENTER or DT_VCENTER or DT_SINGLELINE); end; *************** *** 625,629 **** TextBounds := Rect(0, 0, Client.Right - Client.Left, 0); S := Caption; ! ClxDrawText(Canvas, S, TextBounds, DT_CALCRECT); TextSize := Point(TextBounds.Right - TextBounds.Left, TextBounds.Bottom - TextBounds.Top); --- 656,660 ---- TextBounds := Rect(0, 0, Client.Right - Client.Left, 0); S := Caption; ! DrawText(Canvas, S, TextBounds, DT_CALCRECT); TextSize := Point(TextBounds.Right - TextBounds.Left, TextBounds.Bottom - TextBounds.Top); *************** *** 908,915 **** --- 939,954 ---- GetCursorPos(P); FMouseInControl := not (FindDragTarget(P, True) = Self); + {$IFDEF VCL} if FMouseInControl then Perform(CM_MOUSELEAVE, 0, 0) else Perform(CM_MOUSEENTER, 0, 0); + {$ENDIF VCL} + {$IFDEF VisualCLX} + if FMouseInControl then + MouseLeave(Self) + else + MouseEnter(Self); + {$ENDIF VisualCLX} end; end; *************** *** 931,935 **** --- 970,976 ---- var Pnt: TPoint; + {$IFDEF VCL} Msg: TMsg; + {$ENDIF VCL} begin inherited MouseDown(Button, Shift, X, Y); *************** *** 951,958 **** --- 992,1004 ---- Pnt := ClientToScreen(Point(0, Height)); FPopUp.Popup(Pnt.X, Pnt.Y); + {$IFDEF VCL} while PeekMessage(Msg, HWND_DESKTOP, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) do {nothing}; if GetCapture <> 0 then SendMessage(GetCapture, WM_CANCELMODE, 0, 0); + {$ENDIF VCL} + {$IFDEF VisualCLX} + Application.ProcessMessages; + {$ENDIF VisualCLX} end; *************** *** 1011,1018 **** --- 1057,1066 ---- end; + {$IFDEF VCL} function TJvArrowButton.GetPalette: HPALETTE; begin Result := Glyph.Palette; end; + {$ENDIF VCL} function TJvArrowButton.GetGlyph: TBitmap; Index: JvDynControlEngineIntf.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDynControlEngineIntf.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JvDynControlEngineIntf.pas 11 Jan 2004 10:56:58 -0000 1.6 --- JvDynControlEngineIntf.pas 29 Jan 2004 22:45:49 -0000 1.7 *************** *** 24,28 **** {$I jvcl.inc} ! {$I windowsonly.inc} unit JvDynControlEngineIntf; --- 24,32 ---- {$I jvcl.inc} ! ! {$IFDEF COMPILER6_UP} ! {$WARN UNIT_PLATFORM OFF} ! {$WARN SYMBOL_PLATFORM OFF} ! {$ENDIF COMPILER6_UP} unit JvDynControlEngineIntf; Index: JvInspector.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvInspector.pas,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** JvInspector.pas 28 Jan 2004 09:23:51 -0000 1.48 --- JvInspector.pas 29 Jan 2004 22:45:49 -0000 1.49 *************** *** 56,60 **** Qt, Types, QGraphics, QControls, QStdCtrls, QExtCtrls, QWindows, JvExExtCtrls, {$ENDIF VisualCLX} ! JvClxUtils, JvComponent, JvTypes, JvExControls; const --- 56,60 ---- Qt, Types, QGraphics, QControls, QStdCtrls, QExtCtrls, QWindows, JvExExtCtrls, {$ENDIF VisualCLX} ! JvComponent, JvTypes, JvExControls; const *************** *** 5388,5391 **** --- 5388,5394 ---- MousePos: TSmallPoint; {$ENDIF VCL} + {$IFDEF VisualCLX} + Event: QMouseEventH; + {$ENDIF VisualCLX} begin if Tracking then *************** *** 5402,5408 **** SendMessage(ListBox.Handle, WM_LBUTTONDOWN, 0, Integer(MousePos)); {$ELSE} ! QApplication_sendEventAndDelete(ListBox.Handle, ! QMouseEvent_create(QEventType_MouseButtonPress, ! @ListPos, Integer(ButtonState_LeftButton), Integer(ButtonState_LeftButton))); {$ENDIF VCL} Exit; --- 5405,5415 ---- SendMessage(ListBox.Handle, WM_LBUTTONDOWN, 0, Integer(MousePos)); {$ELSE} ! Event := QMouseEvent_create(QEventType_MouseButtonPress, ! @ListPos, Integer(ButtonState_LeftButton), Integer(ButtonState_LeftButton)); ! try ! QApplication_sendEvent(ListBox.Handle, Event); ! finally ! QMouseEvent_destroy(Event); ! end; {$ENDIF VCL} Exit; |