15 Eylül 2020 Salı

 

Delphi'de String - Hex Dönüştürme Fonksiyonları:



// String türdeki ifadenin Hexdecimal türüne çevirilmesi aşağıdaki gibidir.

function StringToHex(S: String): string;

var I: Integer;

begin

  Result:= '';

  for I := 1 to length (S) do

    Result:= Result+IntToHex(ord(S[i]),2);

end;



// HexDecimal türdeki ifadenin String türüne çevirilmesi aşağıdaki gibidir.

function HexToString(H: String): String;

var I: Integer;

begin

  Result:= '';

  for I := 1 to length (H) div 2 do

    Result:= Result+Char(StrToInt('$'+Copy(H,(I-1)*2+1,2)));

end;


3 Eylül 2020 Perşembe

 Delphi'de cxGrid Türkçeleştirme:


 -    cxGrid filtreleme ve diğer özelliklerin türkçe olması için aşağıdaki unit' i kendi projenize ekleyebilirsiniz.

=============================&&&====================================

unit cxGridToTR;

interface

uses

 dxCore, cxGridStrs, cxFilterConsts,

  cxFilterControlStrs, cxClasses, cxGridPopupMenuConsts;

  procedure cxGridToTrk;

implementation

procedure cxGridToTrk;

begin

  { ******************************************************************** }

  { cxGridStrs }

  { ******************************************************************** }

  // scxGridRecursiveLevels = 'You cannot create recursive levels';

  cxSetResourceString(@scxGridRecursiveLevels,

    'Yinelemeli seviyeler oluşturamazsınız');

  // scxGridDeletingConfirmationCaption = 'Confirm';

  // cxSetResourceString(@scxGridDeletingConfirmationCaption, 'Onayla');

  // scxGridDeletingFocusedConfirmationText = 'Delete record?';

  cxSetResourceString(@scxGridDeletingFocusedConfirmationText,

    'Kayıt silinsin mi ?');

  // scxGridDeletingSelectedConfirmationText = 'Delete all selected records?';

  cxSetResourceString(@scxGridDeletingSelectedConfirmationText,

    'Seçili tüm kayıtlar silinsin mi ?');

  // scxGridNoDataInfoText = '<No data to display>';

  cxSetResourceString(@scxGridNoDataInfoText, '<Gösterilecek kayıt yok>');

  // scxGridNewItemRowInfoText = 'Click here to add a new row';

  cxSetResourceString(@scxGridNewItemRowInfoText,

    'Yeni satır eklemek için buraya tıklayın');

  // scxGridFilterIsEmpty = '<Filter is Empty>';

  cxSetResourceString(@scxGridFilterIsEmpty, '<Filtre boş>');

  // scxGridCustomizationFormCaption = 'Customization';

  cxSetResourceString(@scxGridCustomizationFormCaption, 'Özelleştirme');

  // scxGridCustomizationFormColumnsPageCaption = 'Columns';

  cxSetResourceString(@scxGridCustomizationFormColumnsPageCaption, 'Sütunlar');

  // scxGridGroupByBoxCaption = 'Drag a column header here to group by that column';

  cxSetResourceString(@scxGridGroupByBoxCaption,

    'Gruplamak istediğiniz kolonu buraya sürükleyin');

  // scxGridFilterCustomizeButtonCaption = 'Customize...';

  cxSetResourceString(@scxGridFilterCustomizeButtonCaption, 'Özelleştir');

  // scxGridColumnsQuickCustomizationHint = 'Click here to select visible columns';

  cxSetResourceString(@scxGridColumnsQuickCustomizationHint,

    'Görünür sütunları seçmek için tıklayın');

  // scxGridCustomizationFormBandsPageCaption = 'Bands';

  cxSetResourceString(@scxGridCustomizationFormBandsPageCaption, 'Bantlar');

  // scxGridBandsQuickCustomizationHint = 'Click here to select visible bands';

  cxSetResourceString(@scxGridBandsQuickCustomizationHint,

    'Görünür bantları seçmek için tıklayın');

  // scxGridCustomizationFormRowsPageCaption = 'Rows';

  cxSetResourceString(@scxGridCustomizationFormRowsPageCaption, 'Satırlar');

  // scxGridConverterIntermediaryMissing = 'Missing an intermediary component!'#13#10'Please add a %s component to the form.';

  cxSetResourceString(@scxGridConverterIntermediaryMissing,

    'Bulunamayan aracı bileşen!'#13#10'Lütfen bir %s bileşeni forma ekleyin.');

  // scxGridConverterNotExistGrid = 'cxGrid does not exist';

  cxSetResourceString(@scxGridConverterNotExistGrid, 'cxGrid yok');

  // scxGridConverterNotExistComponent = 'Component does not exist';

  cxSetResourceString(@scxGridConverterNotExistComponent, 'Bileşen yok');

  // scxImportErrorCaption = 'Import error';

  cxSetResourceString(@scxImportErrorCaption, 'İçe aktarım hatası');

  // scxNotExistGridView = 'Grid view does not exist';

  cxSetResourceString(@scxNotExistGridView, 'Grid görünümü yok');

  // scxNotExistGridLevel = 'Active grid level does not exist';

 // cxSetResourceString(@scxNotExistGridLevel, 'Geçerli grid seviyesi yok');

  // scxCantCreateExportOutputFile = 'Can''t create the export output file';

//  cxSetResourceString(@scxCantCreateExportOutputFile,'Dışa aktarılacak dosya oluşturulamıyor');

  // cxSEditRepositoryExtLookupComboBoxItem = 'ExtLookupComboBox|Represents an ultra-advanced lookup using the QuantumGrid as its drop down control';

  // scxGridChartValueHintFormat = '%s for %s is %s'; // series display text, category, value


  { ******************************************************************** }

  { cxFilterConsts }

  { ******************************************************************** }


  // // base operators

  // cxSFilterOperatorEqual = 'equals';

  cxSetResourceString(@cxSFilterOperatorEqual, 'eşit');

  // cxSFilterOperatorNotEqual = 'does not equal';

  cxSetResourceString(@cxSFilterOperatorNotEqual, 'eşit değil');

  // cxSFilterOperatorLess = 'is less than';

  cxSetResourceString(@cxSFilterOperatorLess, 'küçük');

  // cxSFilterOperatorLessEqual = 'is less than or equal to';

  cxSetResourceString(@cxSFilterOperatorLessEqual, 'küçük veya eşit');

  // cxSFilterOperatorGreater = 'is greater than';

  cxSetResourceString(@cxSFilterOperatorGreater, 'büyük');

  // cxSFilterOperatorGreaterEqual = 'is greater than or equal to';

  cxSetResourceString(@cxSFilterOperatorGreaterEqual, 'büyük veya eşit');

  // cxSFilterOperatorLike = 'like';

  cxSetResourceString(@cxSFilterOperatorLike, 'içerir');

  // cxSFilterOperatorNotLike = 'not like';

  cxSetResourceString(@cxSFilterOperatorNotLike, 'içermez');

  // cxSFilterOperatorBetween = 'between';

  cxSetResourceString(@cxSFilterOperatorBetween, 'arasında');

  // cxSFilterOperatorNotBetween = 'not between';

  cxSetResourceString(@cxSFilterOperatorNotBetween, 'arasında değil');

  // cxSFilterOperatorInList = 'in';

  cxSetResourceString(@cxSFilterOperatorInList, 'içinde olan');

  // cxSFilterOperatorNotInList = 'not in';

  cxSetResourceString(@cxSFilterOperatorNotInList, 'içinde olmayan');

  // cxSFilterOperatorYesterday = 'is yesterday';

  cxSetResourceString(@cxSFilterOperatorYesterday, 'dün');

  // cxSFilterOperatorToday = 'is today';

  cxSetResourceString(@cxSFilterOperatorToday, 'bugün');

  // cxSFilterOperatorTomorrow = 'is tomorrow';

  cxSetResourceString(@cxSFilterOperatorTomorrow, 'yarın');

  // cxSFilterOperatorLastWeek = 'is last week';

  cxSetResourceString(@cxSFilterOperatorLastWeek, 'geçen hafta');

  // cxSFilterOperatorLastMonth = 'is last month';

  cxSetResourceString(@cxSFilterOperatorLastMonth, 'geçen ay');

  // cxSFilterOperatorLastYear = 'is last year';

  cxSetResourceString(@cxSFilterOperatorLastYear, 'geçen sene');

  // cxSFilterOperatorThisWeek = 'is this week';

  cxSetResourceString(@cxSFilterOperatorThisWeek, 'bu hafta');

  // cxSFilterOperatorThisMonth = 'is this month';

  cxSetResourceString(@cxSFilterOperatorThisMonth, 'bu ay');

  // cxSFilterOperatorThisYear = 'is this year';

  cxSetResourceString(@cxSFilterOperatorThisYear, 'bu sene');

  // cxSFilterOperatorNextWeek = 'is next week';

  cxSetResourceString(@cxSFilterOperatorNextWeek, 'gelecek hafta');

  // cxSFilterOperatorNextMonth = 'is next month';

  cxSetResourceString(@cxSFilterOperatorNextMonth, 'gelecek ay');

  // cxSFilterOperatorNextYear = 'is next year';

  cxSetResourceString(@cxSFilterOperatorNextYear, 'gelecek sene');

  // cxSFilterAndCaption = 'and';

  cxSetResourceString(@cxSFilterAndCaption, 've');

  // cxSFilterOrCaption = 'or';

  cxSetResourceString(@cxSFilterOrCaption, 'veya');

  // cxSFilterNotCaption = 'not';

  cxSetResourceString(@cxSFilterNotCaption, 'değil');

  // cxSFilterBlankCaption = 'blank';

  cxSetResourceString(@cxSFilterBlankCaption, 'boş');

  // // derived

  // cxSFilterOperatorIsNull = 'is blank';

  cxSetResourceString(@cxSFilterOperatorIsNull, 'boşluk');

  // cxSFilterOperatorIsNotNull = 'is not blank';

  cxSetResourceString(@cxSFilterOperatorIsNotNull, 'boşluk değil');

  // cxSFilterOperatorBeginsWith = 'begins with';

  cxSetResourceString(@cxSFilterOperatorBeginsWith, 'ile başlayan');

  // cxSFilterOperatorDoesNotBeginWith = 'does not begin with';

  cxSetResourceString(@cxSFilterOperatorDoesNotBeginWith, 'ile başlamayan');

  // cxSFilterOperatorEndsWith = 'ends with';

  cxSetResourceString(@cxSFilterOperatorEndsWith, 'ile biten');

  // cxSFilterOperatorDoesNotEndWith = 'does not end with';

  cxSetResourceString(@cxSFilterOperatorDoesNotEndWith, 'ile bitmeyen');

  // cxSFilterOperatorContains = 'contains';

  cxSetResourceString(@cxSFilterOperatorContains, 'içeren');

  // cxSFilterOperatorDoesNotContain = 'does not contain';

  cxSetResourceString(@cxSFilterOperatorDoesNotContain, 'içermeyen');

  // // filter listbox's values

  // cxSFilterBoxAllCaption = '(All)';

  cxSetResourceString(@cxSFilterBoxAllCaption, 'Hepsi');

  // cxSFilterBoxCustomCaption = '(Custom...)';

  cxSetResourceString(@cxSFilterBoxCustomCaption, 'Özel...');

  // cxSFilterBoxBlanksCaption = '(Blanks)';

  cxSetResourceString(@cxSFilterBoxBlanksCaption, '(Boş olanlar)');

  // cxSFilterBoxNonBlanksCaption = '(NonBlanks)';

  cxSetResourceString(@cxSFilterBoxNonBlanksCaption, '(Boş olmayanlar)');


  { ******************************************************************** }

  { cxFilterControlStrs }

  { ******************************************************************** }


    // // cxFilterBoolOperator

    // cxSFilterBoolOperatorAnd = 'AND';        // all

    cxSetResourceString(@cxSFilterBoolOperatorAnd, 'VE');

    // cxSFilterBoolOperatorOr = 'OR';          // any

    cxSetResourceString(@cxSFilterBoolOperatorOr, 'VEYA');

    // cxSFilterBoolOperatorNotAnd = 'NOT AND'; // not all

    cxSetResourceString(@cxSFilterBoolOperatorNotAnd, 'VE DEĞİL');

    // cxSFilterBoolOperatorNotOr = 'NOT OR';   // not any

    cxSetResourceString(@cxSFilterBoolOperatorNotOr, 'VEYA DEĞİL');

    // //

    // cxSFilterRootButtonCaption = 'Filter';

    cxSetResourceString(@cxSFilterRootButtonCaption, 'Filtre');

    // cxSFilterAddCondition = 'Add &Condition';

    cxSetResourceString(@cxSFilterAddCondition, '&Koşul ekle');

    // cxSFilterAddGroup = 'Add &Group';

    cxSetResourceString(@cxSFilterAddGroup, '&Grup ekle');

    // cxSFilterRemoveRow = '&Remove Row';

   cxSetResourceString(@cxSFilterRemoveRow, '&Satır kaldır');

   // cxSFilterClearAll = 'Clear &All';

   cxSetResourceString(@cxSFilterClearAll, 'Hepsini &temizle');

    // cxSFilterFooterAddCondition = 'press the button to add a new condition';

    cxSetResourceString(@cxSFilterFooterAddCondition,

      'yeni koşul eklemek için tuşa basın');

    // cxSFilterGroupCaption = 'applies to the following conditions';

    cxSetResourceString(@cxSFilterGroupCaption, 'aşağıdaki koşulları uygulayın');

    // cxSFilterRootGroupCaption = '<root>';

    cxSetResourceString(@cxSFilterRootGroupCaption, '<kök>');

    // cxSFilterControlNullString = '<empty>';

    cxSetResourceString(@cxSFilterControlNullString, '<boş>');

    // cxSFilterErrorBuilding = 'Can''t build filter from source';

    cxSetResourceString(@cxSFilterErrorBuilding, 'Kaynaktan filtrelenemiyor');

    // //FilterDialog

    // cxSFilterDialogCaption = 'Custom Filter';

    cxSetResourceString(@cxSFilterDialogCaption, 'Özel filtre');

    // cxSFilterDialogInvalidValue = 'Invalid value';

    cxSetResourceString(@cxSFilterDialogInvalidValue, 'Geçersiz değer');

    // cxSFilterDialogUse = 'Use';

    cxSetResourceString(@cxSFilterDialogUse, 'Kullan');

    // cxSFilterDialogSingleCharacter = 'to represent any single character';

    cxSetResourceString(@cxSFilterDialogSingleCharacter,

      'tek karakteri temsil etmek için');

    // cxSFilterDialogCharactersSeries = 'to represent any series of characters';

    cxSetResourceString(@cxSFilterDialogCharactersSeries,

      'peş peşe karakterleri temsil etmek için');

    // cxSFilterDialogOperationAnd = 'AND';

    cxSetResourceString(@cxSFilterDialogOperationAnd, 'VE');

    // cxSFilterDialogOperationOr = 'OR';

    cxSetResourceString(@cxSFilterDialogOperationOr, 'VEYA');

    // cxSFilterDialogRows = 'Show rows where:';

    cxSetResourceString(@cxSFilterDialogRows, 'Satırları goster');    

    // // FilterControlDialog

    // cxSFilterControlDialogCaption = 'Filter builder';

    cxSetResourceString(@cxSFilterControlDialogCaption, 'Filtre hazırlayıcı');

    // cxSFilterControlDialogNewFile = 'untitled.flt';

    cxSetResourceString(@cxSFilterControlDialogNewFile, 'isimsiz.flt');

    // cxSFilterControlDialogOpenDialogCaption = 'Open an existing filter';

    cxSetResourceString(@cxSFilterControlDialogOpenDialogCaption, 'Filtre aç');

    // cxSFilterControlDialogSaveDialogCaption = 'Save the active filter to file';

    cxSetResourceString(@cxSFilterControlDialogSaveDialogCaption,

      'Geçerli filtreyi kaydet');

    // cxSFilterControlDialogActionSaveCaption = '&Save As...';

    cxSetResourceString(@cxSFilterControlDialogActionSaveCaption,

      '&Farklı kaydet');

    // cxSFilterControlDialogActionOpenCaption = '&Open...';

    cxSetResourceString(@cxSFilterControlDialogActionOpenCaption, '&Aç...');

    // cxSFilterControlDialogActionApplyCaption = '&Apply';

    cxSetResourceString(@cxSFilterControlDialogActionApplyCaption, '&Uygula');

    // cxSFilterControlDialogActionOkCaption = 'OK';

    cxSetResourceString(@cxSFilterControlDialogActionOkCaption, 'Tamam');

    // cxSFilterControlDialogActionCancelCaption = 'Cancel';

    cxSetResourceString(@cxSFilterControlDialogActionCancelCaption, 'İptal');

    // cxSFilterControlDialogFileExt = 'flt';

    // cxSFilterControlDialogFileFilter = 'Filters (*.flt)|*.flt';

    cxSetResourceString(@cxSFilterControlDialogFileFilter,

      'Filtreler (*.flt)|*.flt');


    // cxGridPopupMenuConsts

    cxSetResourceString(@cxSGridNone, 'Yok'); // 'None';

    cxSetResourceString(@cxSGridSortColumnAsc, 'Artan Sıralama');

    // 'Sort Ascending';

    cxSetResourceString(@cxSGridSortColumnDesc, 'Azalan Sıralama');

    // 'Sort Descending';

    cxSetResourceString(@cxSGridClearSorting, 'Sıralamayı Sil');

    // 'Clear Sorting';

    cxSetResourceString(@cxSGridGroupByThisField, 'Bu Alana Göre Grupla');

    // 'Group By This Field';

    cxSetResourceString(@cxSGridRemoveThisGroupItem, 'Gruplamayı Sil');

    // 'Remove from grouping';

    cxSetResourceString(@cxSGridGroupByBox, 'Gruplama Kutusu'); // 'Group By Box';

    cxSetResourceString(@cxSGridAlignmentSubMenu, 'Hizalama'); // 'Alignment';

    cxSetResourceString(@cxSGridAlignLeft, 'Sola Hizala'); // 'Align Left';

    cxSetResourceString(@cxSGridAlignRight, 'Sağa Hizala'); // 'Align Right';

    cxSetResourceString(@cxSGridAlignCenter, 'Ortalı Hizala'); // 'Align Center';

    cxSetResourceString(@cxSGridRemoveColumn, 'Sutunu Sil');

    // 'Remove This Column';

    cxSetResourceString(@cxSGridFieldChooser, 'Alan Seçiçi'); // 'Field Chooser';

    cxSetResourceString(@cxSGridBestFit, 'En Uygun Büyüklük'); // 'Best Fit';

    cxSetResourceString(@cxSGridBestFitAllColumns,

      'En Uygun Büyüklük(Bütün Sutunlar)'); // 'Best Fit (all columns)';

    cxSetResourceString(@cxSGridShowFooter, 'Alt'); // 'Footer';

    cxSetResourceString(@cxSGridShowGroupFooter, 'Grup Alt'); // 'Group Footers';

    cxSetResourceString(@cxSGridSumMenuItem, 'Toplam'); // 'Sum';

    cxSetResourceString(@cxSGridMinMenuItem, 'Minimum'); // 'Min';

    cxSetResourceString(@cxSGridMaxMenuItem, 'Maximum'); // 'Max';

    cxSetResourceString(@cxSGridCountMenuItem, 'Adet'); // 'Count';

    cxSetResourceString(@cxSGridAvgMenuItem, 'Avaraj'); // 'Average';

    cxSetResourceString(@cxSGridNoneMenuItem, 'Yok'); // 'None';

  end;

end.




2 Eylül 2020 Çarşamba


 Delphi'de Sayı Formatlama:

      

      Delphi'de tanımlanan veya girilen sayıların istenilen basamaklara bölünerek formatlanabilmesi için aşağıdaki yollardan biri kullanılabilir:


var

sayi:integer;
s:string;



sayi := 1234567;



label1.Caption:= Format('%.0n', [sayi*1.0]); // --> ' 1.234.567 '


veya


label1.Caption:= Format('%.0n', [sayi*1/0]); // --> ' 1.234.567 '


veya bir string değişkene bağlamak istersek, aşağıdaki formatlardan biri kullanılabilir;


 s := Format('%.0n', [I * 1.0]); // --> ' 1.234.567 '


 s := Format('%.0n', [I + 0.0]); // --> ' 1.234.567 '