Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Grid for data display

Author
Message
Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 22nd Jul 2022 21:15
First of all I want to thank everyone in advance: regardless of having a reply or not, those who read this post have already spent some time with me. Thank you very much.

I would like to know if there is any way to display data on the screen as if it were an Excel spreadsheet. In development in C# or another language with databases there is always a component called Grid or DBGrid or something similar. I searched but didn't find anything equivalent. I even searched a lot in the forum about grid but it's all related to the graphic grid.

My intention is to develop an app that loads data from a CSV and displays it on the screen as an Excel and that the user enters a number that performs a filter.

Any suggestions on how to approach the subject?

I'm new to AppGameKit, I started 1 week ago, but I've been developing systems for a long time, having already worked with Basic, dBase, Clipper, VB, Delphi, C#, etc. So why am I trying AppGameKit? Because I thought it was too fast for development. And since the application I want to develop is not that complex, I believe it would be very fast to develop on it.

Or do you think my approach is well outside the AppGameKit proposal?

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jul 2022 22:40 Edited at: 23rd Jul 2022 00:21
Quote: "do you think my approach is well outside the AppGameKit proposal?"

IMHO, nothing native in AppGameKit would help you do a basic spreadsheet-type app out of the box beside Arrays and creative use of Text objects.

any stylized formatting (from a basic cell outline on up), i image, would require sprites as a background for each cell if, for example, the cell widths could vary (otherwise, a single sprite containing a "grid" image as a background may suffice).

in short, displaying the contents of a 2D array in a grid pattern wouldn't be difficult; even one that could scroll beyond screen bounds.

but, more than that would require coding your own visual style, UI, etc,. i might be interested in it from a coding challenge perspective but AppGameKit is not ideal for such things.
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 23rd Jul 2022 00:18 Edited at: 23rd Jul 2022 00:40
might be something wrong with the cell selection (via point & click) and don't have time to sort it out ATM but i expect you could do something like:


use the arrowkeys to move around the data. point and click to pull cell data (selection MIGHT work fine. i tweaked a couple things but YMMV)

ie, this could be a starting point if you choose to take up the challenge
Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 24th Jul 2022 01:08
Virtual Nomad, thanks for your answers.

They've already given me a direction to follow.

But can I bother you a little more?

The AppGameKit website itself indicates an app published by the Play Store and one aspect of the layout caught my attention. The link is: https://play.google.com/store/apps/details?id=uk.co.focusmm.DTSCombo

Please name the image that has a relationship written "Voiceover". It has a list of options. Also in the "Learner Plan" image there is a list with options.

It is precisely the effect of these screens that I try to do: load a CSV with 3000 lines, the user enter a numerical code and filter the lines that meet this code and then display them as in the example images so that the user can choose an option .

Is that code snippet you posted for that? Or do the images suggest another approach?

Again, thanks a lot for your help.
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Jul 2022 01:42
Quote: "Is that code snippet you posted for that? Or do the images suggest another approach?"

the code offered is simply a method of reading a csv file and displaying a portion of it in grid form (your original inquiry) with simple navigation of said file contents. when i saw "Excel spreadsheet" i tried to emulate that.

otherwise, i don't see that in the Voiceover image (and i don't see a Learner Plan image but figure the Search image is along the same lines).

basically, you have a list of things and want to filter and display relevant data or search through it based on numerical input, right?

i'm struggling to imagine that mixed with the "Grid for data display"/Excel Spreadsheet notion.

can you share a few lines of the CSV and what the rows/columns represent to help me understand what you're trying to do?
smerf
17
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 24th Jul 2022 08:51
i guess the only way to do something like this would be to use a nested for loop that will generate a textboxes in a grid then u can have an array populated from the csv. apon applying the formula to the array u can update all the edit boxes. it should work like an excel spreadsheet minus the ability to select rows and columns

Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 25th Jul 2022 15:33
Quote: "basically, you have a list of things and want to filter and display relevant data or search through it based on numerical input, right?"


Yes, exactly that. Your link image was perfect: that's what I want to do.

In this example, when having many boxes with the result filtered, how would the screen scroll for the person to see all the available options?

Quote: "can you share a few lines of the CSV and what the rows/columns represent to help me understand what you're trying to do?"


I'm still structuring the CSV for my application. But basically it would be 4 columns: ID, item_number, item_name, path to the image that represents the item.

Then the person pressing the item would be taken to another screen where I would load all the details for that item.
Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 25th Jul 2022 15:43
Smerf,

Following this line of reasoning, two questions:

1 - Would this grid be scrollable so that the user could see all the options?

2 - Does the EditBox react to mouse click (or touch screen) so that I call up a second screen with the details of the selected item?
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Jul 2022 03:35 Edited at: 26th Jul 2022 05:33
This post has been marked by the post author as the answer.
i'm getting somewhere... CLICK ME

quick and dirty:


note this line:

so, when you go to search, you should enter a number in that range.

use the mousewheel to scroll through search results (for now) and click the result to direct to item details.

rinse and repeat (kinda... as it stands, it's not returning to search results which would be ideal).

hopefully you'll get the concept. i'm sure we can do what you're looking for.

more: if you want this on mobile, consider converting the data to .json where any sizable datafile like this (thousands of items/lines) is going to load much slower on mobile otherwise.

AGK arrays can cater directly to .json; see the bottom portion of this guide.

Attachments

Login to view attachments
Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 26th Jul 2022 11:52
That was exactly what I was looking for.

You were perfect!

Here in my country (Brazil) when someone does something well and completely we have a strange (and funny) idiom that says "killed the snake and showed the stick" which means that it solved the matter (killed the snake) and still showed how to do it well (he showed the stick that killed the snake).

You definitely "killed the snake and showed the stick".

Thank you so much!
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Jul 2022 12:22
it needs more work and could be more efficient but glad it helped.

enjoy
blink0k
Moderator
9
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Jul 2022 14:54
Nice work VN! Well done matey
Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Jul 2022 17:52
Here's a table example. Arrow keys resize table, mouse wheel scrolls. Room for lots of improvements/features.

Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Willian Lopes
User Offline
Joined: 21st Jul 2022
Location: Sertaozinho, SP, Brazil
Posted: 26th Jul 2022 19:26
Hello Phaelax.

Very interesting code! I'm going to use it along with the one from Virtual Nomad.

I believe I will now be able to start making progress on my project.

Thanks a lot for the help.

Login to post a reply

Server time is: 2022-08-09 08:38:31
Your offset time is: 2022-08-09 08:38:31