Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Jaume

  1. Thank you for the answer. I need to close Forms because i want to simulate a desktop as the forum samples. So when I close one application of the desktop i want to free all possible Forms that i won't use anymore. Jaume
  2. Hi, is there any way to check which Application forms are created to free them? The problem is that when i check this: if Form1 <> nil then Form1.close; The Form1 is always different of nil even if it's not created and then as soon as it makes Form1.close it creates Form1 to be able to close it. Thank you.
  3. My temporary solution for this last problem is this one: on the UniEvents beforeInit() of the Form 3: function window.beforeInit(sender) { sender.constrain = true; sender.constrainTo = Form2.form.uform.getEl(); sender.renderTo = Form2.form.uform.getEl(); } This makes the Form3 to be MDIChild of the Form 2. Other resize problems still happen, but at least this makes the MDIChild inside the MDIForm all the time, even after resize the MDIForm. With UNIGui MDIChild if you risize the MDIForm, sometimes MDIChild can be outside of MDIForm.
  4. I think something between 700$-1000$ it's correct. Anyway, i think UniGui has a lot of potential right now for the Delphi comunity. Developing real HTML/javascript Extjs and future ExtTouch from native pascal it's amazing. It breaks the actual walls of Embarcadero as they are not helping us much to have new good technologies. Honestly, i think Embarcadero should help Unigui. But I think this project must become more professional (Documentation,support, more developers to speedup bug fixing). You have a hungry comunity that could help a litle bit more to your project in many ways (economically/technical/support/etc...) but needs to be organized somehow.
  5. Another issue. If you have this Form creation: Form1 (fsNormal) -> creates Form2 (MDIForm) -> creates Form3 (MDIChild). Then Form3 is created without being inside of Form2, it's not a real child of his creator. I think that if MDIForm/MDIChild it's possible then it should be working as real form -> child. Thank you
  6. Also, if you resize the MDIForm the maximized MDIChild remains unresized. So you get a small MDIForm with big MDIChild that remains outside of his parent. Don't know if this must be considered a bug and posted in the bug forum with example?
  7. Hi, In the demo "uniGUI\Demos\MDI Forms" if you put a panel or ToolBar with align onTop on the MainForm, the two MDIChild forms are created on top of the panel, and it is not visible. This not happens on pure Delphi VCL. If you have a panel on a MDIFOrm all the MDIChilds are created on the remaining space. Is there in trick to achive this behaviour? I've tried ReCalculateAligns but doesn't work. Thank you.
  8. Finally a trick did the job. I would like to ask to Unigui developers why the first version did not worked, since i thought sender.plugins = [ ...] makes the plugin render inside the sender. Another thing i don't understand is why UniEvent AfterCreate is never triggered. If i write a console.log('Aftercreate') , the text is never shown. So i assume it's never triggered. So to make it work, i had to add to afterRender of the panel direct Extjs code, to add the Ribbon to the panel. Also i would like to ask to Unigui developers if this kind of code is recomendable, clean or if there is another way to do it. I assume that coding this Extjs code to a Unigui Component should be better, but for now i don't have the time to do Unigui components (also i assume that will have to guess a lot of things because there is not much documentation). ribbon2.rar
  9. Finally i have the plugin working: I attach a sample project if you want to try. There are 2 CustomeFiles, and all the code is inside the ClientEvent beforeinit of the UniPanel1. I have another issue now. I can't make the Ribbon menu render inside the Form. So if the Ribbon is rendered, the form isn't. It seems that the renderTo : Ext.getBody() makes the Ribbon to be outside the Form. But i can't make renderTo: MainForm or something like this, because it seems the MainForm is not created yet. Can you help me to make the Ribbon menu rendered inside the Form as the UniPanel1 is? Thank you. Ribbon.rar
  10. Anybody has a demo/example for this Ribbon Menu? I've found this Ribbon ExtJs plugin: http://www.sencha.com/forum/showthread.php?132811-Another-Ribbon-Style But i can't achieve to make it work in the a sample project. Can anybody help us? I know there is a Ribbon example in http://forums.unigui.com/index.php?/topic/3372-ribbons-demo/?hl=ribbon but i would like a example to make ExtJs plugins like this work in UniGui. Thank you.
  11. Jaume

    Free Form creation

    As a response to my old post, what should it be the best way to have a form like Delphi style? I mean, having a form created but not showed inside another form? As i do it right now, it's creating it, showing it and hidding it. This is the only way i have to avoid the "warning: Form must be shown after it is created". This makes all slower as i tested. If i don't show/hide the form, creating and showing the first form is like 2-3 seconds faster in my case. But for example in this case: I have a form where customers records are in a grid (Form_Customers) -> Then i have a search form to filter the customers inside Form_Customers. This search form has all the functions to generate the SQL code for the first form, so it must be created as the Form_Customers is created. This is the way i do it on Delphi, but I'm opened to other ways to do the same job but more efficient for UniGui. The inconvinient is that right now we don't have the documentation to understand why is slower, or what are the best practices for the Forms creations. That's why i need your help please.
  12. Anybody know something about it? Do I move this post to the Bug Reports / Feature Request? Thank you
  13. Hi, I have a problem with the onSetText Event of my datasets. When you have a UniDBEdit and you change its text, the onSetText Event of the linked dataset field is not triggered. I've tested it in VCL Delphi and it worked, but in UNIGUI the event is never triggered with the visual UniDB components. As it seems, the event is triggered when TField.text is changed, so maybe the UniDBEdit doesn't modify the TField.text of the linked field as the DBEdit does. Can you verify if it's a bug or you have planned to work as it is? Thank you very much. Jaume
  14. Jaume

    AlClient Align

    Ok, thank you. It works.
  15. Jaume

    AlClient Align

    Hi, I have a panel where i place some diferent frames depending of a button click. When i assign the frame align to "alclient", it doesn't do it, it's placed but not maximized to the size of the panel. This is the code i run on a click button of my Form form 1 of the frames: if frame1 = nil then begin frame1:= tframe1.create(self); frame1.Parent := self.panel1; frame1.Align := alclient; frame1.Visible := true; end; if frame1 <> nil then begin frame1.init(self.Handle,nil,nil); self.frame1.BringToFront; self.Menu:=self.frame1.Menu; end; frame1 is a private variable of the form and self.panel1 is alclient to this form. Also, as i mentioned in another post, self.Menu:=self.frame1.Menu doesn't work. You can't change the menu of a Form based on the active Frame as you can do in Delphi. Thank you very much
  16. Is SelectedRows implemented now? I comment it because there is this post that says it has a bug, but i don't see it implemented and can't use it: http://forums.unigui.com/index.php?/topic/2023-small-bug-in-chrome-19/?hl=selectedrow Is it going to be implemented or is there any way to get the selectedrows in a multiselect grid? Thank you
  17. Jaume

    Custom uniDBGrid

    I think this should work: function TMyUniDBGrid.SelectedField: TField; begin if ((CurrCol >= 0) and (CurrCol <= (Columns.Count-1))) then Result := Columns[CurrCol].Field else Result:= nil; end;
  18. Jaume

    Custom uniDBGrid

    I will try with this code right now: function TMyUniDBGrid.SelectedField: TField; begin Result := Columns[CurrCol].Field; end; I'll let you know if it works.
  19. Jaume

    Custom uniDBGrid

    Hi, i'm trying to implement my own TuniDBGrid, adding the SelectedField to it: The problem i have is that i can't find the default procedure AjaxEvent to override it: TMyUniDBGrid = class(TUniDBGrid) private fSelectedField : TField; //procedure AjaxEvent(Sender: TComponent;EventName: string; Params: TStrings); override; public constructor Create(Aowner :TComponent); override; published end; procedure Register; implementation procedure Register; begin RegisterComponents('MYUNIGUI', [TSGIUniDBGrid]); end; constructor TMyUniDBGrid.Create(AOwner: TComponent); begin inherited create(AOwner); //fSelectedField := Columns[GetCol].Field; end; function TMyUniDBGrid.SelectedField: TField; begin Result := fSelectedField; end; {procedure AjaxEvent(Sender: TComponent;EventName: string; Params: TStrings); begin inherited; if SameText(EventName, 'select') then fSelectedField := Columns[StrToInt(Params.Values['colindex'])].Field; end;} So how can i implement it without having to use the OnAjaxEvent procedure? Thank you very much.
  20. Thank you. That's a nice idea. I think this should work better for me.
  21. Hi, i'm using free forms, as i thought i could create the form when i wanted. When i tested it, I see that i can create it but it must be shown directly, it can't be shown after some pice of code or after some time. if i have a variable tform4: TUniForm4; in the private section of MainForm and i code this to a button of MainForm: procedure TMainForm.UniButton2Click(Sender: TObject); begin tform4:= TUniForm4.create(uniapplication); tform4.init(); end; I got this Warning: Form must be shown after it is created as a dialog. So can't i create a form a leave it created without showing it? Thank you very much.
  22. Thanks for the answer. Anyway, as i see I will have to re-code the funcion to every form. My aim was to code this: function Form.choose_city() : integer; var f_Cities: TCities; returnKey:integer; begin f_Cities := TCities.Create(nil); f_Cities.init(); f_Cities.ShowModal( procedure(result: Integer) begin returnKey:=result; //result already contains the value f_Cities.return_city_id; end); into a Unit and use it from multiple forms. But as I imagine, i can't do it with callbacks, so i will have to re-code the same pice of code in every form. If anyone has more ideas, please let me know. Thank you.
  23. Thank you. I've seen the demos before of course, but that is not what i asked for. If I translate this: function choose_city() : integer; var f_Cities: TCities; begin result:=0; f_Cities := TCities.Create(nil); if f_Cities.init() then begin if f_Cities.ShowModal = mrok then begin result:= f_Cities.return_city_id; end; end; f_Cities.free; end; for function choose_city() : integer; var f_Cities: TCities; begin result:=0; f_Cities := TCities.Create(nil); if f_Cities.init() then begin if f_Cities.ShowModal(procedure(Result:Integer) begin if Result = mrok then result:= f_Cities.return_city_id; end); end; end; this does not compile because in anonymus callbacks can't use the result of the funcion. So this makes the code not useful for a common purpose. So every time that i need to call choose_city i must re-code it again, but with the specific anonymous method. Also, if i do it without anonymous method, and passing the callback as a parameter to choose_city(), i can't use the f_Cities variable from the callback procedure. So i asked if there is any idea or stardard method to code this type of VCL style functions with WEB mode, as i'm not used to this. Thank you very much.
  24. Hi, in VCL I usually had this kind of function in units that allow me to had one block of code for opening showmodal forms that are used for select one row in a grid and return an ID. This block of code can be used for a lot of forms, so it's not repeted. For example: function choose_city() : integer; var f_Cities: TCities; begin result:=0; f_Cities := TCities.Create(nil); if f_Cities.init() then begin if f_Cities.ShowModal = mrok then begin result:= f_Cities.return_city_id; end; end; f_Cities.free; end; In WEB mode this can't be done, because showmodal is not blocking. So do i have to repete this code in every form for every callback? Is there any better sugestion to help to reproduce the same behaviour in WEB mode with common code? Thank you very much for your help.
  25. Hi, In delphi VCL i usually put the TUniMainMenu in the Frames, and then the form Menu property points to the Frame.Menu. When i do it in UNIGUI, the Menu is never shown in the Form. If i put a TUniMainMenu directly in the Form it does show, but it should be great if i could use the common frame Menu for every form that uses the Frame. Can this be done? Thank you.
  • Create New...