Jump to content

Read to continue


 Share

Recommended Posts

I am making a program that has a page of rules

I have all the rules typed in a .txt file and am reading the file and setting that as an edit control in my GUI with the '$ES_READONLY' style so it can be scrolled

I want to put in some mechanism to at least try to motivate people to read the rules before pushing ok, and my idea is making it so the scroll in the edit box has to be all of the way down or at least has been all the way down once(as it would be if they read the entire thing) before the ok button becomes enabled

Like some of those installers that make you have to scroll all the way to the bottom of the license agreement before you can click ok

Any ideas?

Link to comment
Share on other sites

Hi,

did you already start? So that testing is a bit easier using your code.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

well, what I usually do for this stuff us is to put a little password near, but not AT the bottom of the rules page, and under the "next" button (or whatever) have a small input box, so if people dont read it, they wont be able to go to the next page(or whatever)

OR

Have the "Next" button(or whatever) be disabled, untill that password is entered, but it makes no difference, the first one just makes it tricky..

though it not really an inscript mechanism, it works!

EDIT:

oh, nvm i didnt know you wanted the scroll bar at the bottom...

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

in your text add something like

"bla..bla

acceptance code = " GetIP()... ( or something )

then next to the OK button have an input box that has to have that code pasted/typed into it before the button can be activated

....... just an idea

8)

... guess i was a little slow... but we had the same idea/concept

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Hi,

did you already start? So that testing is a bit easier using your code.

So long,

Mega

Well i threw together a dummy code similar to my own without all the 'fileread' garbage as that is irrelevant, and though the gui on my other one is much cleaner, this has the same controls

#include <GUIConstants.au3>

$Gui = GUICreate("Rules", 400, 600,-1,-1, "", BitOr($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$Info = GUICtrlCreateLabel("You must read the following rules before continuing:", 10, 10, 380, 50)
GUICtrlSetFont($info, 14, 500, 0, "Arial")
$Edit = GUICtrlCreateEdit("Rules that were imported from other test file here.", 10, 100, 380, 350, $ES_READONLY)
GUICtrlSetBkColor($Edit, 0xFFFFFF)
$Next = GUICtrlCreateButton("&Next", 100, 475, 80, 30)
$Exit =GUICtrlCreateButton("&Exit", 220, 475, 80, 30)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    
    Switch $Msg
        Case $Exit
            Exit
        Case Else
            Sleep(100)
    EndSwitch
WEnd

As for the little password thing, that would be a little too much work, tough it would be cool to put it randomly in the information and have it so you can't just scroll to the bottom but you actually need to read it to find the code

But i like the scroll thing better, because though i want them to read the rules, i know I'd be angry if i had to copy and past a password just to push ok. The scroll isn't that bad

Plus it would be a useful wrapper for someone who was making an installer with a license agreement.

Does anyone have any idea on the scroll thing?

EDIT: forgot to attach code :lmao:

Edited by Paulie
Link to comment
Share on other sites

I asked Gary the GUI-guru the same question a while ago in this post.

I tried what he suggested and I couldn't get it working either.

So does this mean its not possible? :ph34r:

I mean if gafrost can't help me...I'm gonna need a miracle :lmao:

Edited by Paulie
Link to comment
Share on other sites

This is'nt really the most advanced way of doing things.. but it works :lmao:

To get the number i compared it to... do,

MsgBox(0, "", _GUICtrlEditGetFirstVisibleLine($EditControl))
oÝ÷ Ù§íz¼¨º¯zÇ+¢Y^u©e¶°k+h¶¢Ûh:ò¶¬9÷(º»r§è­¶¨º¹bè§Æ­µ§!éí

as for the scrollbar being there when it is "readonly".. i've got no clue on that.

Readme.txt

Edited by CHRIS95219
Link to comment
Share on other sites

Works like a charm... try this for a readonly with vertical scroll, remember that line 51 is not at the end if you do... it's somewhere in the middle. more like line 238

$Edit1 = GUICtrlCreateEdit("", 8, 8, 321, 241,$ES_READONLY+$WS_VSCROLL)
Edited by jinxter

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

Change line 16 to have a '>' sign instead of the '==' signs instead.

Ex:

#include <GUIConstants.au3>
#include <GUIEdit.au3>
#Region ### START Koda GUI section ### Form=
$data = FIleOpen("readme.txt", 0)
$count = StringLen(FileRead($data))
$Form1 = GUICreate("AForm1", 336, 338, 193, 115)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 321, 241,$ES_READONLY+$WS_VSCROLL)
GUICtrlSetData($Edit1, FileRead($data))
FileCLose($data)
$Button1 = GUICtrlCreateButton("The Easy Button", 8, 256, 321, 73)
ControlDisable($Form1, "The Easy Button", $Button1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    ;51
    if (_GUICtrlEditGetFirstVisibleLine($Edit1) > 51) Then ControlEnable($Form1, "The Easy Button", $Button1)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _Cont()
    EndSwitch
WEnd

Func _Cont()
    MsgBox(0, "", "You may continue!")
EndFunc
Edited by terrabyte
Spoiler

 

"...Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like.My crime is that of outsmarting you, something that you will never forgive me for." --The Mentor

"Mess with the best, die like the rest!!" -Hackers

"This above all to thine own self be true." -William Shakespeare

"Corruption is only as corrupted as the individual makes it out to be." -i386

 

style7,AutoIt.png

 

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...