Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

THyperGrid  3Easy , 1Medium, 1Hard

Posted on 1997-08-25
2
Medium Priority
?
274 Views
Last Modified: 2011-04-14
Hello,

I am using D2.
I have found the freeware component THyperGrid v1.35 at www.neosoft.com/~pablo. It has no help documentation.

Q1a. Is there any 'DETAILED' help documentation out there?
     YES - Where do I get it?
     NO  - Can you look at the code and tell me (all - if              possible)the methods? I know how to do this at              design-time, but I would like it to change to a             response at run-time.
           eg. I would like to change text color in a cell.
           Please give example:  HyperGrid1.....
Q1b. I am using the EditMask in THyperGrid (it acts similiar      to TStringGrid), a problem I have with numbers in that      I say I want to limit a number to 4figures eg 1224          and all I want to type in is 124 => the result is           124_ (where_ is a blank against the grid margin) my         mask is '9999;1'; How do I get around this? (maybe      mask isnt the right thing to use is there something      else?)

Q1c. I am using real numbers in the THyperGrid and want to      mathematically check the values for what ever reason -      Should I use LongInt or what?

Q1d. I want to remove trailing zeros from a text string -        how?

Q1e. I want to print a string of 'random' length to a file.      The string in this case may be 3 characters long and I      want it to right justified to tab position 25.
         123456789012345678901234567890
     eg.                       645
   
0
Comment
Question by:Ham
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 300 total points
ID: 1342378
Q1A : By my thought there is no detailed help file available.
You can find all the information of that component with the Browser (from menu View) Once you've run your program with a THyperGrid. Search for THyperGrid and you'll get more information than you want (all virtuals, published, protected, ...). (Just type in THyperGrid)

e.g. :

{Next makes the 10 Columns read-only}
for i := 0 to 9 do
     HyperGrid1.Columns[i].ReadOnly := True;
{Next puts text in a cell}
HyperGrid1.Cells[1,1] = 'Hello, world!'
{Next changes column color}
HyperGrid1.Column[1].ColumnColor := clInfoBk;

...

If this isn't what you're looking for, please clarify your problem.

Q1b. Don't know exactly, but what about Right justified the column?

Q1c. Please clarify problem. LongInt (is Type for whole numbers, like 1 2 3 4 5; and is big brother of Integer) Real is for floats (like 1.1 2.3 5.6) If you will work with floats and whole numbers, than you have to use type real or double. If you are sure that you will ONLY use whole numbers than you have to use smallInt, Integer or LongInt depending on the range. Search for Type in delphi help and you'll know what I mean.

Q1d.

var Text1 : string;
    i    : integer;

 i := 0;
 while (Text1[i]='0') and (i <> length(Text1)) do begin
  inc(i);
 end;
 Delete(Text1,0,i);

I'm sure, there are better ways to do it, look at the string-handling routines. For trimming spaces and so, you can use the trim functions.

Q1e.
const TotallengthPage = 30;

function RightJustify(Text1:string;Pos:integer):String;
var i : integer;
begin
 For i := 0 to TotalLengthPage-Pos-length(Text1) do
  Text1 := ' '+Text1;
end;

Comment : Sure, there are much better ways to do it, but I wanted to show it you in the simplest form. Hope you'll be able now to make it better yourself!

Hope I could help you with this information. If not, sorry, ask again or ask Pablo (about THyperGrid). He helped me a lot.

Have fun,
c.u. ZifNab;



0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1342379
Was everything clear for you?
If not, give me a comment and I'll see what I can do!

Have fun,
c.u. ZifNab;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question