Jump to content
uniGUI Discussion Forums


uniGUI Subscriber
  • Content Count

  • Joined

  • Last visited

  • Days Won


picyka last won the day on August 19 2019

picyka had the most liked content!

Community Reputation

11 Good

About picyka

  • Rank
    Active Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. picyka

    TUniChart Series Mouse Move and hint (tooltips)

    I discovered the solution function chart.beforeInit(sender, config) { if (config.series.length) { for (i = 0; i < config.series.length; i++) { config.series.tooltip = { trackMouse: true, width: 150, renderer: function(tip, item) { tip.setTitle(item.get('LL')); tip.update('Quantidade: ' + item.get('A')); console.log(item); } } } } }
  2. picyka

    TUniChart Series Mouse Move and hint (tooltips)

    The example is attached in that post, last pie chart .. http://forums.unigui.com/applications/core/interface/file/attachment.php?id=7854
  3. picyka

    TUniChart Series Mouse Move and hint (tooltips)

    Hello, I need to put tips on my charts, this example is cool, for example, pie chart or value field is undefined, did you fix it?
  4. picyka

    ToolTip for rows in UniDBGrid

    It is interesting when it doesn't show all the information in the column, it could be a property in the grid column.
  5. picyka

    UniGui não carrega no navegador

    Precisa instalar o runtime dele...
  6. picyka

    TUniDBListBox + Bootstrap 4 Card

    very good desgin!
  7. picyka

    Toolbar center grid...

  8. Hello. uniGMap.v.1.4.8.zip is no longer available for download. Is it possible to get the current link?
  9. picyka


    Any suggestion?
  10. You can add a search box!
  11. picyka

    UniDBLookupComboBox string color

    How would it look if you had a rule if campo.constain ('Active') verder else red
  12. picyka


    https://www.loom.com/share/2875684026c941f0b48831558c5c1c9d Note with UniTimer turned on, field search does not work properly
  13. picyka


    unit uniDBLookupComboBoxObject; interface uses System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, Data.DB, uniGUIBaseClasses, uniGUIClasses, uniMultiItem, uniComboBox, uniDBComboBox, uniDBLookupComboBox, Aurelius.Bind.Dataset, System.Variants, devsul.model.search, Aurelius.Criteria.Linq, Aurelius.Criteria.Base; type TUniDBLookupComboBoxObject = class(TUniDBLookupComboBox) private { Private declarations } FRequired: Boolean; FListSource, FDataSet: TAureliusDataset; FCriteriaListSource: TCriteria; FListValues: TStringList; procedure ExecuteSearch; protected { Protected declarations } FOldUniTriggerEvent: TUniTriggerEvent; FSearch: TSearch; procedure DoSetRemoteValue(AIndex: Integer; Value: string); override; procedure MyTriggerEvent(Sender: TUniCustomComboBox; AButtonId: Integer); procedure LoadCompleted; override; procedure _RemoteQuery(const QueryString: string; Result: TStrings); procedure _GetKeyValue(const Value: string; var KeyValue: Variant); public { Public declarations } constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure SetSearch(Search: TSearch); published { Published declarations } property Required: Boolean read FRequired write FRequired default False; end; procedure Register; implementation uses view.search.default, uniGUIApplication, Winapi.Windows; procedure Register; begin RegisterComponents('UniGUI Extension', [TUniDBLookupComboBoxObject]); end; { TUniDBLookupComboBoxObject } constructor TUniDBLookupComboBoxObject.Create(AOwner: TComponent); begin inherited Create(AOwner); end; destructor TUniDBLookupComboBoxObject.Destroy; begin if Assigned(Self.FSearch) then Self.FSearch.Free; if Assigned(Self.FListValues) then Self.FListValues.Free; if Assigned(Self.FCriteriaListSource) then Self.FCriteriaListSource.Free; if Assigned(Self.FListSource)then Self.FListSource.Free; inherited Destroy; end; procedure TUniDBLookupComboBoxObject.DoSetRemoteValue(AIndex: Integer; Value: string); begin inherited; if (VarIsNull(Self.KeyValue)) and (Assigned(Self.FDataSet)) then Self.FDataSet.EntityFieldByName(String(Self.DataField)).AsObject := nil; end; procedure TUniDBLookupComboBoxObject.ExecuteSearch; begin with TuniFormSearch.Create(UniApplication) do begin try ConfigureSearch(Self.FSearch); ShowModal; if ModalResult = mrOk then begin if Assigned(Selected) then begin Self.FListSource.Close; Self.FListSource.SetSourceObject(Selected); Self.FListSource.Open; if Assigned(Self.FDataSet) then Self.FDataSet.EntityFieldByName(Trim(String(Self.DataField))).AsObject := Selected; if Assigned(Self.OnSelect) then Self.OnSelect(Self); end; end; finally Free; end; Self.SetFocus; end; end; procedure TUniDBLookupComboBoxObject.LoadCompleted; begin if Self.Required then Self.ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config){Ext.apply(sender,{allowBlank:false,msgTarget : ''side''});}'; if Self.Triggers.Count = 0 then begin with Self.Triggers.Add do begin IconCls := 'x-form-search-trigger'; HandleClicks := True; Visible := True; end; end else begin Self.Triggers[0].IconCls := 'x-form-search-trigger'; Self.Triggers[0].HandleClicks := True; Self.Triggers[0].Visible := True; end; Self.FOldUniTriggerEvent := Self.OnTriggerEvent; OnTriggerEvent := Self.MyTriggerEvent; if Self.RemoteQuery then begin FListValues := TStringList.Create; Self.OnRemoteQuery := Self._RemoteQuery; Self.OnGetKeyValue := Self._GetKeyValue; end; inherited; end; procedure TUniDBLookupComboBoxObject.MyTriggerEvent(Sender: TUniCustomComboBox; AButtonId: Integer); begin if AButtonId = 0 then Self.ExecuteSearch; if Assigned(Self.FOldUniTriggerEvent) then Self.FOldUniTriggerEvent(Sender, AButtonId); end; procedure TUniDBLookupComboBoxObject._GetKeyValue(const Value: string; var KeyValue: Variant); var lObj: TObject; lIndex : Integer; begin KeyValue := Null; lObj := nil; if not Value.IsEmpty and not Self.FListSource.IsEmpty then begin if FListValues.Count = 0 then lObj := Self.FListSource.InternalList.Item(0) else begin lIndex := FListValues.IndexOf(Value); if lIndex <> -1 then lObj := Self.FListSource.InternalList.Item(lIndex); end; if Assigned(lObj) then KeyValue := Integer(lObj); end; end; procedure TUniDBLookupComboBoxObject._RemoteQuery(const QueryString: string; Result: TStrings); var lListFields: TStringList; i: Integer; lCriterion: TLinqExpression; lCustomCriteria: TCriteria; lStrListValue: String; begin if (Self.FCriteriaListSource <> nil) and (Trim(Self.Text) <> Trim(QueryString)) then begin lListFields := nil; try lListFields := TStringList.Create; lListFields.Text := Self.ListField.Replace(';', sLineBreak); lCustomCriteria := Self.FCriteriaListSource.Clone; lCriterion := Linq[lListFields[0]].Upper.Like(UpperCase(VarToStr(QueryString)) + '%'); lListFields.Delete(0); for i := 0 to lListFields.Count - 1 do if Self.FListSource.FieldByName(lListFields).Tag = 0 then lCriterion := lCriterion or (Linq[lListFields].Upper.Like('%' + UpperCase(VarToStr(QueryString)) + '%')); lCustomCriteria.Where(lCriterion); Self.FListSource.Close; Self.FListSource.SetSourceCriteria(lCustomCriteria, 25); Self.FListSource.Open; lListFields.Text := Self.ListField.Replace(';', sLineBreak); Self.FListValues.Clear; while not Self.FListSource.Eof do begin lStrListValue := EmptyStr; for i := 0 to lListFields.Count - 1 do begin if i = 0 then begin if Self.FListSource.FieldByName(lListFields).AsString <> '' then lStrListValue := Self.FListSource.FieldByName(lListFields).AsString end else begin if Self.FListSource.FieldByName(lListFields).AsString <> '' then lStrListValue := lStrListValue + ' - ' + Self.FListSource.FieldByName(lListFields).AsString; end; end; if not lStrListValue.IsEmpty then begin Result.Add(lStrListValue); Self.FListValues.Add(lStrListValue); end; Self.FListSource.Next; end; finally lListFields.Free; lCriterion := nil; end; end; end; procedure TUniDBLookupComboBoxObject.SetSearch(Search: TSearch); var lObject: TObject; begin Self.FSearch := Search; Self.FListSource := TAureliusDataset(Self.ListSource.Dataset); Self.FDataSet := TAureliusDataset(Self.DataSource.Dataset); Self.FCriteriaListSource := Search.Criteria.Clone; lObject := Self.FDataSet.EntityFieldByName(String(Self.DataField)).AsObject; if Assigned(lObject) then begin Self.FListSource.Close; Self.FListSource.SetSourceObject(lObject); Self.FListSource.Open; Self.KeyValue := Integer(lObject); Self.UpdateText; end; end; end.
  14. picyka


    The UniTimer only serves to update a label on the screen, showing the registration time of the registration, on this screen it has TUniDBLookupComboBoxObject components where internally it makes an automatic RemoteQuery, when the Unitimer is set with an Interval of 1000 the search on the component does not work correctly.
  15. picyka


    I'm creating a stopwatch in a registration frame, on this screen I have a component of mine, TUniDBLookupComboBoxObject = class (TUniDBLookupComboBox) I put a TUniTime to update a label, but when it is active, the lookup component stops working correctly, I was unable to simulate, only in the system. Any suggestion ?