Jump to content

Takavoir

Members
  • Content Count

    14
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Takavoir got a reaction from JessieMug in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  2. Like
    Takavoir got a reaction from TristanTaf in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  3. Like
    Takavoir got a reaction from JosephMut in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  4. Like
    Takavoir got a reaction from Mablecymn in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  5. Like
    Takavoir got a reaction from HowardtorY in Accessibility of the controls   
    When adding controls to a form on the IDE in the Design tab, they're created with private accessibility. They're not acessible from a derived class. How can I change their accessibility?
     
    Context: I am developing an application with about 15 pages that have exactly the same template: a top menu, a main panel, a status bar, etc... I was planning to create a template class with all the common controls and then, a derived form for each page of my application. Is there another way to achieve this?
  6. Like
    Takavoir got a reaction from HowardtorY in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  7. Like
    Takavoir got a reaction from Richardmam in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  8. Like
    Takavoir got a reaction from Ekbergket in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  9. Like
    Takavoir got a reaction from Danielfem in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  10. Like
    Takavoir got a reaction from RudyAttemia in Using grids   
    Hi,
     
    I am trying to use a grid this way: I would like to be able to retreive a row ID when I click on a specific row to delete that row for example.
    So far, here is what I got to create the ButtonColumn in the grid:
     

    procedure TSpeakers.InitButtonColumn(ColumnName: String); begin   procedure W3ButtonColumnButtonClick(Sender: TObject);   begin     var i : integer;     for i := 0 to Speakers.Count - 1 do     begin       var speaker :=  Speakers.Items[i] As TSpeaker;       var button :=   TW3Button(Sender);       if speaker.Name = TW3Button(Sender).Caption  then       begin          CurrentSpeaker :=  speaker;          CurrentSpeakerLabel.Caption := CurrentSpeaker.Name;       end     end   end;   var ButtonColumn: TW3ButtonColumn;   ButtonColumn := nil;   ButtonColumn := TW3ButtonColumn.Create(SpeakerGrid as IW3ColumnsControl);   ButtonColumn.Header.Caption := ColumnName;   ButtonColumn.Width := 200;   ButtonColumn.OnButtonClick := W3ButtonColumnButtonClick;   SpeakerGrid.Columns.Add(ButtonColumn); end; And I create each row with the following:
     

    procedure TSpeakers.AddRowToGrid(SpeakerName: String; SpeakerNumber: integer); begin   { Add 1 new row & set 1st cell in newly added row }   SpeakerGrid.AddRow;   SpeakerGrid.Cell[0, SpeakerGrid.LastAddedRow].Value := SpeakerName; end; So how can I specify a row ID when I create a row so that I can retreive it in the W3ButtonColumnButtonClick procedure in order to know what row I am processing?
     
    Thanks
     
     
  11. Like
    Takavoir reacted to CWBudde in TW3Grid.ClearRows creates an exception   
    Sorry for the wrong line, it's in fact line 1064 (procedure TW3TagObj.RemoveFrom; + 4). Was doing this in a rush with two crying kids in the other room.
×
×
  • Create New...