Sign in to follow this  
Followers 0
aurm

create balloon tips , change text of a checkbox , and other stuff

6 posts in this topic

Hi everyone , I'm trying to make a GUI app that consists mainly of checkboxes , each is created with a text and a value that represents an element in some array , I encountered some problems while trying to achieve so :

1- checkbox's text can't hold big text , or text having "\n" , is there a way to overcome that problem and display the whole text ?

Note : I thought about displaying a snippet of the text , and attaching a balloon tip that contains the full text , so that hoovering on the checkbox would display a balloon with the full text , anyway to do this in AutoIt ; in case I couldn't overcome the displaying-big-text problem ?

2- multiple checkboxes are created dynamically , and for certain situations I have to overwrite the text/value of a checkbox to have a new value instead of the old one , any Idea/function to overwrite/set the text and value of a checkbox ?

3- How could I delete a checkbox ?

sorry for the long post , and hope to find some solutions here ;)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello Aurm,

1.) create a checkbox and a label, GUICtrlCreateLabel(), next to it to hold the data. Then use GUICtrlSetFont() on the label to customize the text to your liking.

2.) GUICtrlSetData(), GUICtrlSetState()

3.) GUICtrlDelete()

Good Luck & Happy Coding!

Realm

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

Thanks for the informative reply !

It worked well , with new bugs appearing on the surface . only if it weren't for the GUI being a pain !

Share this post


Link to post
Share on other sites

Hello Aurm,

Sorry if my previous post was very short, simple, and to the point without further explanation or examples. However, without knowing what you actual goals and expectations are, it's difficult to provide more extended help or examples that could actually benefit you. I do have one other tip; when you create your checkbox control, size it to the the checkbox only, don't allow space for the text, or the control may overlap the label control you code in next to it with various user actions.

If your having bugs then try posting a short reproducer script, being short enough to reproduce the bugs and errors your experiencing. Then explain what it is that you are trying to achieve, what you expect your script to do, and what results you expect from your script. You more than likely will receive more elaborate advice that will be more suited to your needs.

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@realm your reply was really good , in fact I liked it for being to the point ;)

so , I'm trying to make a simple clipboard manager , that doesn't limit the clipboard to only one entry.

i.e : instead of overwriting the data in the buffer when pressing Ctrl+C , all the copied data shall be collected ; so that the user could paste a group of data at one time , instead of multiple copies and pastes .

so this is the part of the code where things aren't going well , the checkboxes and the labels issue was solved , now a new problem

Func gettext ()
    Send ("^c")
    $copied = ClipGet()
$arr[$counter] = $copied
GUICtrlCreateCheckbox("",20,50+($height),25,25)
$aSize = _StringSize($copied, Default, Default, Default, "",200)
GUICtrlCreateLabel($aSize[0], 40, 50+$height, $aSize[2], $aSize[3])
$height+=20
$counter+=1
EndFunc

the main problem is that the text isn't displayed well using the labels , so I used a UDF developed by Melba -"#include "StringSize.au3" - to format the text , which works pretty well but fails and generates an error if the text contained CRLFs . i.e : copying a block of code results in :

Subscript used with non-Array variable.:
GUICtrlCreateLabel($aSize[0], 40, 50+$height, $aSize[2], $aSize[3])
GUICtrlCreateLabel($aSize^ ERROR

sometimes it works well and most of the time generates the error mentioned above . so any idea why is it failing although $asize is an array ?

Edited by aurm

Share this post


Link to post
Share on other sites

Hello aurm,

I know the udf you speak of, however, if your errors/problems are within the scopes of this udf, you are best to post a reproducer in the orginal post that offers the UDF. When posting a reproducer, try to make it as short as possible but can also be ran alone to duplicate the same error, explain the errors and/or problem your getting/having, explain what results you are expecting from it. In general, no on is better to help you, than the original author of a UDF.

Melba23 is generally online everyday, and from what I have seen of him, is generally happy to help legitimate coders solve their roadblocks.

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
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
Sign in to follow this  
Followers 0