display objects algorithm - algorithm

I have array of graphic icons. Every Icon has property level and time. I need to create graphic representation of this icons by some rules.
Every icon with same time should be in same column.
They have to be in columns sorted by levels in groups by ten. For example icon with property level 5 and property level 6 will be in first column in first and second row. Icons with level 11 and 12 with diferent time will be in second column but in 3th and 4th row.
EXAMPLE:
time 1 5 7
group 10-19 icon icon
- icon
group 20-29 icon icon
- icon
group 30-39 iconX
In example above iconX have property level 35 and time property 1.
I have been thinking a lot of time about it but really dont know how to solve it?
Do you have any idea how to solve it ? What should be best practice for this ?
Thank you in advance

Related

Control won't span 2 rows in FireMonkey GridPanelLayout

I'm working in Rad Studio C++ (Tokyo 10.2.3). I have a FM form with a TGridPanelLayout control on it with 2 rows & 2 cols. I have two listboxes and a memo field that I want arranged like this:
Under the GridPanelLayout's ControlCollection I have col 0 set with RowSpan 2.
It works perfectly in Windows and ListBox1 fills up entire left half of the Grid. In IOS on iPhone ListBox1 only fills up top left cell.
What is the trick to making this function correctly on IOS like it does in Win32? I tested it on Android and it works correctly so this is just an IOS related bug.
I saw this related post (Why won't controls span multiple columns or rows in an Android FireMonkey app? about similar issue on Android) but I can't figure out how to solve my case.
Ok, it looks like the bugs referenced above are still in play. To solve this I put a 2 column 1 row GridPanelLayout control down. In the left column I put my ListBox1 and set it to align to Client. In the right column I put another GridPanelLayout control and set it to have 1 column and 2 rows. In it's top row I put ListBox2 and in bottom row Memo1 - setting both to align to Client.
The only confusion in this approach was that Rad Studio as insisting on the second GridPanelLayout go into the leftmost column. I finally figured out to click on that columns control item and then click the "Control" pulldown and set it to ListBox1. Do the same for the other one so it's Control will be the second GridPanelLayout.

SSRS Indicator by Date Condition

I'm new to SSRS reporting and having some problems with indicators. I am trying to use an indicator to show how long a reservation has been open based on the number of days between the current date and the RequirementDate (which is a field in the dataset).
What I want logically is this:
If number of days is less than 6 months old, show green
If number of days is between 6 months and 8 months, show yellow
If number of days is greater than 8 months, show red
Also, I'm not sure where I would enter this kind of formula, as I am doing this from the Indicator Properties window.
To set these options go into the indicator properties. The easiest way to do this is to right click on the center of the indicator and click Indicator Properties. Then click on Value and States.
Setting the Green, Yellow, and Red ranges is straight forward for your use case. Just fill in the start and end values with the range of days you want. To set the expression you want for the value click on the fx button next to the value field and use an expression like this one to calculate the days between a date and report runtime.
=DateDiff(DateInterval.Day, Max(Fields!RequirementDate.Value), Now())

SSRS date and scroll bar issues

Wondering if someone can advise on the following please:
In SSRS I have a date from and date to parameter - If I enter a date where the year is less than 30 it will prefix it with 20 I.E 01/01/19 and tab off will change it to 01/01/2019 but when we enter a date with a year of 30 or later it prefixes it with 19 so 01/01/30 changes to 01/01/1930.
As this report will always be in the 2000 - 2999 range they have requested that when you enter the year and tab off it always prefixes it with 20. Is there a way to do this?
What and where is the default width and height of the SSRS portal? For some reason when this loads it has the scroll bars on the side and bottom. This doesn't look too great and also when a report loads that has scroll bars on the report the IE scroll bars hide them so you have to move those up and down to get to the report scroll bar if that makes sense? The users are hating this.
I understand I can manually zoom in and out to make the page fit, but that isn't a solution for everyone using these reports, they will become frustrated. They aren't being used on small monitors either so shouldn't need to load with a scroll bar on the actual screen.
There's not an easy way to change the behavior of the date box. You could change your date parameter to a text field and handle the formatting when you use it. It wouldn't change when they type though.
WHERE D_DATE = CAST( CASE WHEN LEN(#DATE_PARAM) = 8 THEN LEFT(#DATE_PARAM, 6) + '20' + RIGHT(#DATE_PARAM, 2) ELSE #DATE_PARAM END
As far as the scroll bars, does your report have extra space in design mode? You can control that by grabbing the right or bottom edge and making it smaller or using the Page Size property of the report. There is also an Interactive Size property that may also be increasing the size of your report.

Xcode calculations with multi-component picker

I would like to set up a view controller with a 2-component picker where each side contains the same 7 objects. Each object carries the same value for both components. The user would make a selection from each side, enter a value in a provided text field (and optionally tap a "Calculate" button). A calculation would occur using that value and the values from the two picker component objects that were selected and the results would be displayed in a label.
For example, each picker contains the letters a - g. Each letter carries the value of 1 - 7 respectively, for each side of the picker. The user selects "b" and "d" and enters 10. The calculated result of 10 * 2 / 4 = 5 is displayed.
It sounds simple enough. I've found tutorials for doing calculations using values associated with a 1-component picker as well as working with 2-component pickers, but nothing for doing calculations with 2-component pickers. My experience with Xcode is somewhat short. So, feel free to go into detail.

List Control Adds a Space for an Image to Column 0 When Subsequent Columns Have Images

I’ve come across a problem with Windows list controls (I am specifically using MFC, but it looks like it applies to all list controls in the Windows common controls library).
In my specific case, I want to create a list control that has two or more columns. The first column (0) is text-only and is used to allow the user to jump to entries by typing the text in that row. Column two (or three, or four, or whatever) has an image (or an image and text; either way).
This much is all well and good and can be done easily without problem, however the final list control then ends up having a space to the left of the text in column 0 (it may be on the right on an RTL system). This spacer appears to be reserved for an image and I cannot figure out a way to prevent it. (Arranging the specific order of the columns did not change anything.)
Looking around, I found some other people complaining of the same thing, specifically this thread which leads to this thread. The proposed solution does not work because as was stated, simply shrinking the width of column zero merely cuts off the text rather than the image spacer (plus, you then have to prevent and/or process any changes to column widths that the user tries to make).
Does anyone have any ideas of how to fix this bug short of writing a list control from scratch or using one of the too-fancy grid controls on CodeProject/CodeGuru/etc.?
Thanks a lot.
Did you try to change the iIndent member of the LVITEM struct? MSDN says this:
iIndent Version 4.70. Number of image widths to indent the item. A
single indentation equals the width of
an item image. Therefore, the value 1
indents the item by the width of one
image, the value 2 indents by two
images, and so on. Note that this
field is supported only for items.
Attempting to set subitem indentation
will cause the calling function to
fail.
Column 0 is special in a ListView. As soon as you assign a small image list to the ListView, the control expects you to show an image in column 0, so it leaves space for it.
Solutions:
make column 0 zero-width, give it the value you want the user to be able to type. Column 1 becomes your "first" text column. Columns 2+ are for your images. You need full row select style for this to work. Yes, you have to prevent the user from resizing column 0. Yes, that is a pain.
make a column that does have an image to be column 0 and use LVM_SETCOLUMNORDERARRAY to rearrange the display order
owner draw the items.
give column 0 an icon (just to cover all bases)

Resources