Changeset 15 for trunk/UMainWindow.pas


Ignore:
Timestamp:
Feb 18, 2008, 2:00:19 PM (17 years ago)
Author:
george
Message:

Přepracováno: Změna síťových komponent z fundamentals sockets na Indy. Prozatím ne dostatečně funkční.
Typografikcé úpravy.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66Network.cfg
        77Error.txt
         8ProjectGroup1.bdsgroup
         9ProjectGroup1.bdsgroup.local
  • trunk/UMainWindow.pas

    r13 r15  
    1111  StdActns, ULogExceptions, RVScroll, RichView, RVStyle, UTextFileStream,
    1212  ShellAPI, SunriseChatCoreUnit, SunriseChatNetworkCoreUnit, IdBaseComponent,
    13   IdComponent, IdUDPBase, IdUDPServer, XPMan;
     13  IdComponent, IdUDPBase, IdUDPServer, XPMan, IdUDPClient, IdCustomTCPServer,
     14  IdTCPServer, IdTCPConnection, IdTCPClient, IdAntiFreezeBase, IdAntiFreeze;
    1415
    1516const
     
    180181    XPManifest1: TXPManifest;
    181182    Log1: TMenuItem;
    182     fndUDPSocket1: TfndUDPSocket;
    183     fndUDPClientSocket1: TfndUDPClientSocket;
    184183    procedure FormCreate(Sender: TObject);
    185184    procedure FormShow(Sender: TObject);
     
    14221421  Text: string;
    14231422begin
    1424   SetLength(AppEventsOptions,Length(AppEvents));
    1425   for I:= 0 to High(AppEventsOptions) do begin
     1423  SetLength(AppEventsOptions, Length(AppEvents));
     1424  for I := 0 to High(AppEventsOptions) do begin
    14261425    //if not Assigned(AppEventsOptions[I]) then
    1427     AppEventsOptions[I] := TAutoRegistry.Create(RegistryPath+'\'+SettingsName+'\AppEvents\'+IntToStr(I));
     1426    AppEventsOptions[I] := TAutoRegistry.Create(RegistryPath + '\' + SettingsName +
     1427      '\AppEvents\' + IntToStr(I));
    14281428    with AppEventsOptions[I], AppEvents[I] do begin
    1429       Include('ShowWindow',ShowWindow,ShowWindow);
    1430       Include('ShowAlertIcon',ShowAlertIcon,ShowAlertIcon);
    1431       Include('ShowBaloonHint',ShowBalloonHint,ShowBalloonHint);
    1432       Include('PlayBeep',PlayBeep,PlayBeep);
    1433       Include('PlaySound',PlaySound,PlaySound);
    1434       Include('SoundFile',SoundFile,'');
    1435       Include('ExecuteApplication',ExecuteApplication,False);
    1436       Include('ApplicationFile',ApplicationFile,'');
    1437       Include('ShowMessage',ShowMessage,ShowMessage);
    1438       Include('MessageText',MessageText,MessageText);
    1439       Include('IconFile',IconFile,'Envelope.ico');
     1429      Include('ShowWindow', ShowWindow, ShowWindow);
     1430      Include('ShowAlertIcon', ShowAlertIcon, ShowAlertIcon);
     1431      Include('ShowBaloonHint', ShowBalloonHint, ShowBalloonHint);
     1432      Include('PlayBeep', PlayBeep, PlayBeep);
     1433      Include('PlaySound' ,PlaySound, PlaySound);
     1434      Include('SoundFile', SoundFile, '');
     1435      Include('ExecuteApplication', ExecuteApplication, False);
     1436      Include('ApplicationFile', ApplicationFile, '');
     1437      Include('ShowMessage', ShowMessage, ShowMessage);
     1438      Include('MessageText', MessageText, MessageText);
     1439      Include('IconFile', IconFile, 'Envelope.ico');
    14401440      // Font
    1441       Include('FontColor',MessageFontTemp.Color,Integer(clBlack));
    1442       Include('FontStyle',MessageFontTemp.Style,'');
    1443       Include('FontCharset',MessageFontTemp.Charset,1);
     1441      Include('FontColor', MessageFontTemp.Color, Integer(clBlack));
     1442      Include('FontStyle', MessageFontTemp.Style, '');
     1443      Include('FontCharset', MessageFontTemp.Charset, 1);
    14441444      Include('FontSize', MessageFontTemp.Size, 8);
    14451445      Include('FontName', MessageFontTemp.Name, 'MS Sans Serif');
    14461446      LoadFromRegistry;
    14471447      MessageFont.Color := MessageFontTemp.Color;
    1448       while Pos(',', MessageFontTemp.Style)>0 do begin
    1449         Text:= Copy(MessageFontTemp.Style, 1, Pos(',', MessageFontTemp.Style)-1);
    1450         System.Delete(MessageFontTemp.Style, 1, Length(Text)+1);
     1448      while Pos(',', MessageFontTemp.Style) > 0 do begin
     1449        Text := Copy(MessageFontTemp.Style, 1, Pos(',', MessageFontTemp.Style) - 1);
     1450        System.Delete(MessageFontTemp.Style, 1, Length(Text) + 1);
    14511451        if Text = 'Bold' then MessageFont.Style := MessageFont.Style + [fsBold];
    14521452        if Text = 'Italic' then MessageFont.Style := MessageFont.Style + [fsItalic];
     
    14671467  SetLength(AppUserEventsOptions, AppUserEventsCount);
    14681468  SetLength(AppUserEvents, AppUserEventsCount);
    1469   for I := 0 to AppUserEventsCount-1 do begin
     1469  for I := 0 to AppUserEventsCount - 1 do begin
    14701470    //if not Assigned(AppEventsOptions[I]) then
    1471     AppUserEventsOptions[I] := TAutoRegistry.Create(RegistryPath+'\'+SettingsName+'\AppUserEvents\'+IntToStr(I));
     1471    AppUserEventsOptions[I] := TAutoRegistry.Create(RegistryPath + '\' +
     1472      SettingsName + '\AppUserEvents\' + IntToStr(I));
    14721473    with AppUserEventsOptions[I], AppUserEvents[I] do begin
    14731474      Update := UpdateOnly;
     
    14761477      Include('ConditionUserEnable', ConditionUserEnable, ConditionUserEnable);
    14771478      Include('ConditionUser', ConditionUser, ConditionUser);
    1478       Include('ConditionAppEventEnable', ConditionAppEventEnable,ConditionAppEventEnable);
    1479       Include('ConditionAppEvent',ConditionAppEvent,ConditionAppEvent);
    1480       Include('ShowWindow',ShowWindow,ShowWindow);
    1481       Include('ShowAlertIcon',ShowAlertIcon,ShowAlertIcon);
    1482       Include('IconFile',IconFile,'Envelope.ico');
    1483       Include('ShowBaloonHint',ShowBalloonHint,ShowBalloonHint);
    1484       Include('PlayBeep',PlayBeep,PlayBeep);
    1485       Include('PlaySound',PlaySound,PlaySound);
    1486       Include('SoundFile',SoundFile,'');
    1487       Include('ExecuteApplication',ExecuteApplication,False);
    1488       Include('ApplicationFile',ApplicationFile,'');
    1489       Include('ShowImage',ShowImage,ShowImage);
    1490       Include('ImageFile',ImageFile,ImageFile);
    1491       Include('EventName',EventName,EventName);
     1479      Include('ConditionAppEventEnable', ConditionAppEventEnable, ConditionAppEventEnable);
     1480      Include('ConditionAppEvent', ConditionAppEvent, ConditionAppEvent);
     1481      Include('ShowWindow', ShowWindow, ShowWindow);
     1482      Include('ShowAlertIcon', ShowAlertIcon, ShowAlertIcon);
     1483      Include('IconFile', IconFile, 'Envelope.ico');
     1484      Include('ShowBaloonHint', ShowBalloonHint, ShowBalloonHint);
     1485      Include('PlayBeep', PlayBeep, PlayBeep);
     1486      Include('PlaySound', PlaySound, PlaySound);
     1487      Include('SoundFile', SoundFile, '');
     1488      Include('ExecuteApplication', ExecuteApplication, False);
     1489      Include('ApplicationFile', ApplicationFile, '');
     1490      Include('ShowImage', ShowImage, ShowImage);
     1491      Include('ImageFile', ImageFile, ImageFile);
     1492      Include('EventName', EventName, EventName);
    14921493      LoadFromRegistry;
    14931494    end;
     
    15061507  Settings: string;
    15071508begin
    1508   if SettingsName = 'Default' then Settings:= '' else Settings:= '('+SettingsName+')';
    1509   if SunriseChatNetworkCore1.Connected then NewCaption:= '' else NewCaption:= ' (Offline)';
    1510   Caption:= ApplicationName+Settings+' - '+SunriseChatNetworkCore1.LocalUser.Nick+NewCaption;
     1509  if SettingsName = 'Default' then Settings:= '' else Settings:= '(' + SettingsName + ')';
     1510  if SunriseChatNetworkCore1.Connected then NewCaption := ''
     1511    else NewCaption := ' (Offline)';
     1512  Caption := ApplicationName + Settings + ' - ' +
     1513    SunriseChatNetworkCore1.LocalUser.Nick + NewCaption;
    15111514end;
    15121515
     
    15141517  var InfoTip: String);
    15151518begin
    1516   InfoTip:= TUser(SunriseChatNetworkCore1.UserList[Item.Index]).DetailInfo;
     1519  InfoTip := TUser(SunriseChatNetworkCore1.UserList[Item.Index]).DetailInfo;
    15171520end;
    15181521
     
    15261529  //if Pos(':',ComboBox1.Text) = 0 then
    15271530  DoplnitJmeno;
    1528   ComboBox1.SelStart:= ComboBox1.SelStart + 1;
     1531  ComboBox1.SelStart := ComboBox1.SelStart + 1;
    15291532end;
    15301533
     
    15541557procedure TMainWindow.SearchFind1BeforeExecute(Sender: TObject);
    15551558begin
    1556   SearchFind1.Dialog.Options:= [frHideUpDown];
     1559  SearchFind1.Dialog.Options := [frHideUpDown];
    15571560end;
    15581561
     
    15621565begin
    15631566  with SunriseChatNetworkCore1 do begin
    1564     for I := 0 to ActiveRoom.Count-1 do
     1567    for I := 0 to ActiveRoom.Count - 1 do
    15651568      TRoomLine(ActiveRoom.Lines[I]).Font.Free;
    15661569    ActiveRoom.Count := 0;
     
    16941697  I: Integer;
    16951698begin
    1696   ComboBox1.Style:= csDropDown;
     1699  ComboBox1.Style := csDropDown;
    16971700  with SunriseChatNetworkCore1, ComboBox1.Items do begin
    16981701    BeginUpdate;
    16991702    Clear;
    1700     for I := 0 to UserList.Count-1 do with TUser(UserList[I]) do begin
    1701       if Copy(Nick,1,Length(ComboBox1.Text)) = ComboBox1.Text then Add(Nick+': ');
     1703    for I := 0 to UserList.Count - 1 do with TUser(UserList[I]) do begin
     1704      if Copy(Nick, 1, Length(ComboBox1.Text)) = ComboBox1.Text then Add(Nick + ': ');
    17021705    end;
    17031706    Update;
    17041707    EndUpdate;
    1705     if ComboBox1.Items.Count>0 then ComboBox1.DroppedDown:= True;
     1708    if ComboBox1.Items.Count > 0 then ComboBox1.DroppedDown:= True;
    17061709  end;
    17071710end;
     
    17141717procedure TMainWindow.ComboBox1DropDown(Sender: TObject);
    17151718begin
    1716   ComboBox1.Style:= csSimple;
     1719  ComboBox1.Style := csSimple;
    17171720end;
    17181721
    17191722procedure TMainWindow.ComboBox1CloseUp(Sender: TObject);
    17201723begin
    1721   ComboBox1.Style:= csSimple;
    1722   ComboBox1.SelStart:= -1;
     1724  ComboBox1.Style := csSimple;
     1725  ComboBox1.SelStart := -1;
    17231726end;
    17241727
     
    17331736begin
    17341737  RichView1.Clear;
    1735   for I:= 0 to High(AppUserEvents) do
     1738  for I := 0 to High(AppUserEvents) do
    17361739  if Assigned(AppUserEvents[I].Image) then FreeAndNil(AppUserEvents[I].Image);
    17371740  TabControl1Change(Self);
     
    17671770      Clear;
    17681771      AddStrings(StringList);
    1769       if Count>0 then DroppedDown:= True;
     1772      if Count > 0 then DroppedDown:= True;
    17701773      Update;
    17711774      EndUpdate;
     
    18191822  SoundDisable := True;
    18201823  SunriseChatNetworkCore1.SendCommand(scDisconnect);
     1824  SunriseChatNetworkCore1.Free;
    18211825  Options.Free;
    18221826  for I := 0 to High(AppEvents) do
Note: See TracChangeset for help on using the changeset viewer.