git-svn-id: https://svn.code.sf.net/p/kolmck/code@92 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07

This commit is contained in:
dkolmck
2010-12-02 10:53:28 +00:00
parent 66467da3f8
commit e8ca1a22b8
4 changed files with 88 additions and 75 deletions

View File

@ -4,6 +4,7 @@ package addons_D2006;
{$R 'mckCCtrls.dcr'} {$R 'mckCCtrls.dcr'}
{$R 'mckHTTPDownload.dcr'} {$R 'mckHTTPDownload.dcr'}
{$R 'mckQProgBar.dcr'} {$R 'mckQProgBar.dcr'}
{$R 'MCKMHIPEdit.dcr'}
{$ALIGN 1} {$ALIGN 1}
{$ASSERTIONS ON} {$ASSERTIONS ON}
{$BOOLEVAL OFF} {$BOOLEVAL OFF}
@ -85,6 +86,8 @@ contains
tinyJPGGIFBMP in 'tinyJPGGIFBMP.pas', tinyJPGGIFBMP in 'tinyJPGGIFBMP.pas',
mckWebBrowser in 'mckWebBrowser.pas', mckWebBrowser in 'mckWebBrowser.pas',
mckDHTML in 'mckDHTML.pas', mckDHTML in 'mckDHTML.pas',
KolZLibBzip in 'KolZLibBzip.pas'; KolZLibBzip in 'KolZLibBzip.pas',
KOLMHIPEdit in 'KOLMHIPEdit.pas',
MCKMHIPEdit in 'MCKMHIPEdit.pas';
end. end.

145
KOL.pas
View File

@ -14,7 +14,7 @@
Key Objects Library (C) 2000 by Kladov Vladimir. Key Objects Library (C) 2000 by Kladov Vladimir.
**************************************************************** ****************************************************************
* VERSION 3.00.Z6 * VERSION 3.00.Z7
**************************************************************** ****************************************************************
K.O.L. - is a set of objects to create small programs K.O.L. - is a set of objects to create small programs
@ -34740,6 +34740,7 @@ end;
function WndProcUnicodeChars( Sender: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean; function WndProcUnicodeChars( Sender: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean;
var WStr, WW: KOLWideString; var WStr, WW: KOLWideString;
RepeatCount: Integer; RepeatCount: Integer;
C: KOLChar;
begin begin
Result := FALSE; Result := FALSE;
if (Msg.message = WM_CHAR) if (Msg.message = WM_CHAR)
@ -34752,6 +34753,16 @@ begin
{$ENDIF} then {$ENDIF} then
begin begin
Result := TRUE; Result := TRUE;
{$IFDEF NIL_EVENTS}
if assigned( Self_.EV.fOnChar ) then
{$ENDIF}
begin
C := KOLChar( Msg.wParam );
Sender.EV.fOnChar( Sender, C, GetShiftState );
Msg.wParam := Integer( C );
end;
WStr := WideChar(Msg.wParam); WStr := WideChar(Msg.wParam);
if WStr <> '' then if WStr <> '' then
begin begin
@ -39185,19 +39196,19 @@ begin
{$IFDEF USE_FLAGS} exclude( fFlagsG4, G4_Pushed ); {$IFDEF USE_FLAGS} exclude( fFlagsG4, G4_Pushed );
{$ELSE} fKeyPreviewing:=false; {$ENDIF} {$ELSE} fKeyPreviewing:=false; {$ENDIF}
{$ENDIF} {$ENDIF}
if fGlobalProcKeybd( @Self, Msg, Result ) then if fGlobalProcKeybd( @Self, Msg, Result ) then
begin begin
{$IFDEF INPACKAGE} {$IFDEF INPACKAGE}
LogOK; LogOK;
{$ENDIF INPACKAGE} {$ENDIF INPACKAGE}
Exit; //?????????????????? Exit; //??????????????????
end; end;
if PP.fWndProcKeybd( @Self, Msg, Result ) then if PP.fWndProcKeybd( @Self, Msg, Result ) then
begin begin
{$IFDEF INPACKAGE} {$IFDEF INPACKAGE}
LogOK; LogOK;
{$ENDIF INPACKAGE} {$ENDIF INPACKAGE}
Exit; //??????????????????? Exit; //???????????????????
end; end;
if ((GetKeystate( VK_CONTROL ) or GetKeyState( VK_MENU )) >= 0) then if ((GetKeystate( VK_CONTROL ) or GetKeyState( VK_MENU )) >= 0) then
begin begin
@ -39206,26 +39217,26 @@ begin
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
then then
begin begin
C := ParentForm; C := ParentForm;
if (C <> nil) if (C <> nil)
{$IFDEF NIL_EVENTS} {$IFDEF NIL_EVENTS}
and Assigned(C.PP.fGotoControl) and Assigned(C.PP.fGotoControl)
{$ENDIF} {$ENDIF}
and C.PP.fGotoControl( @Self, Msg.wParam, and C.PP.fGotoControl( @Self, Msg.wParam,
(Msg.message <> WM_KEYDOWN) and (Msg.message <> WM_KEYDOWN) and
(Msg.message <> WM_SYSKEYDOWN) ) then (Msg.message <> WM_SYSKEYDOWN) ) then
begin begin
Msg.wParam := 0; Msg.wParam := 0;
Result := 0; Result := 0;
end end
else Default; else Default;
end end
//+++++++++++++++++++++++++++++++++++++++++++++// //+++++++++++++++++++++++++++++++++++++++++++++//
else // else //
if Msg.wParam = 9 then // prevent system beep // if Msg.wParam = 9 then // prevent system beep //
begin // begin //
Msg.wParam := 0; // Msg.wParam := 0; //
Result := 0; // Result := 0; //
end // end //
//+++++++++++++++++++++++++++++++++++++++++++++// //+++++++++++++++++++++++++++++++++++++++++++++//
else Default; else Default;
@ -41192,8 +41203,8 @@ begin
end; end;
end; end;
{$ENDIF ASM_VERSION} {$ENDIF ASM_VERSION}
{$ENDIF WIN_GDI} {$ENDIF WIN_GDI}
{$IFDEF ASM_VERSION}{$ELSE ASM_VERSION} //Pascal {$IFDEF ASM_VERSION}{$ELSE ASM_VERSION} //Pascal
function GetPrevCtrlBoundsRect( P: PControl; var R: TRect ): Boolean; function GetPrevCtrlBoundsRect( P: PControl; var R: TRect ): Boolean;
var Idx: Integer; var Idx: Integer;
@ -41366,17 +41377,18 @@ begin
begin begin
{$IFDEF KEY_PREVIEW} {$IFDEF KEY_PREVIEW}
//--------------------------------Truf------------------------------------- //--------------------------------Truf-------------------------------------
if ParentForm <> Self_ then F := ParentForm;
if F <> Self_ then
begin begin
if {$IFDEF USE_FLAGS} G6_KeyPreview in ParentForm.fFlagsG6 if {$IFDEF USE_FLAGS} G6_KeyPreview in F.fFlagsG6
{$ELSE} ParentForm.fKeyPreview {$ENDIF} then {$ELSE} F.fKeyPreview {$ENDIF} then
begin begin
{$IFDEF USE_FLAGS} {$IFDEF USE_FLAGS}
include( ParentForm.fFlagsG4, G4_Pushed ); include( F.fFlagsG4, G4_Pushed );
{$ELSE} ParentForm.fKeyPreviewing := TRUE; {$ENDIF} {$ELSE} F.fKeyPreviewing := TRUE; {$ENDIF}
inc( ParentForm.DF.fKeyPreviewCount ); inc( F.DF.fKeyPreviewCount );
ParentForm.Perform(WM_KEYDOWN,msg.wParam,msg.lParam); F.Perform(WM_KEYDOWN,msg.wParam,msg.lParam);
dec( ParentForm.DF.fKeyPreviewCount ); dec( F.DF.fKeyPreviewCount );
end; end;
end; end;
//--------------------------------Truf------------------------------------- //--------------------------------Truf-------------------------------------
@ -41384,28 +41396,32 @@ begin
{$IFDEF ESC_CLOSE_DIALOGS} {$IFDEF ESC_CLOSE_DIALOGS}
//---------------------------------Babenko Alexey-------------------------- //---------------------------------Babenko Alexey--------------------------
begin begin
if (Self_.ParentForm.fExStyle and WS_EX_DLGMODALFRAME) <> 0 then F := ParentForm;
if (F.fExStyle and WS_EX_DLGMODALFRAME) <> 0 then
if Msg.wParam = 27 then if Msg.wParam = 27 then
Self_.ParentForm.Perform(WM_CLOSE, 0, 0); F.Perform(WM_CLOSE, 0, 0);
end; end;
//---------------------------------Babenko Alexey-------------------------- //---------------------------------Babenko Alexey--------------------------
{$ENDIF ESC_CLOSE_DIALOGS} {$ENDIF ESC_CLOSE_DIALOGS}
end; end;
{$IFDEF KEY_PREVIEW} {$IFDEF KEY_PREVIEW}
WM_SYSKEYDOWN, WM_KEYUP..WM_SYSDEADCHAR:
WM_KEYUP, WM_SYSKEYUP, begin
WM_CHAR, WM_SYSCHAR: F := ParentForm;
if ParentForm <> Self_ then if F <> Self_ then
begin begin
if {$IFDEF USE_FLAGS} G6_KeyPreview in ParentForm.fFlagsG6 if {$IFDEF USE_FLAGS} G6_KeyPreview in F.fFlagsG6
{$ELSE} ParentForm.fKeyPreview {$ENDIF} then {$ELSE} F.fKeyPreview {$ENDIF} then
begin begin
{$IFDEF USE_FLAGS} {$IFDEF USE_FLAGS}
include( ParentForm.fFlagsG4, G4_Pushed ); include( F.fFlagsG4, G4_Pushed );
{$ELSE} ParentForm.fKeyPreviewing := TRUE; {$ENDIF} {$ELSE} F.fKeyPreviewing := TRUE; {$ENDIF}
ParentForm.Perform(Msg.message,msg.wParam,msg.lParam); inc( F.DF.fKeyPreviewCount );
F.Perform(Msg.message,msg.wParam,msg.lParam);
dec( F.DF.fKeyPreviewCount );
end; end;
end; end;
end;
{$ENDIF KEY_PREVIEW} {$ENDIF KEY_PREVIEW}
{$ENDIF KEY_PREVIEW_OR_ESC_CLOSE_DIALOGS} {$ENDIF KEY_PREVIEW_OR_ESC_CLOSE_DIALOGS}
end; end;
@ -63644,11 +63660,9 @@ begin
if Assigned( Ctl.EV.fOnEnter ) then if Assigned( Ctl.EV.fOnEnter ) then
{$ENDIF} {$ENDIF}
Ctl.EV.fOnEnter( Ctl ); Ctl.EV.fOnEnter( Ctl );
end; end;////////////////////////////////////////////////////////////////////////////
function NewGraphEditbox( AParent: PControl; Options: TEditOptions ): PControl; function NewGraphEditbox( AParent: PControl; Options: TEditOptions ): PControl;
begin begin {$IFDEF INPACKAGE}
{$IFDEF INPACKAGE}
Result := NewEditbox( AParent, Options ); Result := NewEditbox( AParent, Options );
{$ELSE} {$ELSE}
Result := _NewGraphCtl( AParent, TRUE, Result := _NewGraphCtl( AParent, TRUE,
@ -63664,33 +63678,24 @@ begin
Result.fLookTabKeys := [ tkTab, tkUpDown, tkPageUpPageDn ]; Result.fLookTabKeys := [ tkTab, tkUpDown, tkPageUpPageDn ];
Result.EV.fLeave := Result.LeaveGraphEdit; Result.EV.fLeave := Result.LeaveGraphEdit;
{$ENDIF} {$ENDIF}
end; end;////////////////////////////////////////////////////////////////////////////
{ TGraphicControl } { TGraphicControl }
function TControl.DoGraphCtlPrepaint: TRect; function TControl.DoGraphCtlPrepaint: TRect;
begin begin
Result := ClientRect; Result := ClientRect;
if not Assigned( EV.fOnPrepaint ) and not Transparent then if not Assigned( EV.fOnPrepaint ) and not Transparent then
begin begin if fBrush <> nil then
if fBrush <> nil then
Canvas.Brush.Assign( fBrush ) Canvas.Brush.Assign( fBrush )
else else Canvas.Brush.Color := Color;
Canvas.Brush.Color := Color;
Canvas.FillRect( Result ); Canvas.FillRect( Result );
end; end;
end; end;////////////////////////////////////////////////////////////////////////////
procedure TControl.GraphicLabelPaint(DC: HDC); procedure TControl.GraphicLabelPaint(DC: HDC);
var R: TRect; var R: TRect;
begin begin R := DoGraphCtlPrepaint;
R := DoGraphCtlPrepaint; if Text <> '' then DrawFormattedText( @ Self, DC, R, 0 );
if Text <> '' then end;////////////////////////////////////////////////////////////////////////////
DrawFormattedText( @ Self, DC, R, 0 );
//SaveImg( Canvas, R, 'bm09.bmp' );
//sv1 := FALSE;
end;
procedure TControl.GraphicCheckBoxPaint(DC: HDC); procedure TControl.GraphicCheckBoxPaint(DC: HDC);
var R, R1: TRect; var R, R1: TRect;
Flag: DWORD; Flag: DWORD;

View File

@ -2,10 +2,10 @@ unit KOLDirDlgEx;
interface interface
uses Windows, Messages, KOL {$IFDEF USE_GRUSH}, ToGrush, KOLGRushControls {$ENDIF}; uses
Windows, Messages, KOL {$IFDEF USE_GRUSH}, ToGrush, KOLGRushControls {$ENDIF};
{$I KOLDEF.INC} {$I KOLDEF.INC}
{$I DELPHIDEF.INC}
{$IFDEF EXTERNAL_DEFINES} {$IFDEF EXTERNAL_DEFINES}
{$INCLUDE EXTERNAL_DEFINES.INC} {$INCLUDE EXTERNAL_DEFINES.INC}

View File

@ -1,6 +1,6 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// KOL_ASM.inc ()to be inlude in KOL.pas) // KOL_ASM.inc ()to be inlude in KOL.pas)
// v 3.00.z // v 3.00.z6
function MsgBox( const S: KOLString; Flags: DWORD ): DWORD; function MsgBox( const S: KOLString; Flags: DWORD ): DWORD;
asm asm
@ -8911,7 +8911,12 @@ function TControl.GetCanvas: PCanvas;
asm asm
PUSH EBX PUSH EBX
PUSH ESI PUSH ESI
{$IFDEF SAFE_CODE}
MOV EBX, EAX
CALL CreateWindow
{$ELSE}
XCHG EBX, EAX XCHG EBX, EAX
{$ENDIF}
MOV ESI, [EBX].fCanvas MOV ESI, [EBX].fCanvas
TEST ESI, ESI TEST ESI, ESI
@ -14816,6 +14821,6 @@ asm
POP EDI POP EDI
end; end;
{$ENDIF} //{$ENDIF}
//======================================== THE END OF FILE KOL_ASM.inc //======================================== THE END OF FILE KOL_ASM.inc