

CRO_Tomislav
Members-
Content Count
42 -
Joined
-
Last visited
Everything posted by CRO_Tomislav
-
I need a help. If I make a project with one form and two units a showed basic code is working ok. unit Prva; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Mask, Vcl.ExtCtrls, Vcl.DBCtrls; type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Druga; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Druga.Demo; end; end. unit Druga; interface uses Dialogs; function Demo:boolean; implementation uses Prva; function demo: boolean; begin ShowMessage(Form1.Edit1.Text); end; end. If I press a button on Form1 it run function in Druga.pas and show message with a text filled in Edit1 component. The problem is If I try to do the same thing with a Form and units which are in dynamic loaded bpl package. It doesn’t work. It seams that it can’t found a Form or component by its name… How to solve this? THX in advance
-
Share a data between two units in dynamic loaded BPL.
CRO_Tomislav replied to CRO_Tomislav's topic in VCL
Big THX to all of you !!! On a base of your information's/instruction's I manage to solve my problem... Perhaps a Delphi is not a such a scary tool… 😎 -
Share a data between two units in dynamic loaded BPL.
CRO_Tomislav replied to CRO_Tomislav's topic in VCL
THX -
Share a data between two units in dynamic loaded BPL.
CRO_Tomislav replied to CRO_Tomislav's topic in VCL
XML is not a problem, Accessing to Quer1 on MDI Form1 is a problem... Can You provide me an example for Application.Screen to access a Query1 on a MDI form Form1? -
Share a data between two units in dynamic loaded BPL.
CRO_Tomislav replied to CRO_Tomislav's topic in VCL
(Sub)Unit2 doesn't know for Form1 in code: ProfileID.Text := Form1.Query_User.FieldByName('userID').AsString; As my form is opened from package by menue item in Main form by: procedure TForm_Maom.Button1Click(Sender: TObject); var AClass :TFormClass; begin if not IsMDIChildOpen(Form_Glavna,'Form1') then begin if PackageModule <> 0 then begin AClass := TFormClass(GetClass('TForm1')); if AClass <> nil then TComponentClass(AClass).Create(Self); end; end; end; -
Share a data between two units in dynamic loaded BPL.
CRO_Tomislav replied to CRO_Tomislav's topic in VCL
This is intrested but; Exactly my goal is: I inherited a project in Delphi which has a huge units with a lot of code. Mostly of that code is used to create some XML files. Idea is to separate from this unit a code which is generate this XML files to separate units. But for do that I need to access from this (sub)units to Form and grab query results to populate this XML files or even modify and run a querys As this is doesn’t work "ProfileID.Text := Form1.Query_User.FieldByName('userID').AsString;" in a (sub)unit; do You have some idea what would be elegant solution for this? -
Dear all. I am looking for a way to read barcodes/QR codes with android phones. I search a web, looking on a zlib, TMS component, WinSoft component... Is it a good way to go with a zlib or should I buy some commercial component for reading a codes? Any suggestion? Is it some willing to share a simple working example/project of using a ZLib for Android phone? THX in advance Tom
-
As I am new to FireMonky and Android development, can You send me a modificated project aTestApp.? It will be a much easier for me to understand it so I can try to make my own... THX in advance Tomislav
-
It doesn't work on android, It keeps crashing up on app. start...
-
Dear all. I am new to FastReport and I have some basic issue with him… On a Delphi Form with others components I have a frxReport1. In that report, in a section of variables I create a new group of variables named MyVar. In that group I create 4 variables named: OSKAR_Month, OSKAR_Year, OSKAR_Days, OSKAR_Hours with default expressions. On a vcl form I have a button which has for test next code: with frxRbeport1 do begin Variables.Variables['OSKAR_Year']:= QuotedStr(IntToStr(YearOf(MonthCalendar1.Date))); Variables.Variables['OSKAR_Month']:= QuotedStr(FormatDateTime('mmmm',MonthCalendar1.Date)); Variables.Variables['OSKAR_Days']:= LabelData3.Caption; Variables.Variables['OSKAR_Hours']:= LabelData4.Caption; end; frxReport1.ShowReport(True); I am trying to transfer some simple variables or fixed tekst to report but this code doesn't work. Only OSKAR_Year is transferred. How to transfer this data to report? THX in advance Tomislav
-
Hello. It still didn't trasfer all varaibles fo frxReport1... When I rename variable OSKAR_Month in report... - it works! Thanks for help Tomislav
-
Dear all. I have two query in relation parent (Query1) - child (Query2) First query get data about of employees from table employees: id emply_name location _________________________ 1 Martin London 2 Matija Paris 3 Ana Ljubljana 4 Nikola Stuttgart Second query get data about weekly payments for each employee from table payment: id fk_id_emplyee date payment _____________________________________________ 1 1 2023-01-07 20,00 2 1 2023-01-14 15,00 3 1 2023-01-23 22,00 4 2 2023-01-07 18,00 5 3 2023-01-23 25,00 I am trying to in Query2 get summary record of payments for currently active record (employee) in DBGrid1 (Query1). Query1 SQL code: SELECT * FROM employees Query2 SQL code: SELECT id, fk_id_employee, date, payment FROM payment GROUP BY id UNION SELECT 'TOTAL', '','', sum(payment) as total_payment FROM payment ORDER BY date Problem is that which ever employee I select in DBGrid1, I always get total for all records in a tables payment. I need total only for currently active record (employee). THX in advance
-
Hi. Yes, I am using MasterSource porperty to connect Query2 to Query1. I inherited some Delphi projects and in those project’s I found a many Delphi forms where solutions of summarize columns is solved on that way which You describe... The SQL in Query2 I was recently found on a net and I get idea to reduce some things on a forms in project. As a Query2 didn't work in MasterSource property connected Query's - I was wonder what is the reason...
-
Programerdelphi2k: Thanks on replay but this is not what I am looking for: The result of Query2 for employee wizh id=1 shuld look like: id fk_id_emplyee date payment _____________________________________________ 1 1 2023-01-07 20,00 2 1 2023-01-14 15,00 TOTAL 35,00 Query1 and Query2 are parent-child related The SQL code works OK on a single table, if I try to use it on a child table - it does not. THX
-
Hi. Stano, I am try to learn... Please, can You please modify a Query2? THX
-
Hello. If I do not use GROUP BY id, I get listed all records from table payments. If I change Query2 in: SELECT id, fk_id_employee, date, payment FROM payment GROUP BY id UNION SELECT 'TOTAL', '','', sum(payment) as total_payment FROM payment WHERE fk_id_employee =mDBGrid1.DataSource.DataSet.FieldByName('id').AsString ORDER BY date I receive data from table payment for each active record in DBGrid1 (employee) related on parent-child but without totals. There is row which should be include TOTAL but a sum fileds are empty...
-
Dear all. I create one multi-device application, exactly for android phone. It is working and form is properly created for a specific model (Style: Android, View: Master) I would like to add a customized View for another device so I can adjust designe of app. forms and there is a problem. I can not do it. I try with a project – new custom view is not listed (tutorial on a net). I try by editing a DevicePersets.xml – also new custom view is not listed (tutorial on a net). After each method I restarted IDE but no results. When I do a second method, I check: Tools→ Options→ User interface → Form Designer → Device Manager; and I get listed a new device but when I open my project, on list of views not showed How to add customized device view? I need it for android device; Alcatel 5033f (480x960, ppi 215) Thx in advance Tomislav
-
Dear all. I am trying to migrate from Delphi VCL to Delphi Firemonky application. In VCL I am using several ManiMenus. In VCL form, on Show I have: Form_main.Menu := nil; Also in VCL, depending on which button is pressed I load certain MainMenu Form_main.Menu := MainMenu_Parts; I stuck in FMX with this because it handle MainMenu totally different. How I can do the same in FMX? Thanks in advance Tomislav
-
Hello. In VCL I used a dynamic loaded .bpl packages and open a forms inside this packages as a child forms. How to to that in Firemonky metropolis application? I have a project with a main form and a package. I can load dynamically needed package but in Firemonky there is no chid form type. In FireMonky I suppose that I can show a „chiled form” from a package in a layout of a MainForm (Master). With best regards Tomislav
-
Hi. I achieve the same effect by replacing MainMenu with MenuBar and set a Menubr.Visible := False and True. Is this OK or there is some elegant non complicated solution? 8) With best regards Tomislav
-
I have a Delphi project for an Android device. On a form I add UniConnection1,Uniquery1 and Edi1. I set up parameters for UniConnection and I can successfully connect do MariaDB On MariaDB I have a database encoded to UTF-8 In a code; when I make connection and use for example in UniQuery1: SELECT * FROM customers WHERE location='CROATIA' (I will receive only one record – it is OK) and when I assign in a code Edit1.Text := UniQuery1.FieldByName('customer_name').AsString; I see field contest in Edi1 without some special Croatian characters, for example 'š' I try to set UniCode = True, also with combination of setting character set = utf8; not show special characters... Exampl.: ... UniConnection1.Connect; If NOT uniConnection1.Connected then ShowMessage('#0 – NO CONNECTION TO DB!') else begin with UniQuery1 do begin Close; SQL.Clear; SQL.Text:= 'SELECT * FROM customers WHERE location=' + QuotedStr('CROATIA'); Open; end; Edit1.Text:=UniQuery1.FieldByName('').AsSring; end; ... Any idea? With best regards Tomislav
-
UniDac - UniConnection character set problem
CRO_Tomislav replied to CRO_Tomislav's topic in Cross-platform
Hello. Yes, table it has as charset and I use delphi 10.3.3. I make a clon of table and set it to cp1250 and now is ok... With best regards Tomislav -
UniDac - UniConnection character set problem
CRO_Tomislav replied to CRO_Tomislav's topic in Cross-platform
It is not working... -
Dear all. I need to develop small android application and I have a problem. Android version is 4.2.2. I use Delphi 10.3.3. I create project and I change in SDK Manager: NDK API LOCATION value to „andro-16“ and also on DELPHI NDK library path also to “andro-16” Also make modification of AndroidManifest.template.xml to android:minSDKVersion=”16” (Modification’s made on suggestion of Dave Nottage (BIG THX Dave!!!)) Now when I try to run project on attached device I get next error: I spend whole day to solve this without success. Please help because I am running out of time... With best regards Tomislav
-
Error: INSTALL_PARSE_FAILED_NO_CERTIFICATES
CRO_Tomislav replied to CRO_Tomislav's topic in Cross-platform
Hi. I already try that - nothing... But, I try with an onld cell phone with andro. version 4.4.4 and it is working... It seams that is a problem with Android 4.2.2. OR with Android device (MobiPrint3 POS) With best regards Tomislav