Jump to content

Mauri

uniGUI Subscriber
  • Posts

    49
  • Joined

  • Last visited

Everything posted by Mauri

  1. The problem of using maxvalue is that it does not limit the amount of characters entered, only validates the range of values! I need to limit how many characters the user is typing! Would not have something through Javascript or something similar?
  2. I am using component TUniFormattedNumberEdit and would limit the typing characters (Similar to maxLength)! Is there a way to do this? Best Regards, Mauri Member ID: 00404
  3. Hi Farshad, Thanks for the reply, I will change the inheritance of my component!
  4. Worked perfectly !!! Congratulations you are very good technically and has a fantastic knowledge.
  5. I made a new component inherited from TUniEdit and would like to implement their own validation on the server side. Then on the server side when the onExit event is fired I want to validate some information and when some data is different from what I'm hoping I want the component stay with the red border showing that it is invalid. When invalid component should show the same color as the TUniNumberEdit component displays when the entered value is less than the MinValue property. unit ISComponetField; interface uses Classes, Vcl.Graphics, DesignIntf, Controls, DBCtrls, DB, UniGUIClasses, UniGUIInterfaces, uniGUICoreInterfaces, UniGUITypes, UniEdit; type TISField = class(TUniEdit) private ... procedure getExitEdit(Sender: TObject); ... protected procedure LoadCompleted; override; public ... published ... end; procedure Register; implementation procedure TISField.getExitEdit(Sender: TObject); var bValidate: boolean; begin bValidate:= true; // Here I will do all my validations ... if not bValidate then begin // Here I would like to call a method or change a property to display the field with a red border end; end; procedure TISField.LoadCompleted; begin inherited; OnExit:= getExitEdit; end; ... Best Regards, Mauri Member ID: 00404
  6. Farshad, The TISBase class is inherited from TUniPanel class. My new component inherits all the properties of a Panel (TUniPanel) and adds the data connection to display the Caption. Any ideas about the problem? 0 Quote MultiQuote Edit
  7. Farshad, I have modified my email to use the portal !!!
  8. The TISBase class is inherited from TUniPanel class. My new component inherits all the properties of a Panel (TUniPanel) and adds the data connection to display the Caption.
  9. I am creating a custom component and looked UniGUI other components to see the methods used to manipulate data for example TUniCustomDBComboBox, TUniCustomDBMemo! In all they have an assignment for InternalReadOnly variable (InternalReadOnly: = not AllowEdit) and also compared the variable 'SelfUpdating', but realized that this variable is in UniGUIClasses class. I have put this class in the uses clause and when compiling is showing the following messages: Undeclared identifier: 'InternalReadOnly' Undeclared identifier: 'SelfUpdating' What could be wrong? Examples where it is being using: unit ISComponet; interface uses Classes, Vcl.Graphics, DesignIntf, Controls, DBCtrls, DB, UniPanel, UniGUIClasses, UniGUIInterfaces, uniGUICoreInterfaces, UniGUITypes, UniDBUtils; type TISComb = class(TISBase, IUniDBControl) private ... procedure ActiveChange(Sender: TObject); ... protected procedure DataChange(Sender: TObject); virtual; ... public ... published ... end; procedure Register; implementation procedure TISComb.ActiveChange(Sender: TObject); begin if (not IsDesigning) and (not IsDestroying) then InternalReadOnly:= not AllowEdit; // Here give problem compiling end; procedure TISComb.DataChange(Sender: TObject); begin if SelfUpdating then // Here give problem compiling Exit; ... end; ... Best Regards, Mauri Member ID: 00404
  10. Thank you so much !!! It worked properly and it was just that I needed
  11. In my Delphi application I have a Memo component custom inherited from TCustomMemo class that has an implementation in onKeyPress method so that when the user clicks twice in a row the ENTER key the focus goes to the next component. TIDMemo = class(TCustomMemo) private ... fTabEnter: Boolean; fKeyAnt: Char; protected ... procedure KeyPress(var Key: Char); override; public ... published ... end; procedure TIDMemo.KeyPress(var Key: Char); begin if ((key = #13) and (fKeyAnt = #13) and fTabEnter) or ((key = #13) and (MaxLength > 0) and (length(Lines.Text) > MaxLength - 2) and fTabEnter) then if (Lines.Count > 0) then if (trim(Lines.Strings[Lines.Count - 1]) = '') or (length(Lines.Text) > MaxLength - 2) then begin key:= #0; inherited; if (trim(Lines.Strings[Lines.Count - 1]) = '') then key:= #8; keybd_event(9,0,0,0); // Triggers TAB Key exit; end; fKeyAnt:= Key; inherited; end;
  12. How trigger event on the keyboard? In Delphi I was like this: keybd_event (VK_TAB, 0,0,0); (Method unit WinApi.Windows) How can I have this same behavior in UniGUI, or shoot a keyboard event?
  13. worked perfectly !!! Thank you for your help
  14. I am using the version of 0.99.96.1328 UniGUI / Delphi XE6 and i using the component TUniDBLookupComboBox. The RemoteQuery property is set to true and when I type one component character triggers the OnRemoteQuery event properly. If I enter for example the word health component triggers the OnRemoteQuery event and shows the popup with the data returned from the query (OK!). The problem occurs when I return to the backspace key or I click on ClearButton button and it clears the search field ... if I type another word it triggers the event OnRemoteQuery correctly, but if I return to typing the same word have research ( as in the example the word health) OnRemoteQuery the event is not triggered. It seems that the component means that when the same word is typed it does not fire the event again! How can I initialize the component to always triggers OnRemoteQuery event ?
  15. Thank you so much for the reply ... I'll implement your suggestion !!!
  16. I need to create a component that has two columns like a grid, but within the TUniComboBox. How can I create two columns within the component? UniGUI 0.99.96.1328
  17. I am using the version of 0.99.96.1328 UniGUI / Delphi XE6 and created a new inherited component TUniDBLookupComboBox. I'm using the property clearbutton true and would like to execute a statement when the user clicks the X button (ClearButton). Is there any event that triggers the component when it is clicked the X (ClearButton)? How can I handle this event? Best Regards, Mauri
  18. I am starting to use the UniGUI framework and I'm creating a new child component inherited from TUniDBLookupComboBox. In this component I need some different behaviors and one of them is an additional research. I have this same component running on the VCL and it creates a query component in the component creation event, making it easier for the programmer does not need to add a TQuery component for each Lookup! I wonder if I can do this using UniGUI as reading the forum I realized that the data connection components need to be in specific places (MainDataModulo or Form)! I'm asking this because my component is giving a memory error and do not know if this is related to ownership of the built in component TQuery Best Regards Mauri Sample: ====== TDBLookup = class(TUniDBLookupComboBox) private fQuery: TSQLQuery; function SearchRecord: boolean; ... protected ... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; published ... end; procedure Register; implementation constructor TDBLookup.Create(AOwner: TComponent); begin inherited Create(AOwner); fQuery:= TSQLQuery.Create(Self); ... end; destructor TDBLookup.Destroy; begin try if Assigned(fQuery) then FreeAndNil(fQuery); finally ... end; inherited Destroy; end; function TDBLookup.SearchRecord: boolean; begin try fQuery.sql.text:= 'Select field from table where ...'; fQuery.open; ... finally end; end; procedure Register; begin RegisterComponents ('COMPS',[TDBLookup]); end; initialization finalization end.
×
×
  • Create New...