Thursday, January 7, 2010

Paint events & Properties in windows Application

Trigger the Paint event in System Drawing? Invalidate the current form; the OS will take care of repainting. The Update method forces the repaint.
With these events, why wouldn’t Microsoft combine Invalidate and Paint, so that you wouldn’t have to tell it to repaint, and then to force it to repaint? Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background

Assign an RGB color to a System.Drawing.Color object? Call the static method FromArgb of this class and pass it the RGB values.

ACCESS OF NON LOCAL NAMES in COMPILER DESIGN:

ACCESS OF NON LOCAL NAMES in COMPILER DESIGN:
i. Non-local names

In a language with nested procedures (or blocks) and static scope (lexical scope), some names are neither local nor global, they are non-local names.

procedure A
real a;
procedure B
real b;
reference a; ß non-local
end B
end A;

Example: Non-local names in C

main () {
int a = 0, b=0; {
int b = 1; {
int a = 2;
print(a,b); }
{
int b = 3;
print(a,b); }
print(a,b);}
print(a,b); }
i. Block-level and Procedure-level ARs

• Each block can be considered as an in-line procedure without parameters. So we could create a new AR for each block. This is block-level AR and is very inefficient.
• In procedure-level AR method, AR is only used for a true procedure. The relative location of variables in individual blocks within a procedure can be computed and fixed at compile time.

Categories