mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 22:47:09 +01:00
* added skeleton for colorsel I still had lying around, derived from IDE src. Should be possible to expand them based on PD C++ TV code?
git-svn-id: trunk@12305 -
This commit is contained in:
parent
87a6193f4f
commit
cba8503e2b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1700,6 +1700,7 @@ packages/fv/src/amismsg.inc svneol=native#text/plain
|
||||
packages/fv/src/app.pas svneol=native#text/plain
|
||||
packages/fv/src/asciitab.pas svneol=native#text/plain
|
||||
packages/fv/src/buildfv.pas svneol=native#text/plain
|
||||
packages/fv/src/colorsel.pas svneol=native#text/plain
|
||||
packages/fv/src/colortxt.pas svneol=native#text/plain
|
||||
packages/fv/src/dialogs.pas svneol=native#text/plain
|
||||
packages/fv/src/drivers.pas svneol=native#text/plain
|
||||
|
||||
204
packages/fv/src/colorsel.pas
Normal file
204
packages/fv/src/colorsel.pas
Normal file
@ -0,0 +1,204 @@
|
||||
{
|
||||
|
||||
(Still unused) skeleton for Colorsel replacement, based on mostly the
|
||||
use by the fpmopts.inc file, to be added on as details emerge.
|
||||
|
||||
Copyright 2008 by Marco van de Voort
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
****************************************************************************}
|
||||
|
||||
unit Colorsel;
|
||||
|
||||
interface
|
||||
|
||||
Uses Objects,Dialogs;
|
||||
|
||||
Type
|
||||
PColorItem = ^TColorItem;
|
||||
TColorItem = Record
|
||||
Next : PColorItem;
|
||||
Name : PString;
|
||||
Index: Longint;
|
||||
end;
|
||||
|
||||
PColorGroup = ^TColorGroup;
|
||||
TColorGroup = Record
|
||||
Next : PColorGroup;
|
||||
Name : PString;
|
||||
Index : Longint;
|
||||
Items : PColorItem;
|
||||
end;
|
||||
|
||||
PColorDialog = ^TColorDialog;
|
||||
TColorDialog = object(TDialog)
|
||||
constructor Init(APalette:integer;colGroup:PColorGroup); //
|
||||
constructor Load(var S: TStream);
|
||||
procedure Store(var S: TStream);
|
||||
end;
|
||||
|
||||
function ColorItem(Name:String;Index:integer;Item:PColorItem):PColorItem;
|
||||
function ColorGroup(Name:String;item:PColorItem;Group:PColorGroup):PColorGroup;
|
||||
|
||||
// function MenuColorItems(p:pointer):PColorItem; ??
|
||||
|
||||
procedure RegisterColorSel;
|
||||
|
||||
implementation
|
||||
|
||||
Uses fvconsts; // idcolordialog
|
||||
|
||||
function ColorItem(Name:String;index:integer;Item:PColorItem):PColorItem;
|
||||
|
||||
var p : PColorItem;
|
||||
begin
|
||||
new(p);
|
||||
new(p^.Name);
|
||||
p^.Name^:=Name;
|
||||
p^.index:=index;
|
||||
p^.next:=item;
|
||||
ColorItem:=p;
|
||||
end;
|
||||
|
||||
function ColorGroup(Name:String;item:PColorItem;Group:PColorGroup):PColorGroup;
|
||||
var p : PColorGroup;
|
||||
begin
|
||||
new(p);
|
||||
new(p^.Name);
|
||||
p^.Name^:=Name;
|
||||
p^.next:=group;
|
||||
p^.items:=item;
|
||||
ColorGroup:=p;
|
||||
end;
|
||||
|
||||
const
|
||||
RColorDialog: TStreamRec = (
|
||||
ObjType: idColorDialog;
|
||||
VmtLink: Ofs(TypeOf(TColorDialog)^);
|
||||
Load: @TColorDialog.Load;
|
||||
Store: @TColorDialog.Store
|
||||
);
|
||||
|
||||
|
||||
procedure RegisterColorsel;
|
||||
begin
|
||||
// according to help should register TColorSelector, TMonoSelector, TColorDisplay, TColorGroupList, TColorItemList, TColorDialog
|
||||
// probably don't bother with the mono variants. Except for (P/T)colordialog, these don't grep in FV/IDE src.
|
||||
|
||||
// TColorSelector -> the square colorselection widget (instantiated twice once for front, once for back?)
|
||||
// TColorGrouplist-> the selection of the color group (left list) (TListbox or whatever the TV eq is?)
|
||||
// TColorItemList -> the selection of the color identifier (right list) (TListbox or whatever the TV eq is?)
|
||||
|
||||
RegisterType(RColorDialog);
|
||||
end ;
|
||||
|
||||
|
||||
constructor TColorDialog.Init(APalette:integer;colGroup:PColorGroup);
|
||||
begin
|
||||
end;
|
||||
constructor TColorDialog.Load(var S: TStream);
|
||||
begin
|
||||
end;
|
||||
procedure TColorDialog.Store(var S: TStream);
|
||||
begin
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
{
|
||||
|
||||
|
||||
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
|
||||
ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
|
||||
ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
|
||||
|
||||
|
||||
from fpmopts.inc
|
||||
procedure TIDEApp.Colors;
|
||||
|
||||
var D: PColorDialog;
|
||||
begin
|
||||
New(D, Init(AppPalette,
|
||||
ColorGroup(label_colors_grp_browser,
|
||||
ColorItem(label_colors_framepassive , 215,
|
||||
ColorItem(label_colors_frameactive , 216,
|
||||
ColorItem(label_colors_frameicon , 217,
|
||||
ColorItem(label_colors_scrollbarpage , 218,
|
||||
ColorItem(label_colors_scrollbaricons , 219,
|
||||
ColorItem(label_colors_normaltext , 220,
|
||||
ColorItem(label_colors_selectedtext , 221,
|
||||
ColorItem(label_colors_activeitem , 222,
|
||||
ColorItem(label_colors_inactiveitem , 223,
|
||||
ColorItem(label_colors_focuseditem , 224,
|
||||
ColorItem(label_colors_selecteditem , 225,
|
||||
ColorItem(label_colors_divider , 226,
|
||||
nil)))))))))))),
|
||||
ColorGroup(label_colors_grp_clock,
|
||||
ColorItem(label_colors_clockview , 227,
|
||||
nil),
|
||||
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
|
||||
ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
|
||||
ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
|
||||
ColorGroup(label_colors_grp_editor,
|
||||
ColorItem(label_colors_framepassive , 167,
|
||||
ColorItem(label_colors_frameactive , 168,
|
||||
ColorItem(label_colors_frameicon , 169,
|
||||
ColorItem(label_colors_scrollbarpage , 170,
|
||||
ColorItem(label_colors_scrollbaricons , 171,
|
||||
ColorItem(label_colors_normaltext , 199,
|
||||
ColorItem(label_colors_selectedtext , 208,
|
||||
ColorItem(label_colors_highlighcolumn , 209,
|
||||
ColorItem(label_colors_highlightrow , 210,
|
||||
ColorItem(label_colors_errormessages , 214,
|
||||
nil)))))))))),
|
||||
ColorGroup(label_colors_grp_help,
|
||||
ColorItem(label_colors_framepassive , 128,
|
||||
ColorItem(label_colors_frameactive , 129,
|
||||
ColorItem(label_colors_frameicon , 130,
|
||||
ColorItem(label_colors_scrollbarpage , 131,
|
||||
ColorItem(label_colors_scrollbaricons , 132,
|
||||
ColorItem(label_colors_helptext , 160,
|
||||
ColorItem(label_colors_helplinks , 161,
|
||||
ColorItem(label_colors_selectedlink , 162,
|
||||
ColorItem(label_colors_selectedtext , 163,
|
||||
ColorItem(label_colors_html_heading1 , 229,
|
||||
ColorItem(label_colors_html_heading2 , 230,
|
||||
ColorItem(label_colors_html_heading3 , 231,
|
||||
ColorItem(label_colors_html_heading4 , 232,
|
||||
ColorItem(label_colors_html_heading5 , 233,
|
||||
ColorItem(label_colors_html_heading6 , 234,
|
||||
nil))))))))))))))),
|
||||
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
|
||||
ColorGroup(label_colors_grp_syntax,
|
||||
ColorItem(label_colors_whitespace , 200,
|
||||
ColorItem(label_colors_comments , 201,
|
||||
ColorItem(label_colors_reservedwords , 202,
|
||||
ColorItem(label_colors_identifiers , 203,
|
||||
ColorItem(label_colors_strings , 204,
|
||||
ColorItem(label_colors_numbers , 205,
|
||||
ColorItem(label_colors_hexnumbers , 212,
|
||||
ColorItem(label_colors_assembler , 206,
|
||||
ColorItem(label_colors_symbols , 207,
|
||||
ColorItem(label_colors_directives , 211,
|
||||
ColorItem(label_colors_tabs , 213,
|
||||
nil))))))))))),
|
||||
nil))))))))));
|
||||
end;
|
||||
|
||||
fvconsts.pas: idColorSelector = 92;
|
||||
fvconsts.pas: idMonoSelector = 93;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user