none
July Challenge: Names Database RRS feed

  • General discussion

  • Hello evryboddy,

    here is my suggestion for a new challange:

    I edit the program "Names" (show XDP525).

    You can input firstname and lastname. Put the data in a database and show all data from the database.

    The Challange is:

    Expand the program for addresses, mp3-songs, sb-programs and so on.

     

     


    Best Regards Martin



    Friday, June 19, 2015 4:37 PM

All replies

  • Hello martmen,

    it's a nice idea to create little Databases in Small Basic with individual user interfaces.

    i.e.  a SB-Program-DB  like "Aquarium" for Amiga PD-FishDisk programs with an "select" regarding the application type.  SB can even start the exe-programs with LDProcess.Start().

    Now my problem: For a daily task list with simple input and deleting entries, the CPU-performance with 60% for the idleloop ist too high. Here i can find probably a solution by expanding the event-Subs.

    But for deleting an entry, i need a little bit support.

    How can I get the focus of the selected line in listView?

     

    Saturday, June 20, 2015 11:58 AM
  • Try LDControls.LastListViewRow to get the current (last selected row index).

    Based on what Martin was trying to do I have added a new control DataView uploaded to beta test version of extension.  It has a bit more flexibility than listview, especially for user editing.  See this post

    This is in addition to database bound (where an underlying SQL database controls the data, with listview and dataview controls mainly for viewing the resuts of SQL queries) in LDDataBase.

    Saturday, June 20, 2015 12:12 PM
    Moderator
  • Hello,

    thank's for the support. I must take another listview-type to select the rows. The font is not so nice, but it is SmallBasic like.

    Here is a demo for users, who are limited to framework 3.5 and Small Basic V1.0. It's a ToDoList Example and can be adapted for own applications:

    ... the screenshot was blocked ...
    ! Body text cannot contain images or links until we are able to verify your account.
                    --- I'm signed in !??!

    Newbies with too little points must  verify their account when they want use pictures or links in the reply !

    1. Import HZT191
    2. Remove the Autocomment for datFile (in last sub)
    3. Change for your application the defines  GraphicsWindow.Title, DataBaseFile, DataBaseTable,Column_1/2
    4. Create a SubDir and save there the SB-File ( xyz.SB )
    5. Run the Program and enter the first entry ( NEXT | SAVE )
    6. Improve the design and have fun!

    The program can be directly started with a link from  ( xyz.exe )  to the desktop.




    Saturday, July 11, 2015 7:10 PM
  • My DataBase-Demo for SB V1.2 and LD-Extension V1.2.9.

    Import Code: RTQ000

    New: Edit-Mode
            Preselectable Groups
          Nice Buttons
            Database handling with " ' "

     

    Small Tasks with Small Basic (+ Extension) !

    Thank You

    Tuesday, June 7, 2016 7:32 PM
  • @martmen

    Nice idea !

    I put my name in the database, and save it.:)

    Tuesday, June 7, 2016 10:54 PM
    Answerer
  • @backtothestart

    Nicest GUI, no boring buttons and much better overview and friendly look by skinning !
    Just an idea: instead of LDShapes.BrushGradient, LDShapes.BrushRoundedRectangle (drawing) and Shapes.SetOpacity, you could apply a LDShapes.BrushGradient (gradient brush) directly to a button with LDShapes.BrushShape, like:

    titles = "All,Organize,Fitness,Relax,Family,Inventory,Job,Finance,Study,Projects"
    arrTit = LDText.Split(titles, ",")
    
    grad[1] = "1=Gray;2=White;3=DimGray;"       '' orientation "V": top to bottom
    grad[2] = "1=Khaki;2=Yellow;3=Goldenrod;"
    grad[3] = "1=Sienna;2=Gold;3=Chocolate;"
    grad[4] = "1=Purple;2=Lavender;3=BlueViolet;"
    grad[5] = "1=Red;2=Pink;3=OrangeRed;"
    grad[6] = "1=Red;2=Tomato;3=Gold;"
    grad[7] = "1=Green;2=LightGreen;3=ForestGreen;"
    grad[8] = "1=Silver;2=WhiteSmoke;3=LightGray;"
    grad[9] = "1=Blue;2=LightBlue;3=DeepSkyBlue;"
    grad[10] = "1=DarkViolet;2=CornFlowerBlue;3=DarkOrchid;"
    
    '' add a random (3-cols) Gradient to see how that looks
    i = Array.GetItemCount(grad)+1
    For n = 1 To 3
      grad[i][n] = GraphicsWindow.GetRandomColor()
      arrTit[i] = "Random Gradient"
    EndFor
    
    '' finally init/show GW
    GraphicsWindow.BrushColor = "Black"
    For n = 1 To Array.GetItemCount(grad)
      btn[n] = Controls.AddButton(arrTit[n], 10,10 + (n-1)*36)  ' default h = 26 @ FontSize 12, FontBold
      Controls.SetSize(btn[n], 120,26)
      LDShapes.BrushShape(btn[n], LDShapes.BrushGradient(grad[n], "V"))
    EndFor
    'GraphicsWindow.Title = LDShapes.Width(btn[11])    '' init. 118, "Random Gradient"
    
    GraphicsWindow.MouseDown = OnMouseDown
    
    
    ' //////////  EVENT  \\\\\\\\\\
    Sub OnMouseDown
      For n = 1 To 10                   ' ignore btn[11]
        rnd = Math.GetRandomNumber(10)  ' ignore btn[11]
        If n <> rnd Then
          topN = LDShapes.GetTop(btn[n])
          Shapes.Move(btn[n], 10, LDShapes.GetTop(btn[rnd]))
          Shapes.Move(btn[rnd], 10, topN)
        EndIf
        Program.Delay(200)
      EndFor
    EndSub

    Wednesday, June 8, 2016 8:20 PM
    Answerer
  • Thanks Pappa for the comment and the helpful demo!

    Your code is the correct way to handle the buttons and the brush function... and is very effficient.

    The function "controls.hidecontrol(btn)" removes also the brush.

    When I see the many buttons, I think the suggestion for the next expert challenge is a 
    Breakout Game with a colored Button-Wall.

     

    Wednesday, June 8, 2016 10:21 PM
  • Alles klar 👍.
    Thursday, June 9, 2016 9:19 PM
    Answerer
  • @backtothestart

    For additional styling options you may want to take a look at latest LitDev_Test.zip version. Thanks LitDev, who added a new LDControls.SetButtonStyle method with brush/pen (un)pressed/MouseOver options !!

    Sunday, June 12, 2016 7:50 PM
    Answerer
  • Did a little demo with LitDev's nu 'SetButtonStyle' (also elliptical buttons supported now) and some animations. ID: LTF561.  

    The 4 used images are in following order below:1.) KaterMukke.png 2.) KaterHoop.png 3.) KaterMukke_480.png 4.) W7Orb.png.

       

     


    Monday, June 20, 2016 8:13 PM
    Answerer
  • Hard Challenge for Experts:

    1. Table Name with 1. Name and Lastname. Second Indices for Adress and Communications

    2. Table Adress with Street, housenumber, Postindex and City.

    3. Table Communications with telefonnumber, mobilenumber, faxnumber, E-Mail adress and Website.

    Notice: It is possible one Person more then 1 Adress and/or 1 Communications.


    Best Regards Martin


    • Edited by martmen Friday, July 8, 2016 8:54 AM
    Friday, July 8, 2016 8:51 AM
  • Show CKR085 for a dadabase sample with handle a adress table with FOREIGN KEY to the NAME table. To set the FOREIGN KEY in ADRESS table use SELECT count (*) FROM NAME.

    In this way you can later select the adress for a Person from NAME table.


    Show BFD177 it read the PRIMARY RESIDENCE from Caroline.

    Best Regards Martin




    • Edited by martmen Thursday, July 14, 2016 10:54 PM
    Thursday, July 14, 2016 9:52 PM
  • New Version of the MiniPersonalDatabase with actual Flickr-Access for Background:

    Import Code:  CVN122-0      MiniPersonalDatabase




    Sunday, August 18, 2019 4:26 PM