mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 10:18:05 +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_2pagecontrol.lpi 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.lpr svneol=native#text/plain
|
||||
lcl/tests/test5_1worker.pas svneol=native#text/plain
|
||||
|
@ -144,7 +144,7 @@ begin
|
||||
end;
|
||||
// transform TypeData into a ProcHead String
|
||||
ParamCount:=TypeData^.ParamCount;
|
||||
//DebugLn('TEventsCodeTool.MethodTypeDataToStr A ParamCount=',ParamCount);
|
||||
//DebugLn(['TEventsCodeTool.MethodTypeDataToStr A ParamCount=',ParamCount]);
|
||||
Offset:=0;
|
||||
if ParamCount>0 then begin
|
||||
Result:=Result+'(';
|
||||
@ -202,7 +202,7 @@ begin
|
||||
SetLength(ResultType,Len);
|
||||
Move(TypeData^.ParamList[Offset],ResultType[1],Len);
|
||||
inc(Offset,Len);
|
||||
if ResultType<>'' then
|
||||
if (ResultType<>'') and (IsIdentStartChar[ResultType[1]]) then // e.g. $void
|
||||
Result:=Result+':'+ResultType;
|
||||
end;
|
||||
if phpInUpperCase in Attr then Result:=UpperCaseStr(Result);
|
||||
@ -610,6 +610,7 @@ begin
|
||||
// check if method definition already exists in class
|
||||
if UseTypeInfoForParameters then begin
|
||||
// do not lookup the declaration in the source
|
||||
|
||||
ATypeData:=GetTypeData(ATypeInfo);
|
||||
if ATypeData=nil then exit(false);
|
||||
CleanMethodDefinition:=UpperCaseStr(AMethodName)
|
||||
|
@ -11,7 +11,6 @@
|
||||
</General>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
|
@ -1207,20 +1207,22 @@ end;
|
||||
|
||||
class procedure TGtk2WSCustomListView.SetViewStyle(const ALV: TCustomListView;
|
||||
const Avalue: TViewStyle);
|
||||
procedure ShowColumns(const Widgets: PTVWidgets; const Show: Boolean);
|
||||
var
|
||||
GtkColumn: PGtkTreeViewColumn;
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 1 to TLVHack(ALV).Columns.Count-1 do begin
|
||||
GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), i);
|
||||
if not(Show)
|
||||
or (Show and (ptrint(g_object_get_data(G_OBJECT(GtkColumn), PChar('Visible')))<>0))
|
||||
then
|
||||
gtk_tree_view_column_set_visible(GtkColumn, Show);
|
||||
end;
|
||||
|
||||
procedure ShowColumns(const Widgets: PTVWidgets; const Show: Boolean);
|
||||
var
|
||||
GtkColumn: PGtkTreeViewColumn;
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 1 to TLVHack(ALV).Columns.Count-1 do begin
|
||||
GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), i);
|
||||
if not (Show)
|
||||
or (Show and (PtrInt(g_object_get_data(G_OBJECT(GtkColumn),
|
||||
PChar('Visible')))<>0))
|
||||
then
|
||||
gtk_tree_view_column_set_visible(GtkColumn, Show);
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
var
|
||||
Widgets: PTVWidgets;
|
||||
begin
|
||||
@ -1238,7 +1240,8 @@ begin
|
||||
end;
|
||||
vsReport:
|
||||
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;
|
||||
|
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