IDE+IDEIntf+LCL: moved LCLPlatformDirNames to LCL interfacebase

git-svn-id: trunk@14469 -
This commit is contained in:
mattias 2008-03-08 18:58:36 +00:00
parent a2be38a14b
commit 3b5e8c18da
6 changed files with 56 additions and 64 deletions

View File

@ -35,7 +35,7 @@ interface
uses
Classes, SysUtils, AVL_Tree,
// LCL
LCLProc, Dialogs, FileUtil, Forms, Controls,
InterfaceBase, LCLProc, Dialogs, FileUtil, Forms, Controls,
// codetools
BasicCodeTools, CodeToolManager, DefineTemplates,
// IDEIntf

View File

@ -52,16 +52,6 @@ type
TLCLPlatforms = set of TLCLPlatform;
const
LCLPlatformDirNames: array[TLCLPlatform] of string = (
'gtk',
'gtk2',
'win32',
'wince',
'carbon',
'qt',
'fpgui',
'nogui'
);
LCLPlatformDisplayNames: array[TLCLPlatform] of string = (
'gtk',
'gtk 2 (beta)',

View File

@ -94,7 +94,8 @@ begin
Down := True;
AllowAllUp := True;
IDEImages.Images_16.GetBitmap(IDEImages.LoadImage(16, WidgetSetImageNames[P]), Glyph);
IDEImages.Images_16.GetBitmap(
IDEImages.LoadImage(16, 'issue_'+LCLPlatformDirNames[P]), Glyph);
ShowHint := True;
Hint := LCLPlatformDisplayNames[P];
OnClick := @NameFilterEditChange;
@ -236,7 +237,8 @@ begin
begin
ID := PtrInt(Issues.Objects[I]);
ImageIndex := IDEImages.LoadImage(16, WidgetSetImageNames[FIssueList[ID].WidgetSet]);
ImageIndex := IDEImages.LoadImage(16,
'issue_'+LCLPlatformDirNames[FIssueList[ID].WidgetSet]);
StateIndex := ImageIndex;
SelectedIndex := ImageIndex;

View File

@ -37,7 +37,8 @@ interface
uses
InterfaceBase, Forms, SysUtils, Buttons, Types, Classes, Graphics, GraphType,
StdCtrls, LCLType, LCLIntf, LCLProc, Controls, ComCtrls, ExtCtrls, TypInfo,
LMessages, LResources, LazConfigStorage, Menus, Dialogs, ObjInspStrConsts,
LMessages, LResources, LazConfigStorage, Menus, Dialogs,
ObjInspStrConsts,
PropEdits, GraphPropEdits, ListViewPropEdit, ImageListEditor,
ComponentTreeView, ComponentEditors, IDEImagesIntf;
@ -567,9 +568,9 @@ type
DeletePopupmenuItem: TMenuItem;
EventGrid: TOICustomPropertyGrid;
FavouriteGrid: TOICustomPropertyGrid;
IssuesGrid: TOICustomPropertyGrid;
IssuesPanel: TPanel;
IssuesInnerPanel: TPanel;
RestrictedGrid: TOICustomPropertyGrid;
RestrictedPanel: TPanel;
RestrictedInnerPanel: TPanel;
WidgetSetsIssuesLabel: TLabel;
WidgetSetsIssuesBox: TPaintBox;
ComponentIssuesLabel: TLabel;
@ -608,7 +609,7 @@ type
procedure OnShowOptionsPopupMenuItemClick(Sender: TObject);
procedure OnShowComponentTreePopupMenuItemClick(Sender: TObject);
procedure OnMainPopupMenuPopup(Sender: TObject);
procedure IssuePageShow(Sender: TObject);
procedure RestrictedPageShow(Sender: TObject);
procedure WidgetSetIssuesPaint(Sender: TObject);
procedure ComponentIssuesPaint(Sender: TObject);
procedure DoUpdateIssues;
@ -722,36 +723,22 @@ const
'PropertyPage',
'EventPage',
'FavouritePage',
'IssuesPage'
'RestrictedPage'
);
DefaultOIGridNames: array[TObjectInspectorPage] of shortstring = (
'PropertyGrid',
'EventGrid',
'FavouriteGrid',
'IssuesGrid'
'RestrictedGrid'
);
function CompareOIFavouriteProperties(Data1, Data2: Pointer): integer;
const
WidgetSetImageNames: array [TLCLPlatform] of shortstring = (
'issue_gtk',
'issue_gtk2',
'issue_win32',
'issue_wince',
'issue_carbon',
'issue_qt',
'issue_fpgui',
'issue_nogui'
);
//******************************************************************************
implementation
const
ScrollBarWidth=0;
@ -2262,7 +2249,8 @@ begin
if Platform in CurRow.FWidgetSets then
begin
Dec(X, IDEImages.Images_16.Width);
IDEImages.Images_16.Draw(Canvas, X, Y, IDEImages.LoadImage(16, WidgetSetImageNames[Platform]));
IDEImages.Images_16.Draw(Canvas, X, Y,
IDEImages.LoadImage(16, 'issue_'+LCLPlatformDirNames[Platform]));
end;
end;
Font:=OldFont;
@ -3355,7 +3343,7 @@ begin
if FIssues = AValue then exit;
//DebugLn('TObjectInspectorDlg.SetIssues Count: ', DbgS(AValue.Count));
FIssues := AValue;
IssuesGrid.Favourites := FIssues;
RestrictedGrid.Favourites := FIssues;
end;
procedure TObjectInspectorDlg.SetOnShowOptions(const AValue: TNotifyEvent);
@ -3460,7 +3448,7 @@ begin
0: Result:=PropertyGrid;
1: Result:=EventGrid;
2: Result:=FavouriteGrid;
3: Result:=IssuesGrid;
3: Result:=RestrictedGrid;
end;
end;
@ -3800,9 +3788,9 @@ begin
NoteBook.Page[3].TabVisible := AValue;
end;
procedure TObjectInspectorDlg.IssuePageShow(Sender: TObject);
procedure TObjectInspectorDlg.RestrictedPageShow(Sender: TObject);
begin
//DebugLn('IssuePageShow');
//DebugLn('RestrictedPageShow');
DoUpdateIssues;
end;
@ -3824,7 +3812,7 @@ begin
begin
None := False;
IDEImages.Images_16.Draw(WidgetSetsIssuesBox.Canvas, X, Y,
IDEImages.LoadImage(16, WidgetSetImageNames[Platform]));
IDEImages.LoadImage(16, 'issue_'+LCLPlatformDirNames[Platform]));
Inc(X, 16);
S := WidgetSetsIssuesBox.Canvas.TextExtent(IntToStr(Issues.WidgetSetRestrictions[Platform]));
@ -3876,7 +3864,7 @@ begin
begin
None := False;
IDEImages.Images_16.Draw(WidgetSetsIssuesBox.Canvas, X, Y,
IDEImages.LoadImage(16, WidgetSetImageNames[Platform]));
IDEImages.LoadImage(16, 'issue_'+LCLPlatformDirNames[Platform]));
Inc(X, 16);
S := ComponentIssuesBox.Canvas.TextExtent(IntToStr(WidgetSetRestrictions[Platform]));
@ -3913,7 +3901,7 @@ begin
FreeAndNil(PropertyGrid);
FreeAndNil(EventGrid);
FreeAndNil(FavouriteGrid);
FreeAndNil(IssuesGrid);
FreeAndNil(RestrictedGrid);
FreeAndNil(NoteBook);
end;
@ -3940,10 +3928,10 @@ begin
Page[2].Name:=DefaultOIPageNames[oipgpFavourite];
Page[2].TabVisible := ShowFavorites;
Pages.Add(oisIssues);
Pages.Add(oisRestricted);
Page[3].Name:=DefaultOIPageNames[oipgpRestricted];
Page[3].TabVisible := ShowIssues;
Page[3].OnShow := @IssuePageShow;
Page[3].OnShow := @RestrictedPageShow;
PageIndex:=0;
PopupMenu:=MainPopupMenu;
@ -4006,12 +3994,12 @@ begin
FavouriteGrid.Favourites:=FFavourites;
// issues grid
IssuesGrid:=TOICustomPropertyGrid.CreateWithParams(Self,PropertyEditorHook,
RestrictedGrid:=TOICustomPropertyGrid.CreateWithParams(Self,PropertyEditorHook,
[tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod
, tkSString, tkLString, tkAString, tkWString, tkVariant
{, tkArray, tkRecord, tkInterface}, tkClass, tkObject, tkWChar, tkBool
, tkInt64, tkQWord],FDefaultItemHeight);
with IssuesGrid do begin
with RestrictedGrid do begin
Name:=DefaultOIGridNames[oipgpRestricted];
Selection:=Self.FSelection;
Align:=alClient;
@ -4024,30 +4012,30 @@ begin
Parent:=NoteBook.Page[3];
end;
IssuesPanel := TPanel.Create(Self);
with IssuesPanel do
RestrictedPanel := TPanel.Create(Self);
with RestrictedPanel do
begin
Align := alTop;
BevelOuter := bvNone;
Parent := NoteBook.Page[3];
end;
IssuesInnerPanel := TPanel.Create(Self);
with IssuesInnerPanel do
RestrictedInnerPanel := TPanel.Create(Self);
with RestrictedInnerPanel do
begin
BevelOuter := bvNone;
BorderSpacing.Around := 6;
Parent := IssuesPanel;
Parent := RestrictedPanel;
end;
WidgetSetsIssuesLabel := TLabel.Create(Self);
with WidgetSetsIssuesLabel do
begin
Caption := oisWidgetSetIssues;
Caption := oisWidgetSetRestrictions;
Top := 1;
Align := alTop;
AutoSize := True;
Parent := IssuesInnerPanel;
Parent := RestrictedInnerPanel;
end;
WidgetSetsIssuesBox := TPaintBox.Create(Self);
@ -4057,17 +4045,17 @@ begin
Align := alTop;
Height := 24;
OnPaint := @WidgetSetIssuesPaint;
Parent := IssuesInnerPanel;
Parent := RestrictedInnerPanel;
end;
ComponentIssuesLabel := TLabel.Create(Self);
with ComponentIssuesLabel do
begin
Caption := oisComponentIssues;
Caption := oisComponentRestrictions;
Top := 3;
Align := alTop;
AutoSize := True;
Parent := IssuesInnerPanel;
Parent := RestrictedInnerPanel;
end;
ComponentIssuesBox := TPaintBox.Create(Self);
@ -4077,11 +4065,11 @@ begin
Align := alTop;
Height := 24;
OnPaint := @ComponentIssuesPaint;
Parent := IssuesInnerPanel;
Parent := RestrictedInnerPanel;
end;
IssuesInnerPanel.AutoSize := True;
IssuesPanel.AutoSize := True;
RestrictedInnerPanel.AutoSize := True;
RestrictedPanel.AutoSize := True;
end;
procedure TObjectInspectorDlg.KeyDown(var Key: Word; Shift: TShiftState);
@ -4188,7 +4176,7 @@ begin
case Page of
oipgpFavourite: Result:=FavouriteGrid;
oipgpEvents: Result:=EventGrid;
oipgpRestricted: Result:=IssuesGrid;
oipgpRestricted: Result:=RestrictedGrid;
else Result:=PropertyGrid;
end;
end;

View File

@ -44,10 +44,10 @@ resourcestring
oisProperties='Properties';
oisEvents='Events';
oisFavorites = 'Favorites';
oisIssues = 'Issues';
oisRestricted = 'Restricted';
oisWidgetSetIssues = 'General Widget Set issues: ';
oisComponentIssues = 'Component issues: ';
oisWidgetSetRestrictions = 'General widget set restrictions: ';
oisComponentRestrictions = 'Component restrictions: ';
//Object Inspector Popup Menu

View File

@ -112,6 +112,18 @@ type
end;
TWidgetSetClass = class of TWidgetSet;
const
LCLPlatformDirNames: array[TLCLPlatform] of string = (
'gtk',
'gtk2',
'win32',
'wince',
'carbon',
'qt',
'fpgui',
'nogui'
);
type
EInterfaceException = class(Exception);
EInterfaceError = class(EInterfaceException);