Ignore:
Timestamp:
Jul 7, 2010, 1:44:28 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Sortable grids, fixed hint-bug

Location:
cprs/branches/GUI-config
Files:
11 added
16 edited
4 moved

Legend:

Unmodified
Added
Removed
  • cprs/branches/GUI-config/FMErrorU.dfm

    r542 r828  
    1212  Font.Style = []
    1313  OldCreateOrder = False
     14  Position = poOwnerFormCenter
    1415  DesignSize = (
    1516    474
  • cprs/branches/GUI-config/GUI_Config.dsk

    r756 r828  
    11[Closed Files]
    2 File_0=SourceModule,'P:\vista\GUI-config\PostU.pas',0,1,34,62,10,0,0
    3 File_1=SourceModule,'P:\vista\GUI-config\SkinFormU.pas',0,1,87,16,95,0,0
    4 File_2=SourceModule,'P:\Vista\GUI-config\CPRS-Lib\ORNet.pas',0,1,1,1,310,0,0
    5 File_3=SourceModule,'c:\program files\borland\delphi7\source\vcl\OleCtrls.pas',0,1,85,27,96,0,0
    6 File_4=SourceModule,'P:\vista\GUI-config\BDK32\Source\ccowrpcbroker.pas',0,1,44,29,45,0,0
    7 File_5=SourceModule,'P:\vista\GUI-config\BDK32\Source\VERGENCECONTEXTORLib_TLB.pas',0,1,1104,11,1110,0,0
    8 File_6=SourceModule,'P:\vista\GUI-config\BDK32\Source\TRPCB.pas',0,1,1045,1,1059,0,0
    9 File_7=SourceModule,'P:\vista\GUI-config\CreateTemplateU.pas',0,1,140,11,145,0,0
    10 File_8=SourceModule,'P:\vista\GUI-config\SetSelU.pas',0,1,1,1,1,1,0
     2File_0=SourceModule,'P:\vista\GUI-config\MainU.dfm',0,1,1,1,1,0,0
     3File_1=SourceModule,'P:\Vista\GUI-config\CPRS-Lib\ORCtrls.pas',0,1,293,1,305,0,0
     4File_2=SourceModule,'P:\Vista\GUI-config\CPRS-Lib\ORFn.pas',0,1,613,1,623,0,0
     5File_3=SourceModule,'P:\vista\GUI-config\BDK32\Source\wsockc.pas',0,1,1333,1,1346,0,0
     6File_4=SourceModule,'P:\vista\GUI-config\PostU.pas',0,1,34,62,10,0,0
     7File_5=SourceModule,'P:\vista\GUI-config\SkinFormU.pas',0,1,87,16,95,0,0
     8File_6=SourceModule,'P:\Vista\GUI-config\CPRS-Lib\ORNet.pas',0,1,1,1,310,0,0
     9File_7=SourceModule,'c:\program files\borland\delphi7\source\vcl\OleCtrls.pas',0,1,85,27,96,0,0
     10File_8=SourceModule,'P:\vista\GUI-config\BDK32\Source\ccowrpcbroker.pas',0,1,44,29,45,0,0
     11File_9=SourceModule,'P:\vista\GUI-config\BDK32\Source\VERGENCECONTEXTORLib_TLB.pas',0,1,1104,11,1110,0,0
    1112
    1213[Modules]
    1314Module0=P:\vista\GUI-config\MainU.pas
    14 Module1=P:\Vista\GUI-config\CPRS-Lib\ORFn.pas
     15Module1=P:\vista\GUI-config\FMErrorU.pas
    1516Module2=P:\vista\GUI-config\GUI_Config.dpr
    16 Module3=P:\vista\GUI-config\AboutU.pas
    17 Module4=P:\vista\GUI-config\frmSplash.pas
    18 Module5=P:\vista\GUI-config\BDK32\Source\wsockc.pas
    19 Count=6
     17Module3=P:\vista\GUI-config\frmSplash.pas
     18Module4=P:\vista\GUI-config\AboutU.pas
     19Module5=P:\vista\GUI-config\LookupU.pas
     20Module6=P:\vista\GUI-config\DebugU.pas
     21Count=7
    2022EditWindowCount=1
    2123
     
    2325ModuleType=SourceModule
    2426FormState=1
    25 FormOnTop=0
    26 
    27 [P:\Vista\GUI-config\CPRS-Lib\ORFn.pas]
     27FormOnTop=1
     28
     29[P:\vista\GUI-config\FMErrorU.pas]
     30ModuleType=SourceModule
     31FormState=1
     32FormOnTop=0
     33
     34[P:\vista\GUI-config\GUI_Config.dpr]
    2835ModuleType=SourceModule
    2936FormState=0
    3037FormOnTop=0
    3138
    32 [P:\vista\GUI-config\GUI_Config.dpr]
     39[P:\vista\GUI-config\frmSplash.pas]
    3340ModuleType=SourceModule
    3441FormState=0
     
    3744[P:\vista\GUI-config\AboutU.pas]
    3845ModuleType=SourceModule
    39 FormState=1
    40 FormOnTop=0
    41 
    42 [P:\vista\GUI-config\frmSplash.pas]
    43 ModuleType=SourceModule
    44 FormState=1
    45 FormOnTop=0
    46 
    47 [P:\vista\GUI-config\BDK32\Source\wsockc.pas]
     46FormState=0
     47FormOnTop=0
     48
     49[P:\vista\GUI-config\LookupU.pas]
     50ModuleType=SourceModule
     51FormState=0
     52FormOnTop=0
     53
     54[P:\vista\GUI-config\DebugU.pas]
    4855ModuleType=SourceModule
    4956FormState=0
     
    5562
    5663[EditWindow0]
    57 ViewCount=6
     64ViewCount=7
    5865CurrentView=0
    5966View0=0
     
    6370View4=4
    6471View5=5
     72View6=6
    6573CodeExplorer=CodeExplorer@EditWindow0
    6674MessageView=MessageView@EditWindow0
    6775Create=1
    6876Visible=1
    69 State=0
    70 Left=167
    71 Top=159
    72 Width=775
    73 Height=552
    74 MaxLeft=-782
    75 MaxTop=261
    76 ClientWidth=767
    77 ClientHeight=518
     77State=2
     78Left=440
     79Top=155
     80Width=584
     81Height=330
     82MaxLeft=-4
     83MaxTop=104
     84MaxWidth=1032
     85MaxHeight=634
     86ClientWidth=1024
     87ClientHeight=600
    7888LeftPanelSize=0
    7989LeftPanelClients=CodeExplorer@EditWindow0
    8090LeftPanelData=00000400010000000C000000436F64654578706C6F726572000000000000000000000000000000000001000000000000000000000000FFFFFFFF
    8191RightPanelSize=0
    82 BottomPanelSize=155
     92BottomPanelSize=0
    8393BottomPanelClients=MessageView@EditWindow0
    84 BottomPanelData=0000040000000000FF02000000000000029B00000000000000010000000000000000000000000100000000FF020000000000000100000000FF0200000B0000004D65737361676556696577FFFFFFFF
     94BottomPanelData=00000400010000000B0000004D657373616765566965770004000000000000029B00000000000000010000000000000000000000000100000000FF020000000000000100000000BC030000000000000100000000BC030000000000000100000000000400000B0000004D65737361676556696577FFFFFFFF
    8595
    8696[View0]
    8797Module=P:\vista\GUI-config\MainU.pas
     98CursorX=17
     99CursorY=1782
     100TopLine=1775
     101LeftCol=1
     102
     103[View1]
     104Module=P:\vista\GUI-config\DebugU.pas
    88105CursorX=1
    89 CursorY=1588
    90 TopLine=1579
    91 LeftCol=1
    92 
    93 [View1]
    94 Module=P:\Vista\GUI-config\CPRS-Lib\ORFn.pas
    95 CursorX=1
    96 CursorY=623
    97 TopLine=613
     106CursorY=26
     107TopLine=1
    98108LeftCol=1
    99109
    100110[View2]
    101 Module=P:\vista\GUI-config\BDK32\Source\wsockc.pas
    102 CursorX=1
    103 CursorY=1479
    104 TopLine=1466
     111Module=P:\vista\GUI-config\FMErrorU.pas
     112CursorX=36
     113CursorY=53
     114TopLine=45
    105115LeftCol=1
    106116
    107117[View3]
     118Module=P:\vista\GUI-config\LookupU.pas
     119CursorX=55
     120CursorY=112
     121TopLine=25
     122LeftCol=1
     123
     124[View4]
    108125Module=P:\vista\GUI-config\AboutU.pas
    109126CursorX=1
     
    112129LeftCol=1
    113130
    114 [View4]
     131[View5]
    115132Module=P:\vista\GUI-config\frmSplash.pas
    116 CursorX=1
    117 CursorY=67
     133CursorX=26
     134CursorY=60
    118135TopLine=56
    119136LeftCol=1
    120137
    121 [View5]
     138[View6]
    122139Module=P:\vista\GUI-config\GUI_Config.dpr
    123140CursorX=1
    124141CursorY=66
    125 TopLine=46
     142TopLine=55
    126143LeftCol=1
    127144
    128145[Watches]
    129 Count=5
     146Count=6
    130147Watch0='MainMenu.items.count',256,0,18,1,0,'Watches'
    131148Watch1='tempInfo',256,0,18,1,0,'Watches'
     
    133150Watch3='Strings.count',256,0,18,1,0,'Watches'
    134151Watch4='Self.Height',256,0,18,1,0,'Watches'
     152Watch5='SettingsPageControl.ActivePageindex',256,0,18,1,0,'Watches'
    135153
    136154[WatchWindow]
     
    140158Visible=0
    141159State=0
    142 Left=0
    143 Top=0
     160Left=125
     161Top=202
    144162Width=764
    145 Height=129
     163Height=235
    146164MaxLeft=-1
    147165MaxTop=-1
    148166ClientWidth=756
    149 ClientHeight=103
     167ClientHeight=209
    150168TBDockHeight=103
    151169LRDockWidth=421
     
    153171
    154172[Breakpoints]
    155 Count=12
    156 Breakpoint0='P:\vista\GUI-config\MainU.pas',1879,'',0,1,'',1,0,0,'',1,'','',''
     173Count=9
     174Breakpoint0='P:\vista\GUI-config\MainU.pas',1886,'',0,1,'',1,0,0,'',1,'','',''
    157175Breakpoint1='P:\vista\GUI-config\AboutU.pas',109,'',0,1,'',1,0,0,'',1,'','',''
    158 Breakpoint2='P:\vista\GUI-config\MainU.pas',2081,'',0,1,'',1,0,0,'',1,'','',''
    159 Breakpoint3='P:\vista\GUI-config\MainU.pas',2088,'',0,1,'',1,0,0,'',1,'','',''
    160 Breakpoint4='P:\vista\GUI-config\MainU.pas',2104,'',0,1,'',1,0,0,'',1,'','',''
    161 Breakpoint5='P:\vista\GUI-config\MainU.pas',2001,'',0,1,'',1,0,0,'',1,'','',''
    162 Breakpoint6='P:\vista\GUI-config\MainU.pas',2036,'',0,1,'',1,0,0,'',1,'','',''
    163 Breakpoint7='P:\vista\GUI-config\MainU.pas',414,'',0,1,'',1,0,0,'',1,'','',''
    164 Breakpoint8='P:\vista\GUI-config\MainU.pas',1295,'',0,1,'',1,0,0,'',1,'','',''
    165 Breakpoint9='P:\vista\GUI-config\MainU.pas',2199,'',0,1,'',1,0,0,'',1,'','',''
    166 Breakpoint10='P:\vista\GUI-config\MainU.pas',1586,'',0,1,'',1,0,0,'',1,'','',''
    167 Breakpoint11='P:\vista\GUI-config\MainU.pas',1592,'',0,1,'',1,0,0,'',1,'','',''
     176Breakpoint2='P:\vista\GUI-config\MainU.pas',2088,'',0,1,'',1,0,0,'',1,'','',''
     177Breakpoint3='P:\vista\GUI-config\MainU.pas',2095,'',0,1,'',1,0,0,'',1,'','',''
     178Breakpoint4='P:\vista\GUI-config\MainU.pas',2111,'',0,1,'',1,0,0,'',1,'','',''
     179Breakpoint5='P:\vista\GUI-config\MainU.pas',2008,'',0,1,'',1,0,0,'',1,'','',''
     180Breakpoint6='P:\vista\GUI-config\MainU.pas',2206,'',0,1,'',1,0,0,'',1,'','',''
     181Breakpoint7='P:\vista\GUI-config\MainU.pas',1593,'',0,1,'',1,0,0,'',1,'','',''
     182Breakpoint8='P:\vista\GUI-config\MainU.pas',1750,'',0,1,'',1,0,0,'',1,'','',''
    168183
    169184[AddressBreakpoints]
     
    173188Create=1
    174189Visible=1
    175 State=0
    176 Left=0
    177 Top=0
    178 Width=1024
     190State=2
     191Left=887
     192Top=173
     193Width=137
    179194Height=112
    180195MaxLeft=-1
    181196MaxTop=-1
    182 ClientWidth=1016
     197MaxWidth=1032
     198MaxHeight=112
     199ClientWidth=1024
    183200ClientHeight=78
    184201
     
    219236Visible=0
    220237State=0
    221 Left=0
    222 Top=0
     238Left=145
     239Top=114
    223240Width=800
    224241Height=561
     
    260277LRDockWidth=250
    261278Dockable=1
    262 SplitPos=73
     279SplitPos=114
    263280ArrangeBy=Name
    264 SelectedItem=OnClick
    265 ExpandedItems=Anchors,Menu,Options
     281SelectedItem=Caption
     282ExpandedItems=Menu,Options
    266283HiddenCategories=Legacy
    267284
     
    292309Visible=0
    293310State=0
    294 Left=0
    295 Top=0
    296 Width=1024
    297 Height=210
    298 MaxLeft=-1
    299 MaxTop=-1
    300 ClientWidth=1016
    301 ClientHeight=184
     311Left=417
     312Top=181
     313Width=416
     314Height=437
     315MaxLeft=-1
     316MaxTop=-1
     317ClientWidth=408
     318ClientHeight=411
    302319TBDockHeight=355
    303320LRDockWidth=233
     
    466483[MessageView@EditWindow0]
    467484Create=1
    468 Visible=1
     485Visible=0
    469486State=0
    470487Left=12
    471488Top=0
    472 Width=755
     489Width=1012
    473490Height=155
    474491MaxLeft=-1
    475492MaxTop=-1
    476 ClientWidth=755
     493ClientWidth=1012
    477494ClientHeight=155
    478495TBDockHeight=155
     
    488505Visible=1
    489506State=0
    490 Left=12
    491 Top=139
     507Left=16
     508Top=128
    492509Width=266
    493510Height=577
     
    500517Dockable=1
    501518TabPosition=0
    502 ActiveTab=Object Inspector
     519ActiveTab=Object TreeView
    503520TabDockClients=PropertyInspector,ObjectTree
    504521
  • cprs/branches/GUI-config/MainU.pas

    r756 r828  
    3737  {$ENDIF}
    3838  Trpcb, //needed for .ptype types
    39   ValEdit;
     39  ValEdit, SortStringGrid;
    4040
    4141type
     
    4949
    5050  TGridInfo = class;  //forward declaration
    51   TGridDataLoader = procedure (GridInfo: TGridInfo) of object; 
     51  TGridDataLoader = procedure (GridInfo: TGridInfo) of object;
    5252  TGridInfo = class (TObject)
    5353  public
    54     Grid      : TStringGrid;  //doesn't own object
     54    Grid      : TSortStringGrid;  //doesn't own object
    5555    FileNum   : string;
    5656    IENS      : string;
     
    6161    ApplyBtn  : TButton;
    6262    RevertBtn : TButton;
    63   end;     
     63  end;
    6464
    6565
     
    7979    Panel5: TPanel;
    8080    ApplicationEvents: TApplicationEvents;
    81     AdvancedUsersGrid: TStringGrid;
    82     BasicUsersGrid: TStringGrid;
     81    AdvancedUsersGrid: TSortStringGrid;
     82    BasicUsersGrid: TSortStringGrid;
    8383    MainMenu: TMainMenu;
    8484    FileMenu: TMenuItem;
     
    9292    SettingsPageControl: TPageControl;
    9393    tsBasicSettings: TTabSheet;
    94     BasicSettingsGrid: TStringGrid;
     94    BasicSettingsGrid: TSortStringGrid;
    9595    tsAdvancedSettings: TTabSheet;
    96     AdvancedSettingsGrid: TStringGrid;
     96    AdvancedSettingsGrid: TSortStringGrid;
    9797    Panel3: TPanel;
    9898    btnSettingsApply: TBitBtn;
     
    108108    PatientsPageControl: TPageControl;
    109109    tsBasicPatients: TTabSheet;
    110     BasicPatientGrid: TStringGrid;
     110    BasicPatientGrid: TSortStringGrid;
    111111    tsAdvancedPatients: TTabSheet;
    112     AdvancedPatientGrid: TStringGrid;
     112    AdvancedPatientGrid: TSortStringGrid;
    113113    Panel9: TPanel;
    114114    btnPatientApply: TBitBtn;
     
    124124    AnyFilePageControl: TPageControl;
    125125    TabSheet2: TTabSheet;
    126     AnyFileGrid: TStringGrid;
     126    AnyFileGrid: TSortStringGrid;
    127127    Panel14: TPanel;
    128128    btnAdvancedApply: TBitBtn;
     
    214214    procedure SetCursorImage(Cursor : TCursor);
    215215    function FileNumForSettingsNode (Node : TTreeNode) : string;
    216     function GetVisibleGrid: TStringGrid;
     216    function GetVisibleGrid: TSortStringGrid;
    217217    function GetVisibleGridInfo : TGridInfo;
    218     function GetInfoForGrid(Grid : TStringGrid) : TGridInfo;
    219     function GetInfoIndexForGrid(Grid : TStringGrid) : integer;
    220     procedure SetVisibleGridIdx(Grid : TStringGrid);
     218    function GetInfoForGrid(Grid : TSortStringGrid) : TGridInfo;
     219    function GetInfoIndexForGrid(Grid : TSortStringGrid) : integer;
     220    procedure SetVisibleGridIdx(Grid : TSortStringGrid);
    221221    procedure GetUsersList(UsersList : TStringList; HideInactive: boolean);
    222222    procedure GetRecordsList(RecordsList : TStringList; FileNum : string);
     
    236236    //procedure GetAnyfileInfo(FileNum : String; IENS : String; Data : TStringList);   
    237237    function FindInStrings(fieldNum : string; Strings : TStringList; var fileNum : string) : integer;
    238     procedure CompileChanges(Grid : TStringGrid; CurrentUserData,Changes : TStringList);
    239     function PostChanges(Grid : TStringGrid) : TModalResult;
     238    procedure CompileChanges(Grid : TSortStringGrid; CurrentUserData,Changes : TStringList);
     239    function PostChanges(Grid : TSortStringGrid) : TModalResult;
    240240    function PostVisibleGrid: TModalResult;
    241     procedure LoadAnyGrid(Grid : TStringGrid; BasicMode: boolean; FileNum,IENS : string; CurrentData : TStringList);
     241    procedure LoadAnyGrid(Grid : TSortStringGrid; BasicMode: boolean; FileNum,IENS : string; CurrentData : TStringList);
    242242    function DisuserChanged(Changes: TStringList) : boolean;
    243243    procedure DrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean);
    244244    function DoCloneRecord(FileNum, SourceIENS, New01Field : String) : string;
    245245    function DoCloneUser(SourceIENS, New01Field : String) : string;
    246     function GetGridHint(Grid : TStringGrid; FileNum : string; ACol, ARow : integer) : string;
    247     function FieldHelp(FileNum, FieldNum, HelpStyle : string) : string;   
    248     procedure DoRevert(BasicGrid,AdvancedGrid : TStringGrid);
     246    function GetGridHint(Grid : TSortStringGrid; FileNum : string; ACol, ARow : integer) : string;
     247    function FieldHelp(FileNum, IENS, FieldNum, HelpStyle : string) : string;   
     248    procedure DoRevert(BasicGrid,AdvancedGrid : TSortStringGrid);
    249249  public
    250250    { Public declarations }
     
    252252    LastSelTreeNode : TTreeNode;
    253253    DebugMode : boolean;
    254     function GetUserLine(CurrentUserData : TStringList; Grid : TStringGrid; ARow:integer) :integer;
    255     function GetLineInfo(Grid : TStringGrid; CurrentUserData : TStringList; ARow: integer) : tFileEntry;
     254    function GetUserLine(CurrentUserData : TStringList; Grid : TSortStringGrid; ARow:integer) :integer;
     255    function GetLineInfo(Grid : TSortStringGrid; CurrentUserData : TStringList; ARow: integer) : tFileEntry;
    256256    function IsSubFile(FieldDef: string ; var SubFileNum : string) : boolean;
    257257    function IsWPField(FileNum,FieldNum : string) : boolean;
     
    261261    Procedure GetBlankFileInfo(FileNum : string; BlankList : TStringList);
    262262    procedure GetOneRecord(FileNum, IENS : string; Data, BlankFileInfo : TStringList);
    263     procedure AddGridInfo(Grid: TStringGrid; Data : TStringList; BasicMode : boolean;
     263    procedure AddGridInfo(Grid: TSortStringGrid; Data : TStringList; BasicMode : boolean;
    264264                          DataLoader : TGridDataLoader; FileNum : string;
    265265                          ApplyBtn,RevertBtn : TButton);
    266266    procedure LoadAnyGridFromInfo(GridInfo : TGridInfo);
    267     procedure ClearGrid(Grid : TStringGrid);
     267    procedure ClearGrid(Grid : TSortStringGrid);
    268268    procedure RegisterGridInfo(GridInfo : TGridInfo);
    269269    procedure UnRegisterGridInfo(GridInfo : TGridInfo);
     
    398398
    399399 
    400   procedure TMainForm.AddGridInfo(Grid: TStringGrid;
     400  procedure TMainForm.AddGridInfo(Grid: TSortStringGrid;
    401401                                  Data : TStringList;
    402402                                  BasicMode : boolean;
     
    10361036 
    10371037 
    1038   procedure TMainForm.ClearGrid(Grid : TStringGrid);
     1038  procedure TMainForm.ClearGrid(Grid : TSortStringGrid);
    10391039  var i:integer;
    10401040  begin
     
    10481048
    10491049 
    1050   procedure TMainForm.LoadAnyGrid(Grid : TStringGrid;  //the TStringGrid to load
     1050  procedure TMainForm.LoadAnyGrid(Grid : TSortStringGrid;  //the TSortStringGrid to load
    10511051                                  BasicMode: boolean;
    10521052                                  FileNum : string;
     
    10771077  //This assumes that GridInfo already has loaded info.
    10781078  var
    1079     Grid : TStringGrid;  //the TStringGrid to load
     1079    Grid : TSortStringGrid;  //the TSortStringGrid to load
    10801080    BasicMode: boolean;
    10811081    FileNum : string;
     
    10831083    CurrentData : TStringList;
    10841084
    1085     procedure LoadOneLine (Grid : TStringGrid; oneEntry : string; GridRow : integer);
     1085    procedure LoadOneLine (Grid : TSortStringGrid; oneEntry : string; GridRow : integer);
    10861086    var
    10871087      tempFile,IENS : string;
     
    12081208      GridFileNum : string;
    12091209      UserLine : integer;
    1210       Grid : TStringGrid;
     1210      Grid : TSortStringGrid;
    12111211      IEN : int64;
    12121212      IENS : string;
     
    12161216  begin
    12171217    if FLoadingGrid then exit;  //prevent pseudo-clicks during loading...
    1218     Grid := (Sender as TStringGrid);
     1218    Grid := (Sender as TSortStringGrid);
    12191219    GridInfo := GetInfoForGrid(Grid);
    12201220    if GridInfo=nil then exit;
     
    13011301
    13021302
    1303   function TMainForm.GetLineInfo(Grid : TStringGrid; CurrentUserData : TStringList; ARow: integer) : tFileEntry;
     1303  function TMainForm.GetLineInfo(Grid : TSortStringGrid; CurrentUserData : TStringList; ARow: integer) : tFileEntry;
    13041304  var fieldNum : string;
    13051305      oneEntry : string;
     
    13271327  end;
    13281328 
    1329   function TMainForm.GetUserLine(CurrentUserData : TStringList; Grid : TStringGrid; ARow: integer) : integer;
     1329  function TMainForm.GetUserLine(CurrentUserData : TStringList; Grid : TSortStringGrid; ARow: integer) : integer;
    13301330  var fieldNum: string;
    13311331      tempFileNum : string;
     
    14291429  end;
    14301430 
    1431   function TMainForm.GetVisibleGrid: TStringGrid;
     1431  function TMainForm.GetVisibleGrid: TSortStringGrid;
    14321432  begin
    14331433    if FVisibleGridIdx > -1 then begin
     
    14381438  end;
    14391439 
    1440   function TMainForm.GetInfoForGrid(Grid : TStringGrid) : TGridInfo;
     1440  function TMainForm.GetInfoForGrid(Grid : TSortStringGrid) : TGridInfo;
    14411441  var i : integer;
    14421442  begin
     
    14501450
    14511451 
    1452   function TMainForm.GetInfoIndexForGrid(Grid : TStringGrid) : integer;
     1452  function TMainForm.GetInfoIndexForGrid(Grid : TSortStringGrid) : integer;
    14531453  var s : string;
    14541454  begin
     
    14571457  end;
    14581458 
    1459   procedure TMainForm.SetVisibleGridIdx(Grid : TStringGrid);
     1459  procedure TMainForm.SetVisibleGridIdx(Grid : TSortStringGrid);
    14601460  begin
    14611461    FVisibleGridIdx := GetInfoIndexForGrid(Grid);
     
    14631463
    14641464
    1465   procedure TMainForm.CompileChanges(Grid : TStringGrid; CurrentUserData,Changes : TStringList);
     1465  procedure TMainForm.CompileChanges(Grid : TSortStringGrid; CurrentUserData,Changes : TStringList);
    14661466  //Output format:
    14671467  // FileNum^IENS^FieldNum^FieldName^newValue^oldValue
     
    14791479    for row := 1 to Grid.RowCount-1 do begin
    14801480      Entry := GetLineInfo(Grid,CurrentUserData, row);
    1481       //Reject any value containing a "^" , ":" , ";"
     1481      //Reject any value containing a "^"
    14821482      //Do we need an @ here as well?
    1483       if (AnsiPos('^',Entry.newvalue) > 0) or //(AnsiPos(':',Entry.newvalue) > 0) or   //elh Taken out because : used in time
    1484          (AnsiPos(';',Entry.newvalue) > 0)then begin
     1483      if AnsiPos('^',Entry.newvalue) > 0 then begin  //or (AnsiPos(':',Entry.newvalue) > 0) or  (AnsiPos(';',Entry.newvalue) > 0) //elh Taken out because : used in time
    14851484         messagedlg('Invalid value entered for ' + Entry.Fieldname + #13 + #10
    14861485                     + #13 + #10 + 'Invalid Entry:   ' + Entry.newvalue + #13 + #10 +
     
    15141513
    15151514
    1516   function TMainForm.PostChanges(Grid : TStringGrid) : TModalResult;
     1515  function TMainForm.PostChanges(Grid : TSortStringGrid) : TModalResult;
    15171516  //Results:  mrNone -- no post done (not needed)
    15181517  //          mrCancel -- user pressed cancel on confirmation screen.
     
    17291728  end; 
    17301729
    1731   function TMainForm.FieldHelp(FileNum, FieldNum, HelpStyle : string) : string;
     1730  function TMainForm.FieldHelp(FileNum, IENS, FieldNum, HelpStyle : string) : string;
    17321731  var
    17331732     RPCResult: string;
     
    17371736  begin
    17381737    Result := '';
    1739     SrchStr := FileNum + '^' + FieldNum + '^' + HelpStyle;
     1738    SrchStr := FileNum + '^' + FieldNum + '^' + HelpStyle + '^' + IENS;
    17401739    Idx := CachedHelpIdx.IndexOf(SrchStr);
    17411740    if Idx = -1 then begin
     
    17751774  end;
    17761775
    1777   function TMainForm.GetGridHint(Grid : TStringGrid; FileNum : string; ACol, ARow : integer) : string;
     1776  function TMainForm.GetGridHint(Grid : TSortStringGrid; FileNum : string; ACol, ARow : integer) : string;
    17781777  var fieldNum : string;
     1778      GridInfo : TGridInfo;
    17791779  begin
    17801780    Result := '';
    17811781    //Result := 'Row=' + IntToStr(ARow) + ', Col='+ IntToStr(ACol);
    17821782    if ARow > Grid.RowCount-1 then exit;
    1783     if (ARow < 0) or (ACol < 0) then exit;
     1783    if (ARow < 1) or (ACol < 0) then exit;
    17841784    if ACol=0 then begin
    1785       Result := 'This is the database field NUMBER';     
     1785      Result := 'This is the database field NUMBER';
    17861786    end else if ACol=1 then begin
    1787       Result := 'This is the database field NAME';     
     1787      Result := 'This is the database field NAME';
    17881788    end else begin
    17891789      fieldNum := Grid.Cells[0,ARow];
     
    17971797        result := 'Clicking will open new window...';
    17981798      end else begin
    1799         Result := FieldHelp(FileNum, fieldNum, '?');     
    1800       end; 
     1799        GridInfo := GetInfoForGrid(Grid);
     1800        Result := FieldHelp(FileNum,  GridInfo.IENS, fieldNum, '?');
     1801      end;
    18011802    end;
    18021803  end;
     
    18301831    if VisibleGridInfo = nil then exit;
    18311832    if VisibleGridInfo.Grid = nil then exit;
    1832     if (ClassName='TStringGrid') then begin     
     1833    if (ClassName='TSortStringGrid') then begin     
    18331834      VisibleGridInfo.Grid.MouseToCell(Pos.X,Pos.Y,ACol,ARow);
    18341835      HintInfo.HintStr := GetGridHint(VisibleGridInfo.Grid,VisibleGridInfo.FileNum,ACol, ARow);
     
    19691970    ModalResult := PostVisibleGrid;
    19701971    if ModalResult = mrNo then exit;
    1971     FileNum := FileORComboBox.ItemID; 
     1972    FileNum := FileORComboBox.ItemID;
    19721973    IEN := RecordORComboBox.ItemID;  //get info from selected record
    19731974    if IEN=0 then exit;
     
    21932194
    21942195
    2195   procedure TMainForm.DoRevert(BasicGrid,AdvancedGrid : TStringGrid);
     2196  procedure TMainForm.DoRevert(BasicGrid,AdvancedGrid : TSortStringGrid);
    21962197  //BasicGrid doesn't have to be supplied.  Can be nil value.
    21972198  //AdvancedGrid is required.
  • cprs/branches/GUI-config/SubfilesU.dfm

    r542 r828  
    7373    Align = alClient
    7474    TabOrder = 1
    75     object SubFileGrid: TStringGrid
     75    object SubFileGrid: TSortStringGrid
    7676      Left = 1
    7777      Top = 1
  • cprs/branches/GUI-config/SubfilesU.pas

    r542 r828  
    3030  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    3131  StrUtils, MainU,
    32   Dialogs, StdCtrls, ExtCtrls, Grids, ComCtrls, Buttons;
     32  Dialogs, StdCtrls, ExtCtrls, Grids, ComCtrls, Buttons, SortStringGrid;
    3333
    3434type
     
    3636    Panel1: TPanel;
    3737    TreeView: TTreeView;
    38     SubFileGrid: TStringGrid;
     38    SubFileGrid: TSortStringGrid;
    3939    Splitter1: TSplitter;
    4040    SubFileLabel: TLabel;
     
    7575    GridInfo : TGridInfo;
    7676    ModifiedForm : boolean;  //Used to see if current record is unsaved
    77     procedure CompileChanges(Grid : TStringGrid; CurrentUser,Changes : TStringList);
    78     procedure PostChanges(Grid : TStringGrid; IENS : string; SilentMode : boolean = false);
     77    procedure CompileChanges(Grid : TSortStringGrid; CurrentUser,Changes : TStringList);
     78    procedure PostChanges(Grid : TSortStringGrid; IENS : string; SilentMode : boolean = false);
    7979    procedure GetAllSubRecords(SubFileNum, ParentIENS : string; SubRecsList : TStringList);
    8080    procedure InitTreeView;
     
    296296
    297297 
    298   procedure TSubfileForm.PostChanges(Grid : TStringGrid; IENS : string; SilentMode : boolean);
     298  procedure TSubfileForm.PostChanges(Grid : TSortStringGrid; IENS : string; SilentMode : boolean);
    299299 
    300300    function NewIENS(oldIENS : string; PostResults : TStringList) : string;
     
    340340  end;
    341341
    342   procedure TSubfileForm.CompileChanges(Grid : TStringGrid; CurrentUser,Changes : TStringList);
     342  procedure TSubfileForm.CompileChanges(Grid : TSortStringGrid; CurrentUser,Changes : TStringList);
    343343  //Output format:
    344344  // FileNum^IENS^FieldNum^FieldName^newValue^oldValue
Note: See TracChangeset for help on using the changeset viewer.