mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 16:39:15 +02:00
added void check
git-svn-id: trunk@9485 -
This commit is contained in:
parent
ef127c3bc4
commit
cb1741aade
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -2417,6 +2417,8 @@ lcl/tests/test4_1synedit.lpi svneol=native#text/plain
|
|||||||
lcl/tests/test4_1synedit.lpr svneol=native#text/plain
|
lcl/tests/test4_1synedit.lpr svneol=native#text/plain
|
||||||
lcl/tests/test4_2pagecontrol.lpi svneol=native#text/plain
|
lcl/tests/test4_2pagecontrol.lpi svneol=native#text/plain
|
||||||
lcl/tests/test4_2pagecontrol.lpr svneol=native#text/plain
|
lcl/tests/test4_2pagecontrol.lpr svneol=native#text/plain
|
||||||
|
lcl/tests/test4_3listview.lpi svneol=native#text/plain
|
||||||
|
lcl/tests/test4_3listview.lpr svneol=native#text/plain
|
||||||
lcl/tests/test5_1asyncprocess.lpi svneol=native#text/plain
|
lcl/tests/test5_1asyncprocess.lpi svneol=native#text/plain
|
||||||
lcl/tests/test5_1asyncprocess.lpr svneol=native#text/plain
|
lcl/tests/test5_1asyncprocess.lpr svneol=native#text/plain
|
||||||
lcl/tests/test5_1worker.pas svneol=native#text/plain
|
lcl/tests/test5_1worker.pas svneol=native#text/plain
|
||||||
|
@ -144,7 +144,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
// transform TypeData into a ProcHead String
|
// transform TypeData into a ProcHead String
|
||||||
ParamCount:=TypeData^.ParamCount;
|
ParamCount:=TypeData^.ParamCount;
|
||||||
//DebugLn('TEventsCodeTool.MethodTypeDataToStr A ParamCount=',ParamCount);
|
//DebugLn(['TEventsCodeTool.MethodTypeDataToStr A ParamCount=',ParamCount]);
|
||||||
Offset:=0;
|
Offset:=0;
|
||||||
if ParamCount>0 then begin
|
if ParamCount>0 then begin
|
||||||
Result:=Result+'(';
|
Result:=Result+'(';
|
||||||
@ -202,7 +202,7 @@ begin
|
|||||||
SetLength(ResultType,Len);
|
SetLength(ResultType,Len);
|
||||||
Move(TypeData^.ParamList[Offset],ResultType[1],Len);
|
Move(TypeData^.ParamList[Offset],ResultType[1],Len);
|
||||||
inc(Offset,Len);
|
inc(Offset,Len);
|
||||||
if ResultType<>'' then
|
if (ResultType<>'') and (IsIdentStartChar[ResultType[1]]) then // e.g. $void
|
||||||
Result:=Result+':'+ResultType;
|
Result:=Result+':'+ResultType;
|
||||||
end;
|
end;
|
||||||
if phpInUpperCase in Attr then Result:=UpperCaseStr(Result);
|
if phpInUpperCase in Attr then Result:=UpperCaseStr(Result);
|
||||||
@ -610,6 +610,7 @@ begin
|
|||||||
// check if method definition already exists in class
|
// check if method definition already exists in class
|
||||||
if UseTypeInfoForParameters then begin
|
if UseTypeInfoForParameters then begin
|
||||||
// do not lookup the declaration in the source
|
// do not lookup the declaration in the source
|
||||||
|
|
||||||
ATypeData:=GetTypeData(ATypeInfo);
|
ATypeData:=GetTypeData(ATypeInfo);
|
||||||
if ATypeData=nil then exit(false);
|
if ATypeData=nil then exit(false);
|
||||||
CleanMethodDefinition:=UpperCaseStr(AMethodName)
|
CleanMethodDefinition:=UpperCaseStr(AMethodName)
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
</General>
|
</General>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
|
@ -1207,20 +1207,22 @@ end;
|
|||||||
|
|
||||||
class procedure TGtk2WSCustomListView.SetViewStyle(const ALV: TCustomListView;
|
class procedure TGtk2WSCustomListView.SetViewStyle(const ALV: TCustomListView;
|
||||||
const Avalue: TViewStyle);
|
const Avalue: TViewStyle);
|
||||||
procedure ShowColumns(const Widgets: PTVWidgets; const Show: Boolean);
|
|
||||||
var
|
procedure ShowColumns(const Widgets: PTVWidgets; const Show: Boolean);
|
||||||
GtkColumn: PGtkTreeViewColumn;
|
var
|
||||||
i: Integer;
|
GtkColumn: PGtkTreeViewColumn;
|
||||||
begin
|
i: Integer;
|
||||||
for i := 1 to TLVHack(ALV).Columns.Count-1 do begin
|
begin
|
||||||
GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), i);
|
for i := 1 to TLVHack(ALV).Columns.Count-1 do begin
|
||||||
if not(Show)
|
GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), i);
|
||||||
or (Show and (ptrint(g_object_get_data(G_OBJECT(GtkColumn), PChar('Visible')))<>0))
|
if not (Show)
|
||||||
then
|
or (Show and (PtrInt(g_object_get_data(G_OBJECT(GtkColumn),
|
||||||
gtk_tree_view_column_set_visible(GtkColumn, Show);
|
PChar('Visible')))<>0))
|
||||||
end;
|
then
|
||||||
|
gtk_tree_view_column_set_visible(GtkColumn, Show);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
|
||||||
var
|
var
|
||||||
Widgets: PTVWidgets;
|
Widgets: PTVWidgets;
|
||||||
begin
|
begin
|
||||||
@ -1238,7 +1240,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
vsReport:
|
vsReport:
|
||||||
begin
|
begin
|
||||||
if TLVHack(ALV).ShowColumnHeaders = True then gtk_tree_view_set_headers_visible(GTK_TREE_VIEW (MainView), True);
|
if TLVHack(ALV).ShowColumnHeaders = True then
|
||||||
|
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW (MainView), True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
49
lcl/tests/test4_3listview.lpi
Normal file
49
lcl/tests/test4_3listview.lpi
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=""/>
|
||||||
|
<Title Value="test4_1synedit"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="SynEdit"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="1">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="test4_3listview.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="test4_3listview"/>
|
||||||
|
</Unit0>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<SearchPaths>
|
||||||
|
<LCLWidgetType Value="gtk2"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
</CONFIG>
|
85
lcl/tests/test4_3listview.lpr
Normal file
85
lcl/tests/test4_3listview.lpr
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
*****************************************************************************
|
||||||
|
* *
|
||||||
|
* This file is part of the Lazarus Component Library (LCL) *
|
||||||
|
* *
|
||||||
|
* See the file COPYING.LCL, included in this distribution, *
|
||||||
|
* for details about the copyright. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* *
|
||||||
|
*****************************************************************************
|
||||||
|
|
||||||
|
LCL Test 4_3
|
||||||
|
|
||||||
|
Showing a TListView.
|
||||||
|
}
|
||||||
|
program test4_3listview;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces, FPCAdds, LCLProc, LCLType, Classes, Controls, Forms, TypInfo,
|
||||||
|
LMessages, Buttons, ExtCtrls, ComCtrls, SynEdit, SynHighlighterPas,
|
||||||
|
Graphics;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
ListView1: TListView;
|
||||||
|
procedure Form1Create(Sender: TObject);
|
||||||
|
public
|
||||||
|
constructor Create(TheOwner: TComponent); override;
|
||||||
|
procedure AddListViewItem(const ACaption, SomeSubItems: string);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.Form1Create(Sender: TObject);
|
||||||
|
begin
|
||||||
|
debugln('TForm1.Form1Create ',DbgSName(Sender));
|
||||||
|
SetBounds(50,50,500,400);
|
||||||
|
|
||||||
|
ListView1:=TListView.Create(Self);
|
||||||
|
with ListView1 do begin
|
||||||
|
Name:='ListView1';
|
||||||
|
Align:=alTop;
|
||||||
|
Height:=200;
|
||||||
|
Parent:=Self;
|
||||||
|
ViewStyle:=vsReport;
|
||||||
|
end;
|
||||||
|
ListView1.Columns.Add.Caption:='Name';
|
||||||
|
ListView1.Columns.Add.Caption:='Column 2';
|
||||||
|
ListView1.Columns.Add.Caption:='Column 3';
|
||||||
|
AddListViewItem('First','A1'+LineEnding+'A2');
|
||||||
|
AddListViewItem('Second','B1'+LineEnding+'B2');
|
||||||
|
AddListViewItem('Third','C1'+LineEnding+'C2');
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TForm1.Create(TheOwner: TComponent);
|
||||||
|
begin
|
||||||
|
OnCreate:=@Form1Create;
|
||||||
|
inherited Create(TheOwner);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.AddListViewItem(const ACaption, SomeSubItems: string);
|
||||||
|
var
|
||||||
|
NewItem: TListItem;
|
||||||
|
begin
|
||||||
|
NewItem:=ListView1.Items.Add;
|
||||||
|
NewItem.Caption:=ACaption;
|
||||||
|
NewItem.SubItems.Text:=SomeSubItems;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1 = nil;
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1,Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user