In the Format cells dialog box, under category General, how to remove 0 from the sample box? - format

When we are pulling values from another sheet, if there is nothing in a particular cell, then it should return the same instead of returning Zero
I tried to remove the zero from sample section. but i doesn't know how to do that

Related

Qtruby ListWidgetItem has blank icon after adding data

I am working on a GUI using qtruby. I have a ListWidget that I am filling with ListWidgetItems. So far these have just contained the text that I wanted to display and everything worked fine. I wanted these items to also hold some hidden data to use when they are clicked on. I used ListWidgetItem.setData() to set the data and I can get the data from it when it is clicked just fine. However once I add the data the text being displayed is now shifted over to the right about 4 spaces. When I click on it a little dotted box appears around the text but not the space that was added. It looks like it is a space for an icon but I have not set any icon and I don't want one. How do I get rid of this extra space so that items containing data are lined up with everything?
The code is very straight forward:
item = Qt::ListWidgetItem.new( #grain_strings[index] )
item.setFont( #font )
# TODO this is causing the text to be indented, removing it removes the indent
item.setData( 1, Qt::Variant.from_value( grain.type ) )
#item_list.insertItem( #end_of_grains+1, item )
The first argument to setData is the role number and for some reason you chose to set it to 1. The documentation says: "The data to be rendered as a decoration in the form of an icon. (QColor, QIcon or QPixmap)". So you are telling Qt to display an icon but you are not giving it a valid icon object.
Try setting the role to Qt::UserRole, which is "The first role that can be used for application-specific purposes." I am not sure how to access that constant from Ruby. If it is not provided by the qtruby gem, you could use 0x100 I suppose.

Does anyone know why an object would miss a property?

We have a script that export our Indesign documents to HTML and one of the routine is to export tables. In this script we go throught each Tables->Rows->Cells and evaluate some of the properties (i.e. bottomEdgeStrokeType, topEdgeStrokeType, etc...) and transport them to HTML.
Now yesterday we had problem converting one particular document because some cells were missing the "bottomEdgeStrokeType" property entirely. I've discovered this by outputting the properties of each cells and compare the faulty ones with the others.
This line bellow was trowing the error: "Invalid object for this request.".
var cellType = cell["bottomEdgeStrokeType"];
Now, to fix this I've wrapped this around a try catch block to handle the case when it's not there, but now what is puzzling me is how on earth can Extendscript instantiate an object with missing properties?
Indesign version: CS5.5
A property is not only 'undefined' if it cannot exist at all (such as asking for the parent text frame for a character in overset text), but InDesign's Javascript engine also fails to return a reasonably accurate result for multiple values.
If you ask for "the" point size of a paragraph, where this paragraph contains multiple sizes, poor ID does not consider to return something like CONSTANT.Mixed, or the first value only, or (what I might have preferred) an array of the values; it returns undefined instead.
So how can a single table cell have multiple bottom strokes? If the cell underneath it is split into multiple cells, and one has a "top" stroke but the other has not.
It's difficult to recommend an adequate solution. You could first test if the current cell is "merged" (as far as InDesign's internal table model is concerned) with columnSpan; and if so, iterate over the number of columns spanned and test the next row's cells for their top stroke, which in theory should match the bottom stroke of the cell above. (I find myself wondering if this is always true. ID's table model is ... weird. It's not entirely like a HTML table, despite the functional overlaps.)
If columnSpan is greater than 1 and equal to the number of cells immediately below the current one, you could test if all of their "top" values are the same and if so use that value. (I never tested this so ID's table model may simply fail because a cell is merged, regardless of same-values or not.)
One could attempt to flag this cell's next row to output "top" strokes as well -- but alternating top and bottom strokes may not align nicely in CSS, side to side. Perhaps it's best to translate only the first top stroke value to "the" bottom stroke property for your current cell, and fix up manually where needed (how?) or, a reasonable action, hope that no-one will ever notice it.

Delphi: auto addition in StringGrid

It is possible to make a calculator who calculate the addition of 2 or more cells of a StringGrid and show the result in other cell?
For example:
I have a String grid with 6 cells. I want to show in the 6th cell 1st cell+2nd cell+3rd cell+4th cell+5th cell.
And if the response is 'YES' how can I do this?
Yes, it's certainly possible to write such a program.
Read the values in the cells, convert them to integers, add them, convert the result back to a string, and store that string in the cell designated for the result.
To detect changes to the editable cells, you might wish to handle the OnSetEditText event of the grid control.

Change VB6 cell properties on runtime?

I have a table with a foo number of rows and bar number of columns.
What i'd like is for the selected cell to really appear as being selected.
At the moment the leftmost cell gets a red text to mark it's being selected.
What i'd llike is for the lines at the top and bottom of the cell to get bigger to really show that the cell is selected.
I've looked at the following but without success.
grd.row = aRow
grd.col = aCol
' Therafter i try to change the following:
grd.CellBorderColor = 255 ' Original value does not change
grd.CellBorderStyle = 2 ' Original value does not change
EDIT:
I found out that previously named properties are read only.. What can i do?
Any tips and/or pointers in the right direction will be highly appreciated, thanks for reading.
This particular grid. Called vaSpread or fpSpread needs a specific line to execute.
For executing changes to grid style you need to call grid.action = 13 after you've written the visual changes to the grid.

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