Jump to content
uniGUI Discussion Forums

mierlp

uniGUI Subscriber
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by mierlp


  1. Hi Farshad,

    Maybe I am the only one, but I am experiencing some issues with the combination of uniTreeMenu and SourceMenu.

    1. when you crate a submenu in sourcemenu and set it to visible = false the text of this menu item will remain available, the submenu lines will be gone.
    2. set in runtime a menuitem in a sourcemenu to visible = false does not work and the menuitem remains visible
    3. set in runtime a menuitem in a sourcemenu to enabled = false does not work and the menuitem remains enabled
    4. assigning a different source menu at runtime does not work

    Tried points 2 and 3 with this code which i can't get working for what i need:

    Used the code form the link and created a separate procedure. Before calling the procedure i set a menuitem to visible = false
    and call the procedure. That doesn't work either and the menu option remains visible.

    I need to toggle menu items on or off in different places in my program based on the type of user. You will find many work-arounds but no concrete solution.
    You want to make a menuitem visible or enable, just like in a mainmenu or popmenu.

    Please improve the uniTreeMenu because there are more forum members having issues with it.

    I use Delphi 10.3.3. and 1.90.0.1534

    Regards Peter

     


  2. Hi


    My uniTreeMenu has default a SourceMenu attached.

    When the user select a certain menu option there must be 'loaded' and show a other SourceMenu to the uniTreeMenu, 
    so i use uniTreeMenu.SourceMenu:= uniMenu_Production.

    Now this new menu will be showed below the current menu....so which is not correct, and i try:

      UniTreeMenu.Items.clear
      UniTreeMenu.SourceMenu  := UniMenu_Production;
      UniTreeMenu.Refresh;
      UniTreeMenu.Repaint;

    The first line(uniTreeMenu.items.clear) gives me a error message 'TUniCustomTreeView: Node not foud, Id:4'
    Which is the menuitems the user clicks...so that's explainable.  

    Whats the correct way of switching sourcemenu's on runtime. I have looked on several topics, but non have the solutions

    Regards Peter

     

    • Like 1

  3. Try the following....

    • from mainform click '''Add record using form WITHOUT dbgrid'''
    • add 1-2 records from within this form
    • close that form
    • in the mainform click again '''Add record using form WITHOUT dbgrid'''
    • see what happends... 

    When you in this screen adding records is no problem that works correct.

    Only from within the mainform doing that...then it's going wrong

    This works always when using the button without a dbgrid'

     


  4. No

    Just use the buttons on the mainform to see the different behavior.

    When you click mainform.uniButton2 (WITH dbgrid) i must append a record
    and not set the focus to the dbgrid. In that case the append is canceld.


  5. Hi Sherzod,

    Attached a simple demo with:

    • main form
    • form1 (contains only dbedit)
    • form2 (contains dbedit + dbgrid)

    How to test :

    • on mainform click on button 'Add record using form WITHOUT dbgrid
      • the record will be append and the focus goes to the dbedit
    • on mainform click on button 'Add record using form WITH' dbgrid
      • the record will NOT be append and the focus goes to the dbgrid

    Do code on the buttons is both the same, only points to the other form

    Regards Peter

    testcase - dbgrid and append.zip


  6. Hi

    I have a form with a dbgrid and  button. This button calls a edit form AND appends a new record with this code:

      // Scherm aanroepen
      FormTableTypeAddressEdit.ShowModal;
    
      // Scherm aanroepen
      dmType.TypeAddress.Append;

    This works in all other 70 edit forms (these forms only have dbedits and no dbgrid).

    Now i have 10 forms which also contains a DBGRID (see attachment). When calling a form with a dbgrid using the code
    the focus automaticly goes to the dbgrid and there's NO record appended. When removing the dbgrid from this edit form it works.!!!!

    The button NIEUW is also for appending records, when i click this button the record will be append.

    Any suggestions?

    I use Delphi 10.3.3. / uniGui 1.90.0.1534 Professional

    msedge_KItTBaFEZG.png


  7. I use the code below in the servermodule (thanks to d.bernaert)

     

    procedure ExploreWeb(page:PChar);
    begin
      ShellExecute(0, 'open', page, nil, nil, 1);
    end;

    procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject);
    begin
     if ExtractFileExt(ExtractFileName(ParamStr(0)))='.exe' then
        ExploreWeb(pchar('http://localhost:'+ IntToStr(port)));
    end;


  8. procedure TMainForm.UniMemoChange(Sender: TObject);
    begin
      uniLabel_Char.Caption := IntToStr(Length(StringReplace(StringReplace(UniMemo. Lines.Text, #10, '', [rfReplaceAll]), #13, '', [rfReplaceAll])));
    end;

     

    sorry...wrong post


  9. Hi,


    You can use an onkeydown event from the editbox where the barcode is read.

      if (key = vk_return) then begin
     
         // Step 1:
         // Search the database using a filter or query and check the barcode
         // only occurs once with a record count
        
         // Step 2:
         // Now do what you want to do now that the barcode has been found
      
        // Step 3:
        // Clear the field and focus on the edit field
       end;


  10. Hi

    I was wondering if someone has a small example of some kind of room scheduling (database-aware)
    and would like to share. What it must do:

    • have a table with resources (roomID, Name, Seats)
    • have a table users (which can make a reservation)
    • calendar  (calendarID, ResourceID, StartDateTime, EndDateTime, UserID, Subject, Visitors)
    • view per resource, day, month view
    •  
×