⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainunit.pas

📁 Gestione Cellulari Nokia
💻 PAS
📖 第 1 页 / 共 4 页
字号:
begin
  case cmboCharSet.itemindex of
    0: lvSMS.Unicode_CharSet:= 0;
    1: lvSMS.Unicode_CharSet:= 1;
    2: lvSMS.Unicode_CharSet:= 2;
    3: lvSMS.Unicode_CharSet:= $80;
    4: lvSMS.Unicode_CharSet:= 129;
    5: lvSMS.Unicode_CharSet:= 134;
    6: lvSMS.Unicode_CharSet:= 136;
    7: lvSMS.Unicode_CharSet:= 255;
    8: lvSMS.Unicode_CharSet:= 130;
    9: lvSMS.Unicode_CharSet:= 177;
   10: lvSMS.Unicode_CharSet:= 178;
   11: lvSMS.Unicode_CharSet:= 161;
   12: lvSMS.Unicode_CharSet:= 162;
   13: lvSMS.Unicode_CharSet:= 163;
   14: lvSMS.Unicode_CharSet:= 222;
   15: lvSMS.Unicode_CharSet:= 238;
   16: lvSMS.Unicode_CharSet:= 204;
   17: lvSMS.Unicode_CharSet:= 77;
   18: lvSMS.Unicode_CharSet:= 186;
 end;

 LoadSMSMessages;
end;

procedure TfrmMain.CopyPhoneNumbertoClipboard1Click(Sender: TObject);
begin
  clipboard.HasFormat(CF_TEXT);
  clipboard.AsText:=lvPhoneBook.items[lvPhoneBook.Selected.Index].SubItems[0];
end;

procedure TfrmMain.FBUS1NewPIctureMessage(NewPIcture: Boolean);
begin
     if NewPicture then
        if messagedlg('You have receive a new message with a Picture. Do you want to view this now?',mtInformation, [mbYes,mbNo],0) = mryes then
           begin
             Notebook1.PageIndex:=6;
             FBUSLogoMgr1.ShowNewPictureMessage;
             txtPictureMessage.visible:=true;
             txtPictureMessage.text:='';
             txtPictureMessage.text:=FBUSLogoMgr1.MessageText;
           end;
end;

procedure TfrmMain.Button4Click(Sender: TObject);
var
   ListViewItem : TListItem;
begin
  lvNetworkInfo.items.clear;
  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Provider Name';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.NetworkCode);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Country';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.Country);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='SMS Center';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.SMSCenter);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Cell ID';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.CellID);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='LAC';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.LAC);

end;

procedure TfrmMain.Timer1Timer(Sender: TObject);
begin
     Timer1.enabled:=false;
     Button4Click(self);
end;

procedure TfrmMain.cmboLogoTypeClick(Sender: TObject);
begin
  case cmboLogoType.itemindex of
    0: begin DisableButtons;FBUSLogoMgr1.LogoType:=fbNoLogo;pnlHidden.visible:=false;end;
    1: begin EnableButtons;FBUSLogoMgr1.LogoType:=fbStartupLogo;pnlHidden.visible:=false;end;
    2: begin EnableButtons;FBUSLogoMgr1.LogoType:=fbOperatorLogo;pnlHidden.visible:=false;end;
    3: begin EnableButtons;FBUSLogoMgr1.LogoType:=fbCallerLogo;pnlHidden.visible:=false;end;
    4: begin EnableButtons;FBUSLogoMgr1.LogoType:=fbPictureMessage;pnlHidden.visible:=true;end;
  end;
end;

procedure TfrmMain.EnableButtons;
begin
  btnSendToPhone.enabled:=true;
  btnSaveLogo.enabled:=true;
  btnExport.enabled:=true;
  SendThruSMS.enabled:=true;
end;

procedure TfrmMain.DisableButtons;
begin
  btnSendToPhone.enabled:=false;
  btnSaveLogo.enabled:=false;
  btnExport.enabled:=false;
  SendThruSMS.enabled:=false;
end;

procedure TfrmMain.FBUSLogoEditor1Change(Sender: TObject);
begin
//  DisplayLogo.picture.bitmap:=FBUSLogoEditor1.drawbmp;
end;

procedure TfrmMain.FBUSLogoMgr1SentViaSMS(Sent: Boolean);
begin
 if Sent then
    messageDlg('The logo has successfully been sent',mtInformation,[mbOk],0)
  else
    messageDlg('The logo was not sent due to an error',mtInformation,[mbOk],0);
end;

procedure TfrmMain.tbPencilClick(Sender: TObject);
begin
  if Sender is TToolButton then
    FBUSLogoEditor1.DrawingTool := TDrawingTool (TToolButton (sender).Tag);
end;

procedure TfrmMain.Shape1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  FBUSLogoEditor1.DrawPen.color:=clBlack;
  FBUSLogoEditor1.DrawBrush.color:=clBlack;
  Shape1.Pen.color:=clFuchsia;
  Shape2.Pen.color:=$66CC66;
end;

procedure TfrmMain.Shape2MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  FBUSLogoEditor1.DrawPen.color:=$66CC66;
  FBUSLogoEditor1.DrawBrush.color:=$66CC66;
  Shape1.Pen.color:=clBlack;
  Shape2.Pen.color:=clFuchsia;
end;

procedure TfrmMain.tbTextClick(Sender: TObject);
var
  sText:String;
  fLogoText:TLogoText;
begin
  sText:=InputBox('Logo Text','Enter text to appear on logo','');
  if sText<>'' then
    begin
      if FontDialog1.execute then
        fFont:=FontDialog1.Font;
      fLogoText.fontName:=fFont.Name;
      fLogoText.fontsize:=fFont.size;
      fLogoText.text:=sText;

      FBUSLogoEditor1.LogoText:=fLogoText;
      FBUSLogoEditor1.DrawingTool :=dtText;

    end;
end;

procedure TfrmMain.tbUndoClick(Sender: TObject);
begin
  FBUSLogoEditor1.undo;
end;

procedure TfrmMain.tbRedoClick(Sender: TObject);
begin
  FBUSLogoEditor1.Redo;
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons0Click(Sender: TObject);
begin
  if fBus1.Connected then
    begin
      application.processmessages;
      lvPhoneBook.items.clear;
      FBus1.Phonebook.PopulateListView(TMemType(cmbpMemType.itemindex),lvPhoneBook);
      ShowPhoneBookUsage;
      ShowPhoneBookUsage;
      Notebook1.PageIndex:=1;
    end
  else
    Notebook1.PageIndex:=1;

end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons1Click(Sender: TObject);
begin
  LoadSMSMessages;
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons2Click(Sender: TObject);
begin
  NoteBook1.pageindex:=3;
  lblText.caption:='Speed Dial';
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons3Click(Sender: TObject);
begin
  NoteBook1.pageindex:=4;
  lblText.caption:='Ringtone';
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons4Click(Sender: TObject);
begin
  NoteBook1.pageindex:=6;
  lblText.caption:='Logo';
  tbPencilClick(tbPencil);
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons5Click(Sender: TObject);
begin
  NoteBook1.pageindex:=5;
  lblText.caption:='DTMF';
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons6Click(Sender: TObject);
begin
  NoteBook1.pageindex:=8;
  lblText.caption:='KeyPad';
  if Not fBus1.PhoneInfo.Sup_sendkeystroke then
      messagedlg('Sorry, keyboard emulation only works with Nokia 51xx/61xx phones',mtInformation,[mbOk],0);
end;

procedure TfrmMain.FourthShortcutBar1Panels0Buttons0Click(Sender: TObject);
begin
  NoteBook1.pageindex:=0;
  lblText.caption:='Phone Information';
end;

procedure TfrmMain.FourthShortcutBar1Panels1Buttons7Click(Sender: TObject);
begin
  NoteBook1.pageindex:=7;
  lblText.caption:='Net Monitor';
end;

procedure TfrmMain.Image3Click(Sender: TObject);
begin
  if fBus1.PhoneInfo.Sup_sendkeystroke then
    FBUS1.SendKeysPress((sender as TImage).hint)
  else
    messagedlg('Sorry your phone does not support keystrokes',mtInformation,[mbok],0);
end;

procedure TfrmMain.Notebook1PageChanged(Sender: TObject);
begin
  if notebook1.pageindex=4 then
    begin
      if fbus1.PhoneInfo.Total_Ringtones > 1 then
        btnClearRingtone.visible:=true
      else
        btnClearRingtone.visible:=false;
    end;

  if notebook1.pageindex=8 then
    begin
      cmboLogoType.itemIndex:=2;
      FBUSLogoEditor1.DisplayImage:=Image22;
      btnDownloadClick(self);
      image25.picture:=Image22.picture;
    end
  else
    begin
      FBUSLogoEditor1.DisplayImage:=DisplayLogo;
      FBUSLogoEditor1.ClearLogo;
    end;
end;

procedure TfrmMain.btnSiemensClick(Sender: TObject);
var
  sDest:String;
begin
  sDest:=Inputbox('Destination','Please enter the destination number','');
  if Trim(sDest) <> '' then
    if SaveDialog1.execute then
      fBus1.sms.SendSiemensOtaa(sDest,SaveDialog1.Filename,1,fbSMSClassNormal,false);
end;

procedure TfrmMain.PopulateListViews;
var
   ListViewItem : TListItem;
begin
  lvPhoneInfo.items.clear;

  ListViewItem:=lvPhoneInfo.items.add;
  ListViewItem.Caption:='IMEI';
  ListViewItem.Subitems.add(FBUS1.PhoneInfo.IMEI);

  ListViewItem:=lvPhoneInfo.items.add;
  ListViewItem.Caption:='SW Version';
  ListViewItem.Subitems.add(FBUS1.PhoneInfo.SWVersion);

  ListViewItem:=lvPhoneInfo.items.add;
  ListViewItem.Caption:='HW Version';
  ListViewItem.Subitems.add(FBUS1.PhoneInfo.HWVersion);

  ListViewItem:=lvPhoneInfo.items.add;
  ListViewItem.Caption:='Model';
  ListViewItem.Subitems.add(FBUS1.PhoneInfo.Model);

  ListViewItem:=lvPhoneInfo.items.add;
  ListViewItem.Caption:='Sw Date';
  ListViewItem.Subitems.add(FBUS1.PhoneInfo.SWDate);


  lvNetworkInfo.items.Clear;
  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Provider Name';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.NetworkCode);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Country';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.Country);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='SMS Center';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.SMSCenter);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='Cell ID';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.CellID);

  ListViewItem:=lvNetworkInfo.items.add;
  ListViewItem.Caption:='LAC';
  ListViewItem.Subitems.add(FBUS1.NetworkInfo.LAC);
end;

procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  txtPictureMessage.FREE;
end;

procedure TfrmMain.PopulatePhoneBookListView;
begin
  sendmessage(lvPhonebook.handle,WM_SetRedraw,0,0);
  lvPhonebook.items.clear;
  FBus1.Phonebook.PopulateListView(TMemType(cmbpMemType.itemindex),lvPhoneBook);
  sendmessage(lvPhonebook.handle,WM_SetRedraw,1,0);
end;
procedure TfrmMain.FBUS1CallInProgress(bCallInProgress: Boolean;
  CurrentCallNumber: String);
begin
  if bCallInProgress then
    MFBUSStatusBar1.Panels[1].text:='Call in Progress to : '+CurrentCallNumber
  else
    MFBUSStatusBar1.Panels[1].text:='';

end;

procedure TfrmMain.FBUS1PhoneCallStatus(iStatus: Integer);
var
  sStatus : string;
begin
  Case iStatus of
    // Shows most recent phone call activity
    0:MFBUSStatusBar1.Panels[2].text:='';       // nothing happened this session
    2:sStatus := 'Dialing ...';                 // dialing, other end did not answer yet
    3:sStatus := 'Call in progress';            // call in progress (i.e., there is an active voice connection)
    4:sStatus := 'Remote hung up';              // remote end hung up
    5:sStatus := 'Incoming call (unanswered)';  // incoming call, not yet answered
    7:sStatus := 'Incoming call (answered)';    // answered incoming call (will change to 3 when call in progress)
    9:sStatus := 'This end hung up';            // this end hung up
  End;

  MFBUSStatusBar1.Panels[2].text:=sStatus;
  application.processmessages;
  if iStatus in[4,9] then
    begin
      sleep(2000);
      MFBUSStatusBar1.Panels[2].text:='';
    end;
end;

procedure TfrmMain.ShowLogoFromBrowser(iIndex,iType:integer);
begin

  frmLogoBrowse.close;
  screen.cursor:=crHourGlass;
  Notebook1.pageindex:=6;
  FBUSLogoMgr1.Download(iType,iIndex);
  screen.cursor:=crDefault;
end;
procedure TfrmMain.tbCopyClick(Sender: TObject);
begin
    clipboard.Assign(DisplayLogo.picture);
end;

procedure TfrmMain.tbPasteClick(Sender: TObject);
begin
  if Clipboard.HasFormat(CF_BITMAP) then
     begin
       DisplayLogo.picture.Assign(Clipboard);
       FBUSLogoMgr1.makeLogoFromGraphic(DisplayLogo.picture.bitmap,TLogoType(cmboLogoType.itemindex));
     end;
end;

procedure TfrmMain.FBUSLogoMgr1SavedLogotToFile(SavedToFile: Boolean);
var
   sFileName:string;
begin
  if cmboLogoType.itemindex=4 then
    sFileName:='test.bmp'
  else
    sFileName:='test.nol';

  if SavedToFile then
    messagedlg('The logo has been saved to "c:\'+sFileName+'" by default',mtInformation,[mbOk],0)
  else
    messagedlg('There was an error saving the logo',mtWarning,[mbOk],0);
end;

procedure TfrmMain.btnClearRingtoneClick(Sender: TObject);
var
  iUploadPos:integer;
begin
  if fBus1.PhoneInfo.Total_Ringtones > 1 then
    begin
      application.createForm(TfrmUploadringtone,frmUploadringtone);
      frmUploadringtone.caption:='Clear Ringtone';
      frmUploadringtone.Label1.caption:='Please select the location to clear';
      iUploadPos:=frmUploadringtone.ShowForm;
      if (iUploadPos <> -1) then
        FBUS1.RingTone.Upload(True,iUploadPos);
      frmUploadringtone.free;
    end;

end;

procedure TfrmMain.Version1Click(Sender: TObject);
begin
     FBus1.Version;
end;

procedure TfrmMain.OtherComponentVersions1Click(Sender: TObject);
var
   creturn:char;
   msg:string;
begin
   creturn:=#10;
   msg:=msg+creturn+' ';
   msg:=msg+creturn+'Mobile FBUS Components';
   msg:=msg+creturn+' ';
   msg:=msg+creturn+'These Components are (c) Software Cave';
   msg:=msg+creturn+'';
   msg:=msg+creturn+'VERSIONS :-';
   msg:=msg+creturn+'***********';
   msg:=msg+creturn+'FBUS Logoeditor Version :- '+   FBUSLogoEditor1.Version;
   msg:=msg+creturn+'FBUS Logomanager Version :- '+FBUSLogoMgr1.Version;
   msg:=msg+creturn+'FBUS Open Dialog Version :- '+dlgOpenImageFile.Version;
   msg:=msg+creturn+'FBUS ListView Version :- '+lvSMS.Version;
   msg:=msg+creturn+'';
   msg:=msg+creturn+'';
   msg:=msg+creturn+'http://www.softwarecave.com';
   msg:=msg+creturn+'Email: info@softwarecave.com';
   messagedlg(msg,mtInformation,[mbOK],0);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -