Changeset 15 for trunk/UMainWindow.pas
- Timestamp:
- Feb 18, 2008, 2:00:19 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 Network.cfg 7 7 Error.txt 8 ProjectGroup1.bdsgroup 9 ProjectGroup1.bdsgroup.local
-
- Property svn:ignore
-
trunk/UMainWindow.pas
r13 r15 11 11 StdActns, ULogExceptions, RVScroll, RichView, RVStyle, UTextFileStream, 12 12 ShellAPI, SunriseChatCoreUnit, SunriseChatNetworkCoreUnit, IdBaseComponent, 13 IdComponent, IdUDPBase, IdUDPServer, XPMan; 13 IdComponent, IdUDPBase, IdUDPServer, XPMan, IdUDPClient, IdCustomTCPServer, 14 IdTCPServer, IdTCPConnection, IdTCPClient, IdAntiFreezeBase, IdAntiFreeze; 14 15 15 16 const … … 180 181 XPManifest1: TXPManifest; 181 182 Log1: TMenuItem; 182 fndUDPSocket1: TfndUDPSocket;183 fndUDPClientSocket1: TfndUDPClientSocket;184 183 procedure FormCreate(Sender: TObject); 185 184 procedure FormShow(Sender: TObject); … … 1422 1421 Text: string; 1423 1422 begin 1424 SetLength(AppEventsOptions, Length(AppEvents));1425 for I := 0 to High(AppEventsOptions) do begin1423 SetLength(AppEventsOptions, Length(AppEvents)); 1424 for I := 0 to High(AppEventsOptions) do begin 1426 1425 //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)); 1428 1428 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'); 1440 1440 // 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); 1444 1444 Include('FontSize', MessageFontTemp.Size, 8); 1445 1445 Include('FontName', MessageFontTemp.Name, 'MS Sans Serif'); 1446 1446 LoadFromRegistry; 1447 1447 MessageFont.Color := MessageFontTemp.Color; 1448 while Pos(',', MessageFontTemp.Style) >0 do begin1449 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); 1451 1451 if Text = 'Bold' then MessageFont.Style := MessageFont.Style + [fsBold]; 1452 1452 if Text = 'Italic' then MessageFont.Style := MessageFont.Style + [fsItalic]; … … 1467 1467 SetLength(AppUserEventsOptions, AppUserEventsCount); 1468 1468 SetLength(AppUserEvents, AppUserEventsCount); 1469 for I := 0 to AppUserEventsCount -1 do begin1469 for I := 0 to AppUserEventsCount - 1 do begin 1470 1470 //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)); 1472 1473 with AppUserEventsOptions[I], AppUserEvents[I] do begin 1473 1474 Update := UpdateOnly; … … 1476 1477 Include('ConditionUserEnable', ConditionUserEnable, ConditionUserEnable); 1477 1478 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); 1492 1493 LoadFromRegistry; 1493 1494 end; … … 1506 1507 Settings: string; 1507 1508 begin 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; 1511 1514 end; 1512 1515 … … 1514 1517 var InfoTip: String); 1515 1518 begin 1516 InfoTip := TUser(SunriseChatNetworkCore1.UserList[Item.Index]).DetailInfo;1519 InfoTip := TUser(SunriseChatNetworkCore1.UserList[Item.Index]).DetailInfo; 1517 1520 end; 1518 1521 … … 1526 1529 //if Pos(':',ComboBox1.Text) = 0 then 1527 1530 DoplnitJmeno; 1528 ComboBox1.SelStart := ComboBox1.SelStart + 1;1531 ComboBox1.SelStart := ComboBox1.SelStart + 1; 1529 1532 end; 1530 1533 … … 1554 1557 procedure TMainWindow.SearchFind1BeforeExecute(Sender: TObject); 1555 1558 begin 1556 SearchFind1.Dialog.Options := [frHideUpDown];1559 SearchFind1.Dialog.Options := [frHideUpDown]; 1557 1560 end; 1558 1561 … … 1562 1565 begin 1563 1566 with SunriseChatNetworkCore1 do begin 1564 for I := 0 to ActiveRoom.Count -1 do1567 for I := 0 to ActiveRoom.Count - 1 do 1565 1568 TRoomLine(ActiveRoom.Lines[I]).Font.Free; 1566 1569 ActiveRoom.Count := 0; … … 1694 1697 I: Integer; 1695 1698 begin 1696 ComboBox1.Style := csDropDown;1699 ComboBox1.Style := csDropDown; 1697 1700 with SunriseChatNetworkCore1, ComboBox1.Items do begin 1698 1701 BeginUpdate; 1699 1702 Clear; 1700 for I := 0 to UserList.Count -1 do with TUser(UserList[I]) do begin1701 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 + ': '); 1702 1705 end; 1703 1706 Update; 1704 1707 EndUpdate; 1705 if ComboBox1.Items.Count >0 then ComboBox1.DroppedDown:= True;1708 if ComboBox1.Items.Count > 0 then ComboBox1.DroppedDown:= True; 1706 1709 end; 1707 1710 end; … … 1714 1717 procedure TMainWindow.ComboBox1DropDown(Sender: TObject); 1715 1718 begin 1716 ComboBox1.Style := csSimple;1719 ComboBox1.Style := csSimple; 1717 1720 end; 1718 1721 1719 1722 procedure TMainWindow.ComboBox1CloseUp(Sender: TObject); 1720 1723 begin 1721 ComboBox1.Style := csSimple;1722 ComboBox1.SelStart := -1;1724 ComboBox1.Style := csSimple; 1725 ComboBox1.SelStart := -1; 1723 1726 end; 1724 1727 … … 1733 1736 begin 1734 1737 RichView1.Clear; 1735 for I := 0 to High(AppUserEvents) do1738 for I := 0 to High(AppUserEvents) do 1736 1739 if Assigned(AppUserEvents[I].Image) then FreeAndNil(AppUserEvents[I].Image); 1737 1740 TabControl1Change(Self); … … 1767 1770 Clear; 1768 1771 AddStrings(StringList); 1769 if Count >0 then DroppedDown:= True;1772 if Count > 0 then DroppedDown:= True; 1770 1773 Update; 1771 1774 EndUpdate; … … 1819 1822 SoundDisable := True; 1820 1823 SunriseChatNetworkCore1.SendCommand(scDisconnect); 1824 SunriseChatNetworkCore1.Free; 1821 1825 Options.Free; 1822 1826 for I := 0 to High(AppEvents) do
Note:
See TracChangeset
for help on using the changeset viewer.