Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Allignment Of Words In TextEditor

RIGHT_THENRIGHT_THEN Member Posts: 154
Gentlemen,
i am making a Text Editor From Stratch
not using any functions for assistance from winApi
for the sake of editor.

My Problem Is When I Left Or RIght Scroll The Written Lines
they Loose The Alingment To EachOther and i know why
it is happening and it should happen like that because
of the technique i am using to shift the ALphabets.

but on Notepad and other editors i see that
Alignment Remains Intact while Scrolling.
when I Scroll Right Or Left My Editor Redraws Each Induviduval Line
Which Is Supposed To Be Shown On The Screen and from where
it is supposed to be shown on the screen.
Where As In NotePad And Others It Seems That The Whole
Screen In Moving Left Or Right Very Neatly.

Are They not Redrawing Induvidual Lines Or
Are They Moving Left And Right The Bitmap Of the Editors
Client Area and if So How.

Let Me Be More Elaborate If YOu Look below
============
[code]
Gentlemen,
i am making a Text Editor From Stratch
[/code]
============

There Is One "m" beneath the "e" of Gentlemen in the
Next Line When I will move My text right or left
say like This

===============<<
[code]
tlemen,
m making a Text Editor From Stratch
[/code]
===============<<
this "m" may or may not remanin under the same alphabet
of the word that was in the above line. because each
alphabet has different width so the width of the
Lines Keep On Changing As i Scroll Left Or Right
Depending On the number Of Alphabets Being Displayed
From That Line .Am I Being Clear Or Just Confusing
More Of YOu.If So Kindly Put Me Wise And I
would Elaborate more.
If Required.

Thankyou

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [b][red]This message was edited by AsmGuru62 at 2006-6-25 5:0:45[/red][/b][hr]
    : Gentlemen,
    : i am making a Text Editor From Stratch
    : not using any functions for assistance from winApi
    : for the sake of editor.
    :
    : My Problem Is When I Left Or RIght Scroll The Written Lines
    : they Loose The Alingment To EachOther and i know why
    : it is happening and it should happen like that because
    : of the technique i am using to shift the ALphabets.
    :
    : but on Notepad and other editors i see that
    : Alignment Remains Intact while Scrolling.
    : when I Scroll Right Or Left My Editor Redraws Each Induviduval Line
    : Which Is Supposed To Be Shown On The Screen and from where
    : it is supposed to be shown on the screen.
    : Where As In NotePad And Others It Seems That The Whole
    : Screen In Moving Left Or Right Very Neatly.
    :
    : Are They not Redrawing Induvidual Lines Or
    : Are They Moving Left And Right The Bitmap Of the Editors
    : Client Area and if So How.
    :
    : Let Me Be More Elaborate If YOu Look below
    : ============
    : [code]
    : Gentlemen,
    : i am making a Text Editor From Stratch
    : [/code]
    : ============
    :
    : There Is One "m" beneath the "e" of Gentlemen in the
    : Next Line When I will move My text right or left
    : say like This
    :
    : ===============<<
    : [code]
    : tlemen,
    : m making a Text Editor From Stratch
    : [/code]
    : ===============<<
    : this "m" may or may not remanin under the same alphabet
    : of the word that was in the above line. because each
    : alphabet has different width so the width of the
    : Lines Keep On Changing As i Scroll Left Or Right
    : Depending On the number Of Alphabets Being Displayed
    : From That Line .Am I Being Clear Or Just Confusing
    : More Of YOu.If So Kindly Put Me Wise And I
    : would Elaborate more.
    : If Required.
    :
    : Thankyou
    :
    :
    [blue]...I am confused... :-)

    The letters will be aligned under each other in previous and next lines only for the font with the same character width, like Courier. With any other font, like Tahoma or Arial - they will not be aligned even in NOTEPAD.[/blue]


  • RIGHT_THENRIGHT_THEN Member Posts: 154
    [blue]
    The letters will be aligned under each other in previous and next lines only for the font with the same character width, like Courier. With any other font, like Tahoma or Arial - they will not be aligned even in NOTEPAD.[/blue]

    well sir i tried it on my notepad but all the fonts
    are working just fine .althou in vc++6 editor and Ms- word
    seem to adopt diffrennt strategy than notepad.it is
    that when i apply courier in Ms-word or VC++6 editor
    alphabets move one at a time.
    but when applied with tohama or arial which are alphabets
    with different widths then screen seems to move in blocks
    a group of letteres at a time and not induvidually.
    but the end result is everything is where it is supposed to be
    i did not notice any change in the position.

    so my question is are they moving a bitmap or are they moving
    alphabets.

    i hope no confusi:-)n this time
    Thankyou


  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [blue]
    : The letters will be aligned under each other in previous and next lines only for the font with the same character width, like Courier. With any other font, like Tahoma or Arial - they will not be aligned even in NOTEPAD.[/blue]
    :
    : well sir i tried it on my notepad but all the fonts
    : are working just fine .althou in vc++6 editor and Ms- word
    : seem to adopt diffrennt strategy than notepad.it is
    : that when i apply courier in Ms-word or VC++6 editor
    : alphabets move one at a time.
    : but when applied with tohama or arial which are alphabets
    : with different widths then screen seems to move in blocks
    : a group of letteres at a time and not induvidually.
    : but the end result is everything is where it is supposed to be
    : i did not notice any change in the position.
    :
    : so my question is are they moving a bitmap or are they moving
    : alphabets.
    :
    : i hope no confusi:-)n this time
    : Thankyou
    :
    [blue]My NOTEPAD in XP (Tahoma font) show partial letters when scrolling horizontally. To draw scrolled text - use SetViewportOrg() function to specify the X origin of negative value (get the scroll bar position to determine that value). Do it before you draw anything. If you want to leave some gap on the left side for bookmarks and such - you need to use also ExcludeClipRect() to clip the drawing, so the left side will be empty.[/blue]
Sign In or Register to comment.