Jump to content

mierlp

uniGUI Subscriber
  • Posts

    572
  • Joined

  • Last visited

  • Days Won

    35

Posts posted by mierlp

  1. ​Hi

     

    I use a uniListbox for that with the following functions/code :

     

     

    function FindFiles(searchstr: string; list: TStrings): boolean;
     var
       hn: THandle;
       fd: WIN32_FIND_DATA;
     begin
       Result := False;
       hn := FindFirstFile(PChar(searchstr),fd);
       if hn <> INVALID_HANDLE_VALUE then begin
         Result := True;
         list.Add(StrPas(fd.cFileName));
         while FindNextFile(hn,fd) = True do
           list.Add(StrPas(fd.cFileName));
       end;
       Windows.FindClose(hn);
     end;

     

     

    On the form activate the uniLisbox is filled with the names of pdf files

    procedure TFormExplorAccreditation.UniFormActivate(Sender: TObject);
    begin
      UniListBox_Files.Items.Clear;
      FindFiles(uniServerModule.StartPath+'\files\pdf\'+'*.pdf',UniListBox_Files.Items);
    end;

    When the user double clicks on a file name you can use/do something  with the file, in this
    ​case a var will be used and gets the selected file name

         sSenderFILE  := UniListBox_files.Items[uniListBox_Files.ItemIndex];

    for extract the directory you can use ExtractFilePath function, but in you case you already know
    ​the directory name because you need the show the content of a given directory :)

    • Upvote 1
  2. Hi

     

    I restrict it by the limit of users in the user table There's a separate table for the configuration which contains :

    - company information

    - field for maxAllowedUsers

    - field for maxAllowedUsertSessions (how many session a user may start)

     

    The can't add more users in the user table as the maxAllowedUser value.

     

    I do all the checks at the user login and decide what to do:

    - when the maxAllowdUsers is reached

    - when the maxAllowdUserSessions is reached

     

    Now it's only a matter of controlling the parameters. For me it's working

     

    Regards Peter

  3. Hi,

     

    On my form there a several datasources. The every datasource has a onStateChange with the 
    ​following code to enable/disable buttons. This works like i want.

    procedure TFormTableProduction.dsProductionBasicDayStateChange(
      Sender: TObject);
    begin
        if dmProduction.ProductionBasicDay.State in [dsBrowse] then begin
           FormTableProductionDay.UniBitBtn_Add.Enabled    := True;
           FormTableProductionDay.UniBitBtn_Delete.Enabled := True;
           FormTableProductionDay.UniBitBtn_Save.Enabled   := False;
           FormTableProductionDay.UniBitBtn_Cancel.Enabled := False;
        end;
        if dmProduction.ProductionBasicDay.State in [dsInsert,dsEdit] then begin
           FormTableProductionDay.UniBitBtn_Add.Enabled    := False;
           FormTableProductionDay.UniBitBtn_Delete.Enabled := False;
           FormTableProductionDay.UniBitBtn_Save.Enabled   := True;
           FormTableProductionDay.UniBitBtn_Cancel.Enabled := True;
        end;
    end;

    Attached sample form. When the user hits the button with the (dutch) text 'Beheren productie dagen'

    then a second form will be opened for adding prodution days. Because the datasource for this table

    is also on the first form the buttons for addind/editing in this form  are not responding to the state.

     

    In the windows variant of the application i use :

      if ( Assigned( FormTableProductionDay ) ) then begin
    
       ...my code
      end;

    But in uniGui thats not working...how can i solve this?

     

     

     

     

     

     

    post-510-0-61769400-1503080787_thumb.png

  4. Hi

     

    Thanks for the tips...a working example is attached.

    BUT...one question 

     

    how to make it that the latest opened form is always on top.

     

    when i open form 1, i'ts on top...when opening form 2 after that
    it's NOT on top and only visible when closing form 1.

     

    AlywayOnTop is not working

    example1.zip

  5. Hi

     

    Finally i have my form design with non borders. Therefore i use on the form: UniEvents -> Window.BeforeInit with this code:

     

      config.baseCls='frmNoBorderRadius';
      config.cls='frmNoBorderRadius';
     
    That works good, see attachment 1
     
    When opening the first form, it is with NO border and just perfect. When i leave the form open and then
    open a second form...there is a border...see attachement 2 at the right and bottom border/shadow.
     
    When opening the first form and close it, and then open a second form...there's no problem/border..so thats good.
     
    I can reproduce it and when restarting the application than it works good, till i open 2 forms
     
    I use it with the Win10 theme. Other themes are having other problems with no borders and show som white
    marges left and at the bottom of the form
     
    What can cause this behavior and better how to solve it.
     
     
     
     
     

    post-510-0-05175700-1500115888_thumb.png

    post-510-0-12328500-1500115896_thumb.png

    post-510-0-88631300-1500115903_thumb.png

  6. hi

     

    When using a theme the most showmessage are displayed with a clBtnFace background
    instead of white. See attachement. The background of the text area is clBtnFace.

     

    The behavior of a showmessage depends on the theme you are using.

     

    How to change the background text area ?

     

    Regards Peter

     

     

    post-510-0-13975800-1499892089_thumb.png

  7. Hi

     

    How can i add other button languages to the SweetAlert. Is there a file which contains
    the translation or do i have the edit the UniSFSweetAlert

     

    I can change the Portugese value for Yes and No into the value for dutch

    but when selecting the language for the component i can choose from

    English and Potugese.

     

    And is itpossible to make the buttons same size/length

     

    Regards Peter

  8. Hi,

     

    I was wondering how you facilitate report design for your application. For my new application
    there will be 10 standard (Fast) reports.

     

    I use FastReport and you can't use the designer with uniGui. Do you create a Windows application
    which contains the same dataset/fields and design the report and when it's ready upload to the server ?

     

    Or how do you facilitate ?

     

    Regards Peter

     

     

  9. hi

     

    I'm still struggling with the opening and positioning of a panel...and there is a difference
    between opening at the onCreateEvent of the Mainform and calling it with by code

     

    I have build :

    • ServerModule.MainFormDisplay - mfPage
    • FormMain as Main form and menu
    • FormTableEvents with no borders and layout = fit .........that works
    • When you start the application i created a FormMain.OnCreateEvent with the following code :


      FormTableEvents.Parent  := Self;
      FormTableEvents.Show();

     

     This is opening the form and places the panel directly in the center ....that works

     

    BUT

    • When you close this form and then click on the menu button 'Tabellen' and 'Evenementen' (sorry it's dutch language)
      the form will be opened but the panel starts at the left site and is then centered

    I did try some things like :

     

    • AlignmentControl = uniAlignmentServer but the the panel is also resized of the full width
    • Layout = several options but not working for what i need

     

    Has anyone suggestions or is this a bug or do i need to build it otherways. The reason why i

    build it this way is you don't have borders showing of the form.

     

    Regards Peter

     

    mijnSeminar.zip

  10. Hi

     

    For a new application i'm going to try it building in uniGui. A lot of web application i see are using

    the full width of the browser...sometimes that looks oke but sometimes it's uggly. I have lots of forms
    which contains a dbgrid, dbnavigator en 3 fields because these are lookup tables. Design them over

    the full with doesn't look beautifull.

     

    So may question is...what's you're approach for design you web application, see examples which

    i quickly draw with Pencil. (great tool for quick design mock-up for a customer)

     

    Regards Peter

    post-510-0-96475700-1491651633_thumb.jpg

    post-510-0-04637100-1491651636_thumb.jpg

×
×
  • Create New...