With Delphi you can create your own applications for Mac OSX 64Bit and distribute them both via the Mac App Store and independently using the Developer ID distribution method. In this article we will see how to distribute an app through the “Notarization” procedure of the app to be able to distribute it independently, even…
Leggi tutto
Una nuova versione di smartFB, il tool rapido di gestione database Firebird e Interbase. Nuove features: Migliorata usabilità e piccoli ritocchi grafici Migliorata la gestione della creazione di database embedded Integrazione con libreria Xtumble4Delphi per la gestione da JSON a Delphi Record Iniziata implementazione di un tool che permetta di esportare/importare i dataset nei formati…
Leggi tutto
Highlights word in a RichView component programmatically:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
uses Winapi.RichEdit; procedure SetTextColor(oRichEdit : TRichEdit; sText : String; rAttributes : TTextAttributes); var iPos : Integer; iLen : Integer; Format: CHARFORMAT2; begin FillChar(Format, SizeOf(Format), 0); Format.cbSize := SizeOf(Format); Format.dwMask := CFM_BACKCOLOR; Format.crBackColor := rAttributes.BackColor; iPos := 0; iLen := Length(oRichEdit.Lines.Text) ; iPos := oRichEdit.FindText(sText, iPos, iLen, []); while iPos > -1 do begin oRichEdit.SelStart := iPos; oRichEdit.SelLength := Length(sText) ; oRichEdit.SelAttributes.Color := rAttributes.Font.Color; oRichEdit.SelAttributes.Size := rAttributes.Font.Size; oRichEdit.SelAttributes.Style := rAttributes.Font.Style; oRichEdit.SelAttributes.Name := rAttributes.Font.Name; oRichEdit.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(@Format)); iPos := oRichEdit.FindText(sText,iPos + Length(sText),iLen, []) ; end; end; |
How to highlitgh full cell in a DBGrid:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
procedure TfrmRuleCreator.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var mstr: String; I : Integer; currValue: string; begin currValue := Column.Field.AsString.ToUpper().Trim; if (Length(currValue) > 3)and(Column.Field.FieldName.ToUpper <> 'NOTE') then Begin If FDMemTable1.FieldByName('NOTE').AsString.ToUpper.IndexOf(currValue) <> -1 then Begin DBGrid1.Canvas.Brush.Color := clYellow; End End; if Column.Field.FieldName.ToUpper = 'NOTE' then DBGrid1.Canvas.Brush.Color := $00D7FFD7; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; |
TFormatsettings is record type in Delphi which is used to get or set local information’s like DateTimeFormat, CurrencyFormat, DecimalSeparator etc. wich is declared in System.SysUtils. For Example you need to retrive your current DecimalSeparator:
1 2 3 4 5 6 7 |
procedure TForm1.Button1Click(Sender: TObject); var fs: TFormatSettings; begin GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, fs); ShowMessage('Actual decimalseparato is:' + fs.DecimalSeparator); end; |
If you need to force some local settings for conversions you can do for example:
1 2 3 4 5 6 7 8 9 10 11 |
procedure TForm1.Button1Click(Sender: TObject); var myMoney : String; FS : TFormatSettings; myMoneyFloat: Extended; begin myMoney := '100000,66'; FS.DecimalSeparator := ','; myMoneyFloat := StrToFloat(myMoney,FS); ShowMessage('Your actual balance:' + myMoneyFloat.toString); end; |
If you want to…
Leggi tutto
Da oggi la piattaforma Xtumble si arricchisce di due nuove applicazioni per essere sempre piu’ smart e offrire un esperienza di utilizzo facile e senza vincoli: Magazzino e Comande. Nello specifico la app Magazzino (disponibile al momento solo per Android su play store qui ), che ti permette di classificare e ricercare i tuoi articoli…
Leggi tutto
When you try to use the camera component and you get “java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData (android.content.pm.PackageManager, java.lang.String)” only on “release” version of your application, probably you don’t have this setting to true: Check that the Project Options > Entitlements List > Secure File Sharing option is set to true. good job