Solved

THyperGrid  3Easy , 1Medium, 1Hard

Posted on 1997-08-25
2
254 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 150 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now