LCL: add posibility to crDefault to have zero handle

Qt: fix controls default cursor (it was Arrow and now it is default control cursor) issue #0009200 

git-svn-id: trunk@11900 -
This commit is contained in:
paul 2007-09-01 13:09:20 +00:00
parent d32def858a
commit fa4fffcebe
5 changed files with 5 additions and 33 deletions

View File

@ -320,10 +320,8 @@ begin
if AIndex < crLow then Exit;
// not yet loaded
if AIndex = crNone then
Result := Result;
Result := WidgetSet.CreateStandardCursor(AIndex);
if Result = 0 then
if (Result = 0) and (AIndex <> crDefault) then
Result := LoadCursorFromLazarusResource('cur_' + IntToStr(-AIndex));
if Result = 0 then
Exit;

View File

@ -45,7 +45,6 @@ begin
// TODO: map is better
case TCursor(ACursor) of
crDefault : CursorShape := QtArrowCursor;
crNone : CursorShape := QtBlankCursor;
crArrow : CursorShape := QtArrowCursor;
crCross : CursorShape := QtCrossCursor;

View File

@ -1812,7 +1812,9 @@ end;
procedure TQtWidget.SetCursor(const ACursor: QCursorH);
begin
if ACursor <> nil then
QWidget_setCursor(Widget, ACursor);
QWidget_setCursor(Widget, ACursor)
else
QWidget_unsetCursor(Widget);
end;
{------------------------------------------------------------------------------

View File

@ -3031,29 +3031,7 @@ begin
// Here we should convert top level lcl window coordinaties to qt coord
// Due to borders and etc
{ Style := Windows.GetWindowLong(Handle, GWL_STYLE);
ExStyle := Windows.GetWindowLong(Handle, GWL_EXSTYLE);
if (Style and WS_THICKFRAME) <> 0 then
begin
// thick, sizing border
// add twice, top+bottom border
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXSIZEFRAME));
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYSIZEFRAME));
end else
if (Style and WS_BORDER) <> 0 then
begin
// thin, non-sizing border
Dec(Width, 2*Windows.GetSystemMetrics(SM_CXFIXEDFRAME));
Dec(Height, 2*Windows.GetSystemMetrics(SM_CYFIXEDFRAME));
end;
if (Style and WS_CAPTION) <> 0 then
if (ExStyle and WS_EX_TOOLWINDOW) <> 0 then
Dec(Height, Windows.GetSystemMetrics(SM_CYSMCAPTION))
else
Dec(Height, Windows.GetSystemMetrics(SM_CYCAPTION));
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
AdjustForBuddySize;}
// ?
end;
function TQtWidgetSet.HideCaret(hWnd: HWND): Boolean;
@ -3211,9 +3189,6 @@ begin
TitleStr := UTF8Decode(lpCaption);
OkStr := UTF8Decode('Ok');
Result := QMessageBox_information(TQtWidget(hWnd).Widget, @Str, @TitleStr, @OkStr);
// {$ifdef VerboseQtWinAPI_MISSING_IMPLEMENTATION}
// WriteLn('***** [WinAPI TQtWidgetSet.MessageBox] missing implementation ');
// {$endif}
end;
{------------------------------------------------------------------------------

View File

@ -88,8 +88,6 @@ type
// class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
// class procedure SetText(const AWinControl: TWinControl; const AText: string); override;
class procedure SetChildZPosition(const AWinControl, AChild: TWinControl;
const AOldPos, ANewPos: Integer;
const AChildren: TFPList); override;