Jump to content

Text running on columns


myspacee
 Share

Recommended Posts

Hello,

need a tool for job to count how many text i write and simulate effect on paper.

Is possible to jump on another column when reach bottom of previus one ?

Posted Image

And, On post image (modified), on avarage every columns contain 30 characters of text,

is possibile to set a limit for rows?

Thank you for any help,

m.

Link to comment
Share on other sites

Yes, it is possible!

Seriously, we need more information before we can tell you if it is possible and how to do.

Can you post the code you have so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thank you for reply,

don't post code because is only a simple Koda example:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 626, 449, 192, 114)
$Edit1 = GUICtrlCreateEdit("", 8, 16, 200, 409)
GUICtrlSetData(-1, "Edit1")
$Edit2 = GUICtrlCreateEdit("", 213, 16, 200, 409)
GUICtrlSetData(-1, "Edit1")
$Edit3 = GUICtrlCreateEdit("", 417, 16, 200, 409)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd

I take an image and modify it to better explain my idea. Have no sufficent skill to create my own...

This tool can semplify a lot way to work,

m.

Link to comment
Share on other sites

What you try to do is not easy to code. I'm not sure the Edit control is the best solution. But as I have never done something similar myself I hope some other users jump in and add their knowledge.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Just throwing out an idea, probably a good to use a unicode text, so once a character limit is hit (you will have to find it, and consider word wraps/CR/LF/Tab that take up additional characters), then use a regexp to move the last word over to the other column, and shift focus as well

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

@jdelaney - why regexp to move the last word typed?

@myspacee - Rich text edit controls can be queried for the number of lines in the control. Following what jdelaney said, you can monitor the control and switch focus at some pre-set limit. I have no experience with this but would look at doing it this way. There is also an event handler that may be an option, you'll need to do some research / experimentation.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

regexp to move last word, so one word isn't split into two (if monitoring for character count)

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

There is an easy fix for the RichEdit control issue.

Try this, open the GUIRichEdit.au3 file, navigate to the _GUICtrlRichEdit_Create function in it, and comment out the second line in the function.

; comment out or delete this line from the UDF
If Not _WinAPI_IsClassName($hWnd, $_GRE_sRTFClassName) Then Return SetError(1, 0, 0) ; Invalid Window handle for _GUICtrlRichEdit_Create 1st parameter
; replace it with this line instead
If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0) ; Invalid Window handle for _GUICtrlRichEdit_Create 1st parameter

I just posted this in another thread where someone was having an issue with creating multiple RichEdit controls, this fixes it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Might be worth seeing whether microsofts richedit control actually implements the microsoft rtf specification. If it does then there is actually a snaking columns property for sections.

Search this page for "colsN" to see what I mean: http://msdn.microsoft.com/en-us/library/office/aa140283(v=office.10).aspx#rtfspec_19

Link to comment
Share on other sites

myspacee,

This will get you started. You figure out how to cross columns without splitting words, what to do when you run out of room and how to "simulate effect on paper" (whatever that means?).

The code is rough but you need something to do too!

#Include <GUIConstants.au3>
#Include <EditConstants.au3>
#Include <WindowsConstants.au3>
local $gui010 = GUICreate(@scriptfullpath,910,700)
local $col010  =  GUICtrlCreateedit('', 10, 30, 290, 600, $es_wantreturn)
local $col020  =  GUICtrlCreateedit('',310, 30, 290, 600, $es_wantreturn)
local $col030  =  GUICtrlCreateedit('',610, 30, 290, 600, $es_wantreturn)
local $lbl010  =  GUICtrlCreatelabel('',10, 650, 290, 30, $es_wantreturn)
     GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
     GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    local $ctrl = BitAND($wParam, 0xFFFF)
 local $nmsg = BitShift($wParam, 16)
 Switch $nmsg
  Case $EN_change
   ;
   ; This notification happens after every char.  Might be used to make sure that words are not split across columns.
   ;
        Case $EN_maxtext
   switch $ctrl
    ;
    ; the controls are hardcoded.  For greater flexability put them in an array and use +/- navigation
    ;
    case $col010
     guictrlsetstate($col020,$gui_focus)
    case $col020
     guictrlsetstate($col030,$gui_focus)
    case $col030
     guictrlsetdata($lbl010,'No More Room To Type')
   endswitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

I'm not sure what just happenned, the forum went "gomer-ific" on me when I tried to post. The following is the code

#Include <GUIConstants.au3>
#Include <EditConstants.au3>
#Include <WindowsConstants.au3>
local $gui010 = GUICreate(@scriptfullpath,910,700)
local $col010  =  GUICtrlCreateedit('', 10, 30, 290, 600, $es_wantreturn)
local $col020  =  GUICtrlCreateedit('',310, 30, 290, 600, $es_wantreturn)
local $col030  =  GUICtrlCreateedit('',610, 30, 290, 600, $es_wantreturn)
local $lbl010  =  GUICtrlCreatelabel('',10, 650, 290, 30, $es_wantreturn)
     GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
     GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    local $ctrl = BitAND($wParam, 0xFFFF)
 local $nmsg = BitShift($wParam, 16)
 Switch $nmsg
  Case $EN_change
   ;
   ; This notification happens after every char.  Might be used to make sure that words are not split across columns.
   ;
        Case $EN_maxtext
   switch $ctrl
    ;
    ; the controls are hardcoded.  For greater flexability put them in an array and use +/- navigation
    ;
    case $col010
     guictrlsetstate($col020,$gui_focus)
    case $col020
     guictrlsetstate($col030,$gui_focus)
    case $col030
     guictrlsetdata($lbl010,'No More Room To Type')
   endswitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

@mat - I'm sure that I put in a closing code box, if that's what you mean.

kylomas

It's not a problem you should be able to close... But I can't seem to reproduce it now. I tried to copy the code and it worked fine: http://www.autoitscript.com/forum/topic/98043-test-thread/page__st__300#entry1034913

I meant that the html is missing an end tag for the code box, so eats the next few elements :)

Edit: I think perhaps you were posting while the greaters powers were adding an expand button, and they have now rolled back the changes? Your AutoIt box has one, which wasn't there in older posts, and isn't there now.

Edited by Mat
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...