Jump to content
uniGUI Discussion Forums

erich.wanker

uniGUI Subscriber
  • Content Count

    578
  • Joined

  • Last visited

  • Days Won

    15

erich.wanker last won the day on February 6

erich.wanker had the most liked content!

Community Reputation

38 Excellent

About erich.wanker

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    Europe / Austria / Salzburger Land / Bad Hofgastein
  • Interests
    Delphi with uniGUI ;-)

Recent Profile Visitors

476 profile views
  1. Hello folks.. in the good old times of Delphi (Delphi3) where was a component called "DBCtrlgrid" Short description: it was like a Panel, where you can place DBImages, DBText, DBRadiobuttons, DBChceclboxes and so on .. you had to define just one panel ... and it was duplicated for every record in a tabel .. IT WAS WONDERFULL :-) is where a similar component out where? thanX Erich
  2. erich.wanker

    individual Columns in uniDBGrid

    i have tested it with just 10 - 15 columns ... and it works fine for me.. (before every menupoint change - i save the actual settings and load the settings of the new menu-point .. and i have no performance problems...)
  3. erich.wanker

    individual Columns in uniDBGrid

    ok ... got it :-) Found something simular in a lazarus forum ... and it works perfect :-) // // // Original Code found at: http://forum.lazarus.freepascal.org/index.php?topic=21705.0 // nice greetings .. erich procedure TV_FRAME_VERTRAG_STRUKTUR.StringExplode(s: string; Delimiter: string; Var res: TStringList); Begin res.Clear; res.Text := StringReplace(s, Delimiter, #13#10, [rfIgnoreCase, rfReplaceAll]); End; procedure TV_FRAME_VERTRAG_STRUKTUR.saveGridLayout(Mydbgrid: TuniDBGrid; fileName: string); var lines: TStringList; i: integer; my_visible:String; begin try lines := TStringList.Create; with Mydbgrid do begin for i := 0 to Mydbgrid.Columns.count-1 do begin if Mydbgrid.Columns.Visible = true then my_visible:='true' else my_visible:='false'; lines.Add( IntToStr(Mydbgrid.Columns.Index) + '~ ' + Mydbgrid.Columns.DisplayName + '~ ' + Mydbgrid.Columns.Title.Caption + '~ ' + IntToStr(Mydbgrid.Columns.Width) + '~ ' + my_visible ); end; end; lines.SaveToFile(fileName); finally lines.free; end; end; procedure TV_FRAME_VERTRAG_STRUKTUR.loadGridLayout(Mydbgrid: TuniDBGrid; fileName: string); var lines: TStringList; columnInfo: TStringList; lineCtr: integer; colIdx: integer; cnt: integer; begin try lines := TStringList.Create; columnInfo := TStringList.Create; lines.LoadFromFile(fileName); for lineCtr := 0 to lines.Count-1 do begin if trim(lines[lineCtr]) <> '' then begin StringExplode(lines[lineCtr], '~ ', columnInfo); cnt:=Mydbgrid.Columns.count; // go through all the columns, looking for the one we are currently working on for colIdx := 0 to cnt-1 do begin // once found, set its width and title, then its index (order) if Mydbgrid.Columns[colIdx].FieldName = columnInfo[1] then begin Mydbgrid.Columns[colIdx].Width := StrToInt(columnInfo[3]); Mydbgrid.Columns[colIdx].Title.Caption := columnInfo[2]; if columnInfo[4] = 'true' then Mydbgrid.Columns[colIdx].Visible := true else Mydbgrid.Columns[colIdx].Visible := false; // do the index assignment last! // ignore the index specified in the file. use its line Mydbgrid.Columns[colIdx].Index := lineCtr; //StrToInt(columnInfo[0]); order instead end; // if end; end; end; finally lines.free; if assigned(columnInfo) then columnInfo.free; end; end;
  4. erich.wanker

    Forgot  password

    ...send emails with Uigui? i use the indy components (included in delphi) uses ..... IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP, IdText, IdAttachmentFile, IdAttachment, uniMultiItem..... procedure Tsystem_mail.create_mail; var Msg: TIdMessage; Attachment: TIdAttachment; IdSMTP: TIdSMTP; TextPart: TIdText; my_mailtext:TStrings; HtmPart: TIdText; myEncoding : TEncoding; begin if ((UniMainModule.MAILKONTEN.FieldByName('BENUTZERNAME').AsString <> '') AND (UniMainModule.MAILKONTEN.FieldByName('SMTP').AsString <> '') AND (UniMainModule.MAILKONTEN.FieldByName('PORT_SMTP').AsString <> '') AND (UniMainModule.MAILKONTEN.FieldByName('KENNWORT').AsString <> '')) then begin try IdSMTP := TIdSMTP.Create(nil); idSMTP.Username :=UniMainModule.MAILKONTEN.FieldByName('BENUTZERNAME').AsString; idSMTP.Password :=UniMainModule.MAILKONTEN.FieldByName('KENNWORT').AsString; idSMTP.Host :=UniMainModule.MAILKONTEN.FieldByName('SMTP').AsString; idSMTP.Port :=UniMainModule.MAILKONTEN.FieldByName('PORT_SMTP').AsInteger; Msg := TIdMessage.Create(nil); Msg.From.address :=UniMainModule.MAILKONTEN.FieldByName('ANTWORTADRESSE').AsString;; Msg.Recipients.EMailAddresses := uniedit1.Text; Msg.CCList.EMailAddresses := uniedit4.Text; Msg.BccList.EMailAddresses := uniedit3.Text; Msg.Subject:= uniedit2.Text; Msg.ContentType := 'multipart/mixed; charset="utf-8"'; Msg.ClearBody; UniMainModule.ANHANG.First; if UniMainModule.ANHANG.recordcount > 0 then begin while not UniMainModule.ANHANG.Eof do begin if fileexists(UniMainModule.ANHANG.FieldByName('PFAD').AsString) then TIdAttachmentFile.Create(Msg.MessageParts, UniMainModule.ANHANG.FieldByName('PFAD').AsString); UniMainModule.ANHANG.next; end; end; // Anhang löschen UniMainModule.ANHANG.First; while not UniMainModule.ANHANG.Eof do begin UniMainModule.ANHANG.Delete; UniMainModule.ANHANG.First; end; if UniHTMLMemo1.Lines.Text <> '' then begin HtmPart := TIdText.Create(Msg.MessageParts, nil ); HtmPart.ContentType := 'text/html; charset="utf-8"'; htmpart.Body:=UniHTMLMemo1.Lines; end; try idSMTP.Connect(); idSMTP.Send(Msg); mainform.nachricht('eMail send ...'); except on e:Exception do ShowMessage('Message Error -> '+e.message); end; finally if idSMTP.Connected then idSMTP.Disconnect(); IdSMTP.Free; HtmPart.Free; Msg.MessageParts.Clear; Msg.Free; end; end else begin mainform.nachricht('Mailkonto ist nicht vollständig konfiguriert'); end; close; end;
  5. erich.wanker

    individual Columns in uniDBGrid

    Hello folks ;-) Question: How can i give a user following solution: Select fieldnames, what should shown in uniDBGrid at runtime... position change of colums at runtime save this settings - and Load this settings .. has someone a code sniple ??? ThanX Erich
  6. erich.wanker

    BroadcastChannel API

    ok... fuck ;-) .. works great :-) ... i played a little bit and it works .. *stunning* procedure TMainForm.create_Broadcast_and_listener; var event_name:String; begin event_name:='MENUE'; UniSession.AddJS('var messageReceiver= new BroadcastChannel("Consumer"); '); UniSession.AddJS('messageReceiver.onmessage = function(event) { ajaxRequest(MainForm.form,'''+event_name+''',[''param0=''+event.data+'''']); } '); end; procedure TMainForm.send_broadcast(event_data:String); begin UniSession.AddJS('var broadcaster = new BroadcastChannel("Consumer"); '); UniSession.AddJS('broadcaster.postMessage("'+event_data+'"); '); end; procedure TMainForm.UniFormCreate(Sender: TObject); begin create_Broadcast_and_listener; end; procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var parameter_0: String; begin parameter_0 := Params.Values['param0']; if EventName = 'MENUE' then begin showmessage(Params.Values['param0']); end; end; Button.onclick: send_broadcast('Hello World');
  7. erich.wanker

    BroadcastChannel API

    Hello, for my UniGui Desktop-Browser App - i search a way to communicate between 2 BrowserTabs ( 2 UniGui-Dll´s on same Domain) Has someone made something with BroadcastChannel API ? - has someone a example or a code snipple? ThanX Erich Demo: https://irekrog.github.io/broadcast-channel-api-simple-example/ Source: https://github.com/irekrog/broadcast-channel-api-simple-example
  8. erich.wanker

    Fly-out modal form from the right

    Hi gerhard.. http://api.jquery.com/animate/
  9. erich.wanker

    Fly-out modal form from the right

    Hi Dominique, i used tweenlite, but replaced it (to mutch problems..) i use now: unisession.AddJS(self.WebForm.JSName + '.animate( { duration: 700, to: { y: ' + inttostr(45) + ' } });'); works fine with components and Forms .. HTH Erich
  10. procedure TMainForm.UniFormCreate(Sender: TObject); var username_string:String; begin username_string :=UniApplication.Parameters.Values['user']; .. ?? is this what you search? HTH Erich
  11. erich.wanker

    Drag drop between 2 dbgrids

    i think you mean this: uniDBGrid - properties: i use a grid with checkboxes ... multiselect .. to find the selected records: s:='-1'; with UniDBGrid1.DataSource.DataSet do for i:=0 to UniDBGrid1.SelectedRows.Count-1 do begin GotoBookmark(UniDBGrid1.SelectedRows.Items); s:=s+','+ UniDBGrid1.DataSource.DataSet.FieldByName('INR').asstring; end; unimainmodule.markierte_anteile:= 'SELECT * FROM ANTEILE WHERE INR IN ('+s+')'; hth erich
  12. Hello .. Used Version: 1.50.0.1480 first of all a video ;-) of the ramdom Error "TUniCustomDBGrid.MoveToRow(): Unexpected Row number:" i dont find a reason or a solution ... ThanX for help or support unexpected_row_number.webm i have this problem which comes randomly ( i found no reason)... right unidbgrid = connected dataSource is "dliste" with dataset "liste" left unidbgrid = connected dataSource is "dstruktur1" with dataset "struktur1" procedure Tkunden_fakturieren.DSTRUKTUR1DataChange(Sender: TObject; Field: TField); var s:string; begin s:= STRUKTUR1.FieldByName('INR').asstring; if s='' then s:='-1'; liste.SQL.Clear; liste.SQL.Append('SELECT * FROM ANTEILE WHERE GUNST_INR = '+s+' AND MANDANT_INR = '+inttostr(unimainmodule.aktueller_mandant_nummer)+' AND FAKTURIERUNG_MONAT = '+#39+fakturierungsmonat+#39+' ORDER BY VERTRAG_NR desc '); liste.Open; the right uniDBGrid has following settings .. nothing special: object UniDBGrid1: TUniDBGrid AlignWithMargins = True Left = 11 Top = 128 Width = 458 Height = 407 Hint = '' Margins.Left = 10 Margins.Top = 10 Margins.Right = 10 Margins.Bottom = 10 ShowHint = True DataSource = Dliste Options = [dgTitles, dgRowSelect, dgCheckSelect, dgAlwaysShowSelection, dgConfirmDelete, dgMultiSelect, dgTabs, dgCancelOnExit] WebOptions.Paged = False WebOptions.PageSize = 50 Grouping.FieldName = 'BENUTZERGRUPPE' Grouping.FieldCaption = #220'bersicht' LoadMask.Enabled = False LoadMask.Message = 'Loading data...' BorderStyle = ubsNone StripeRows = False Align = alClient TabOrder = 4 Columns = < item FieldName = 'EINTRAG' Title.Caption = 'Entsch'#228'digung' Width = 150 Sortable = True end item FieldName = 'SUMME_NETTO' Title.Caption = 'Summe Netto' Width = 70 Sortable = True end item FieldName = 'VERTRAG_NAME' Title.Caption = 'Vertragsname' Width = 150 Sortable = True ImageOptions.Visible = True ImageOptions.Width = 16 ImageOptions.Height = 16 end item FieldName = 'INDEXNAME' Title.Caption = 'Index' Width = 150 Sortable = True end item FieldName = 'ZULETZT_FAKTURIERT' Title.Caption = 'Zuletzt fakturiert' Width = 100 Sortable = True end item FieldName = 'VERRECHNEN' Title.Caption = 'Verrechnen' Width = 100 Sortable = True end item FieldName = 'LEISTUNG_BEGINN' Title.Caption = 'Leistungsbeginn' Width = 100 Sortable = True end item FieldName = 'LEISTUNG_ENDE' Title.Caption = 'Leistungsende' Width = 150 Sortable = True end item FieldName = 'KATEGORIE' Title.Caption = 'Kategorie' Width = 64 Sortable = True end> end end end
  13. erich.wanker

    uniDBGrid1 - select all - with checkboxes

    PERFECT ! ThanX a lot :-)
  14. erich.wanker

    uniDBGrid1 - select all - with checkboxes

    Hi, i use 1.50.0.1480 .. i want that ALL checkboxes are checked (multiselect = true) in a unibdGrid after i make a "select * from table" actual i have this (with the posted code) but i want this:
  15. erich.wanker

    uniDBGrid1 - select all - with checkboxes

    after filtering a table - i want to select all records why does this not work? procedure Tkunden_fakturieren.DSTRUKTUR1DataChange(Sender: TObject; Field: TField); begin liste.SQL.Clear; liste.SQL.Append('SELECT * FROM ANTEILE WHERE GUNST_INR = '+STRUKTUR1.FieldByName('INR').asstring+' ORDER BY VERTRAG_NR desc '); liste.Open; UniDBGrid1.JSInterface.JSCall('getSelectionModel().selectAll', []); // i also tryed: UniSession.AddJS(UniDBGrid1.JSName + '.getSelectionModel().selectAll();'); end; .. just the focused record has a checked Checkbox Thanx for Help
×