Jump to content
uniGUI Discussion Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


sobakava last won the day on November 16 2015

sobakava had the most liked content!

Community Reputation

27 Excellent

About sobakava

  • Rank

Recent Profile Visitors

500 profile views
  1. UniForm2.Edit.Text := UnifForm1.Edit1.Text;
  2. sobakava

    Faster Database Access

    Thanks. I have just realized that, form_dm.MyTable8.Active := true; takes a lot of time. If I active the dataset at startup, of the application, the graph appears fast. But the startup of the application takes time. I'm using a server on Contabo running MySQL and MyDAC. What can cause this?
  3. sobakava

    Faster Database Access

    I'm trying to plot some data (real number) from my MySQL database using Highchart. This is how the database read routine looks like. I'm interested in showing last 100 data points. So, I'm activating the table, apply a filter to select only some specific data, then get the number of records found matching to the filter. Then, I'm moving database pointer to record number (total_records - 100) And in a loop, I'm reading the values. Then I'm passing this mydata[] serie to chart plot function. This loop runs for only 100 records but it is incredibly slow. (Loop itself takes ~10 seconds) How can I optimize this? ( I tried to fill the mydata with random numbers in a loop instead of reading them from database, it is almost instantaneous.) form_dm.MyTable8.Active := true; form_dm.MyTable8.Filtered := false; form_dm.MyTable8.Filter := '(flt_ddt_id = 22)'; form_dm.MyTable8.Filtered := true; form_dm.MyTable8.First; hm1_cnt := form_dm.MyTable8.RecordCount; if hm1_cnt > 100 then form_dm.MyTable8.RecNo := hm1_cnt - 100; if hm1_cnt > 0 then begin tx := 0; while ( not form_dm.MyTable8.Eof ) do begin tx := tx + 1; mydata[ tx ] := form_dm.MyTable8.FieldByName('flt_data').AsFloat; form_dm.MyTable8.Next; end; end;
  4. looks really nice and useful. thanks!!!
  5. sobakava

    Comport Kullanimi

    Selamlar. Kızdığım yok, eğer öyle anlaşıldıysa özür dilerim. Ben de Javascript'e halim değilim. Ama yolladığım linklere bakarsanız, bir Win32 makinede servis çalıştıracak yetenekte birinin, biraz inceleyip okuyarak kolayca altından kalkabileceği bir iş gibi gözüktü bana. Projenizde başarılar dilerim.
  6. sobakava

    Comport Kullanimi

    Daha önce de yazdım, bu işin unigui veya Delphi'de kullandığınız seri port bileşenleri ile zerre alakası yok. Hatta bunlar dünyada hiç yokmuş gibi düşünün. Sadece JavaScript ve Notepad var. Javascript kullanmanız gerekli veya Java applet'i kullanabilirsiniz. Javascript için bunu incelemenizi öneririm. https://github.com/garrows/browser-serialport Java için: https://code.google.com/p/java-simple-serial-connector/ Javascript ile yapılmış kütüphaneyi kullanarak bir HTML yapıp, browser'ı çalıştıran bilgisayarın seri portuna erişim sağlayabilirsiniz. Tekrar ediyorum bunun UniGui ile alakası yok. HTML dosyasını, kullanıcı ister flash diskten dosyaya çift tıklarayarak açsın ister bir TUNIHTMLFrame içinden erişsin... İşi yapan Javascript ve "yerel" browser.
  7. sobakava

    Error control other form control properties

    do you try to do this "before" the form2 is actually created? if you do this it is quite normal.
  8. there you go: http://forums.unigui.com/index.php?/topic/5982-tutorial-creating-custom-compound-components-for-unigui/
  9. I have created some UniGUI components for my project, in that way I can re-use the visual objects that I have implemented at ease. I just wanted to share my way of doing this with you guys. Any comments, technical critiques are welcome. 1. Creating the Component Package Since I have more than one custom components, I prefer to keep them in a Deplhi Package instead of individual self registering Delphi units. So we start with creating a component package in Delphi. File > New > Other > Delphi Projects > Package 2. Adding a TUNIFrame to The Package As the base of the components, I'm using TUNIFrame. We are going to add a TUNIFrame first. File > New > Other > Delphi Projects > uniGUI for Delphi > Frame 3. Adding Child Components Decorate your new TUNIFrame with existing UniGUI components as you wish. In this example, my frame looks like the picture below. I'm also renaming the frame. In this case the name is 'frame_myunipanel'. Don't forget to save unit files to disk. I named the files as unit_myunipanel. The visual object tree is shown below: And this is how the project tree looks like. I saved package with the name 'package_myunipanel'. I have only one unit; unit_myunipanel in the project tree. Our package has some dependencies: Right click on package_myunipanel.bpl > View Source from the pop-up menu. requires rtl, vcl, vclimg, dbrtl, soaprtl, vcldb, uIndy22, uniTools22, uniGUI22Core, uniGUI22, designide, uniGUI22Chart; contains unit_reg in 'unit_reg.pas', unit_myunipanel in 'unit_myunipanel.pas' {frame_myunipanel: TUniFrame}; 4. Adding The Registrar Unit To The Project At some point, we should tell Delphi to register our new component. We can do this in a plain Delphi unit. File > New > Other > Delphi Projects > Delphi Files > Unit Now we have a new unit in the package. I'm saving this unit as 'unit_reg.pas'. This is the final appearance of our package tree: Here is the tricky part, the registration. This is the unit_reg.pas. unit unit_reg; interface uses uniGUIFrame; procedure Register; implementation uses Classes, TreeIntf, unit_myunipanel; type TFrameClass = class of TUniFrame; procedure RegisterFramesAsComponents(const Page: string; const FrameClasses: array of TFrameClass); var FrameClass: TFrameClass; begin for FrameClass in FrameClasses do begin RegisterComponents(Page, [FrameClass]); RegisterSprigType(FrameClass, TComponentSprig); end; end; procedure Register; begin RegisterFramesAsComponents('UniGUI 3rd Party', [Tframe_myunipanel]); end; end. I did not add any published properties or methods to my panel yet. This is how the unit_myunipanel looks like. You can add properties and methods to your component just like you do with VCL units. unit unit_myunipanel; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIFrame, uniTrackBar, uniLabel, uniEdit, uniGUIBaseClasses, uniPanel; type Tframe_myunipanel = class(TUniFrame) UniContainerPanel1: TUniContainerPanel; UniEdit1: TUniEdit; UniLabel1: TUniLabel; UniTrackBar1: TUniTrackBar; private { Private declarations } public { Public declarations } end; implementation {$R *.dfm} end. 4. Installing the Component Right click on package_myunipanel.bpl > Install Voila! We are good to go. Now you can add this component to your UniGUI projects. PS: TreeIntf.pas is located in here: "c:\Program Files (x86)\Embarcadero\Studio\16.0\source\ToolsAPI\TreeIntf.pas" If your IDE can't find it, you might need to add it to your search path.
  10. sobakava

    How To Add CSS Attributes To The UniGui Components?

    I already tried it. Unfortunately it didn't help. Please let me know if you can get there.
  11. sobakava

    Transparent body TUniFrame possible?

    Now my drop shadow works perfectly. Thanks for the new version Farshad. (
  12. sobakava


    I think we are trying to do something similar. My posts here might help but it is not completely solved. I can show the custom tooltip but it is clipped by the parent divs (Tunipanel) if you place it in a Tunicontainerpanel on a form, it works. http://forums.unigui.com/index.php?/topic/5915-how-to-add-css-attributes-to-the-unigui-components/
  13. I have done it recently. I have created custom TUniFrame based compound components. I'll upload a tutorial about it soon.
  14. sobakava

    How To Add CSS Attributes To The UniGui Components?

    Well, my problem is turned into "How to make tooltips appear top of every other element in the page?" I decided that I can place my TUnipanels into TuniContainerPanels and add Javascript to TuniContainerPanel to activate this kind of fancy looking tooltips. But if the TUniContainerpanel is a child of another one, the tooltip becomes clipped by the surrounding panel.