🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.delphi
2 messages
2 total messages Started by Daniel Gogolewski Sat, 20 Sep 1997 00:00
TabSet i TStringList - Pomocy !!!!!!!!
#203
Author: Daniel Gogolewski
Date: Sat, 20 Sep 1997 00:00
75 lines
1960 bytes
Prosze  o pomoc - problem ten nie daj mnie spa� po nocach :))

Czemu to jest �le 


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, Tabs, ToolWin, ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    ToolBar1: TToolBar;
    TabSet1: TTabSet;
    SpeedButton1: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
    procedure TabSet1Change(Sender: TObject; NewTab: Integer;
      var AllowChange: Boolean);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
     Strony : TStringList;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
     if TabSet1.Tabs.Count = 0 then
      begin
       Strony.Add('');
       TabSet1.Tabs.Add('Nowy');
       TabSet1.TabIndex := 0;
      end
     else
      begin
       Strony[TabSet1.TabIndex] := Memo1.Text;
       Strony.Add('');
       TabSet1.Tabs.Add('Nowy');
       TabSet1.TabIndex := TabSet1.Tabs.Count -1 ;
      end;
end;

procedure TForm1.TabSet1Change(Sender: TObject; NewTab: Integer;
  var AllowChange: Boolean);
begin
Strony[TabSet1.TabIndex] := Memo1.Text; 
		<-------------------------- tu jest blad;
Memo1.Text := Strony[NewTab];


end;

procedure TForm1.FormCreate(Sender: TObject);
begin
     Strony := TStringList.Create;
     SpeedButton1Click(Sender);
end;

end.

Z gory dziekuje za pomoc 
Pozdrawiam Daniel Gogolewski 
Re: TabSet i TStringList - Pomocy !!!!!!!!
#204
Author: Dominik Z.
Date: Sun, 21 Sep 1997 00:00
20 lines
1045 bytes
>        TabSet1.TabIndex := 0;
Tutaj nastepuje zmiana aktywnego TAB'u na pierwszy ( i w przypadku
pierwszego uruchomienia programu jedyny!).

Event OnChange zostaje wywolany ZANIM zostanie zmieniony tab, tak wiec w
przypadku pierwszego uruchomienia programu TabSet1.TabIndex = -1
!!!!!!!!!!!!!!!!!, bo zaden tab nie jest wybrany ( po prostu go nie ma!)

> Strony[TabSet1.TabIndex] := Memo1.Text;
>                 <-------------------------- tu jest blad;

A jak wiadomo pierwsza pozycja w liscie Strony ma index = 0 i przy
wartosciach <0 bedzie sie wywalalo

> Z gory dziekuje za pomoc

Nie ma sprawy....

Domcio (dom...@polbox.com, dom...@polbox.pl)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads