mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
customdrawnws: Implements initial TProgressBar support
git-svn-id: trunk@33890 -
This commit is contained in:
parent
bf07765fd5
commit
0c2a036e9b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5471,6 +5471,7 @@ lcl/interfaces/customdrawn/customdrawnwinapi_win.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwinapi_x11.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwinapih.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwsarrow.pas svneol=native#text/plain
|
||||
lcl/interfaces/customdrawn/customdrawnwscomctrls.pas svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwscontrols.pp svneol=native#text/plain
|
||||
lcl/interfaces/customdrawn/customdrawnwscontrols_win.inc svneol=native#text/pascal
|
||||
lcl/interfaces/customdrawn/customdrawnwsfactory.pas svneol=native#text/pascal
|
||||
|
@ -3,18 +3,6 @@
|
||||
{$modeswitch objectivec1}
|
||||
{$endif}
|
||||
|
||||
{
|
||||
vm^^.GetEnv crashes HTC Wildfire, Alcatel and the Emulator for unknown reasons,
|
||||
see: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828/ef9077617794e0f5
|
||||
|
||||
This prevents using Pascal to Java calls completely in those platforms.
|
||||
To turn on a work around one can use CD_Android_DontUsePascalToJNI
|
||||
and then try to implement the missing functionality by other means.
|
||||
|
||||
Not that Java to Pascal calls always work
|
||||
}
|
||||
{$define CD_Android_DontUsePascalToJNI}
|
||||
|
||||
// For now default to Android for arm-linux,
|
||||
// because LCL-CustomDrawn is our main Android widgetset.
|
||||
// Remove this when Android gets it's own target
|
||||
|
@ -42,7 +42,7 @@ begin
|
||||
eventResult := 0;
|
||||
|
||||
{$ifdef VerboseCDEvents}
|
||||
__android_log_write(ANDROID_LOG_INFO,'lclproject',PChar(Format('LCLOnTouch called x=%f y=%f action=%d', [x, y, action])));
|
||||
__android_log_write(ANDROID_LOG_INFO,'lclapp',PChar(Format('LCLOnTouch called x=%f y=%f action=%d', [x, y, action])));
|
||||
{$endif}
|
||||
{ curJavaClass := env^^.GetObjectClass(env, this);
|
||||
__android_log_write(ANDROID_LOG_INFO,'nativetest','LCLOnTouch after GetObjectClass');}
|
||||
@ -134,13 +134,15 @@ function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint; cdecl;
|
||||
begin
|
||||
curVM:=vm;
|
||||
|
||||
{$ifndef CD_Android_DontUsePascalToJNI}
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', 'JNI_OnLoad called');
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', PChar(Format('CurVM=%x', [PtrInt(CurVM)])));
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', PChar(Format('CurVM^=%x', [PtrInt(CurVM^)])));
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', PChar(Format('CurVM^^.reserved0=%x', [PtrInt(CurVM^^.reserved0)])));
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', PChar(Format('CurVM^^.GetEnv=%x', [PtrInt(Pointer(@CurVM^^.GetEnv))])));
|
||||
|
||||
{
|
||||
vm^^.GetEnv crashes HTC Wildfire, Alcatel and the Emulator if you don't build your project with -CpARMV6
|
||||
see: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828/ef9077617794e0f5
|
||||
}
|
||||
if vm^^.GetEnv(curVM,@curEnv,JNI_VERSION_1_4)<>JNI_OK then
|
||||
begin
|
||||
__android_log_write(ANDROID_LOG_FATAL, 'lclapp', 'curVM^.GetEnv failed');
|
||||
@ -158,7 +160,7 @@ begin
|
||||
end;
|
||||
if curEnv^^.RegisterNatives(curEnv, curJavaClass, @NativeMethods[0],length(NativeMethods))<0 then
|
||||
begin
|
||||
__android_log_write(ANDROID_LOG_FATAL, 'nativetest', 'curEnv^.RegisterNatives failed');
|
||||
__android_log_write(ANDROID_LOG_FATAL, 'lclapp', 'curEnv^.RegisterNatives failed');
|
||||
result:=JNI_ERR;
|
||||
exit;
|
||||
end;
|
||||
@ -166,11 +168,10 @@ begin
|
||||
nativeCodeLoaded:=curEnv^^.GetFieldID(curEnv, curJavaClass, 'nativeCodeLoaded','J');
|
||||
if not assigned(nativeCodeLoaded) then
|
||||
begin
|
||||
__android_log_write(ANDROID_LOG_FATAL, 'nativetest', 'curEnv^.GetFieldID failed');
|
||||
__android_log_write(ANDROID_LOG_FATAL, 'lclapp', 'curEnv^.GetFieldID failed');
|
||||
result:=JNI_ERR;
|
||||
exit;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
result:=JNI_VERSION_1_4;// 1_6 is another option
|
||||
end;
|
||||
@ -181,7 +182,7 @@ end;
|
||||
|
||||
procedure TCDWidgetSet.AndroidDebugLn(AStr: string);
|
||||
begin
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclproject', PChar(AccumulatedStr+AStr));
|
||||
__android_log_write(ANDROID_LOG_INFO, 'lclapp', PChar(AccumulatedStr+AStr));
|
||||
AccumulatedStr := '';
|
||||
end;
|
||||
|
||||
|
@ -2746,7 +2746,7 @@ var
|
||||
lFormHandle: HWND;
|
||||
begin
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn(':>[WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
DebugLn(':>[WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
{$endif}
|
||||
|
||||
if HWnd = 0 then
|
||||
@ -2772,7 +2772,7 @@ begin
|
||||
Result := BackendGetDC(lFormHandle);
|
||||
|
||||
{$ifdef VerboseCDWinAPI}
|
||||
WriteLn(':<[WinAPI GetDC] Result: ', dbghex(Result));
|
||||
DebugLn(':<[WinAPI GetDC] Result: ', dbghex(Result));
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
|
2109
lcl/interfaces/customdrawn/customdrawnwscomctrls.pas
Normal file
2109
lcl/interfaces/customdrawn/customdrawnwscomctrls.pas
Normal file
File diff suppressed because it is too large
Load Diff
@ -101,8 +101,8 @@ uses
|
||||
CustomDrawnWSArrow,
|
||||
{ WinCEWSButtons,
|
||||
WinCEWSCalendar,
|
||||
WinCEWSCheckLst,
|
||||
WinCEWSComCtrls,}
|
||||
WinCEWSCheckLst,}
|
||||
CustomDrawnWSComCtrls,
|
||||
CustomDrawnWSControls,
|
||||
{ WinCEWSDialogs,
|
||||
WinCEWSExtCtrls,}
|
||||
@ -173,8 +173,8 @@ end;
|
||||
|
||||
function RegisterCustomProgressBar: Boolean; alias : 'WSRegisterCustomProgressBar';
|
||||
begin
|
||||
// RegisterWSComponent(TCustomProgressBar, TWinCEWSProgressBar);
|
||||
Result := False;
|
||||
RegisterWSComponent(TCustomProgressBar, TCDWSProgressBar);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function RegisterCustomUpDown: Boolean; alias : 'WSRegisterCustomUpDown';
|
||||
|
Loading…
Reference in New Issue
Block a user