Модуль "Мое меню" (часть 19) - AddWebShortCuts
последняя версия: 3.0.9 build 961 beta
от 07 декабря 2007 г.
от 07 декабря 2007 г.
procedure TfrmP2K_MyMenu.AddWebShortCuts; var frmWebShortcuts: TfrmWebShortcuts; idx, i, j: integer; tmp: string;
begin try Screen.Cursor:= crHourGlass; frmWebShortcuts:= TfrmWebShortcuts.Create(Self); frmWebShortcuts.Caption:= p2k_mymenu_m_text_04; try frmWebShortcuts.edtMeMenuName.Text:= ''; frmWebShortcuts.spSkinEdit1.Text:= 'http://'; frmWebShortcuts.spSkinCheckRadioBox1.Checked:= false; frmWebShortcuts.ShowModal; if frmWebShortcuts.ModalResult = mrOk then begin tmp:= frmWebShortcuts.spSkinEdit1.Text; case xWebShortCutType of 0: begin idx:= High(xWebShortcuts) + 2; SetLength(xWebShortcuts, idx); xWebShortcuts[idx-1].AllowDelete:= integer(frmWebShortcuts.spSkinCheckRadioBox1.Checked); xWebShortcuts[idx-1].Visible:= $11; FillMemory(@xWebShortcuts[idx-1].Url, 1024, 0); for i:= 0 to length(tmp)-1 do xWebShortcuts[idx-1].Url[i]:= tmp[i+1]; end; 1: begin idx:= High(xWebShortcuts2) + 2; SetLength(xWebShortcuts2, idx); xWebShortcuts2[idx-1].AllowDelete:= integer(frmWebShortcuts.spSkinCheckRadioBox1.Checked); xWebShortcuts2[idx-1].Visible:= $11; FillMemory(@xWebShortcuts2[idx-1].Url, 2052, 0); for i:= 0 to length(tmp)-1 do xWebShortcuts2[idx-1].Url[i]:= tmp[i+1]; end; end; tmp:= frmWebShortcuts.edtMeMenuName.Text; tmp:= ASCI2UCS(tmp, true); i:= 1; for j:=1 to (length(tmp) div 2) do begin case xWebShortCutType of 0: xWebShortcuts[idx-1].Name[j-1]:= hex2int(Copy(tmp, i, 2)); 1: xWebShortcuts2[idx-1].Name[j-1]:= hex2int(Copy(tmp, i, 2)); end; inc(i,2); end; with spSkinListView2.Items.Add do begin SubItems.Add(frmWebShortcuts.edtMeMenuName.Text); SubItems.Add(frmWebShortcuts.spSkinEdit1.Text); tmp:= ''; if frmWebShortcuts.spSkinCheckRadioBox1.Checked then ImageIndex:= 1 else ImageIndex:= -1; Data:= Pointer(idx-1); end; case xWebShortCutType of 0 : WebShortcuts_applyChanges(xWebShortcuts); 1 : WebShortcuts_applyChanges(xWebShortcuts2); end; end; finally frmWebShortcuts.Free; end; finally Screen.Cursor:= crDefault; end; end;
Еще записи по теме
- Модуль "CategoryProp" (часть 1) - определение переменных и типов данных
- Модуль "Будильник" (часть 9)
- Модуль "Пункты меню" (часть 17) - GetMenuType
- Главный модуль программы (часть 33) - cbFlashPhoneProfileChange
- Модуль "Справочник" (часть 21) - EditContactEx
- Модуль "P2KApi" (часть 74) - TP2KAPI.FlashErase
- Модуль "Справочник" (часть 1) - определение переменных и типов данных
