Re: Another Windows Programming Question

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sat, 20 Sep 2003 10:00:09 -0500, Ted Fines <fines at macalester.edu>
wrote:
>(2) Create a global variable, current_page, incrementing or decrementing=
 it=20
>with each click of Next or Previous, and having a procedure like this:
>procedure btnNext_onClick()
>    if current_page =3D 1 then
>        current_page +=3D 1
>        setText(MLText,"Here is the text for page 2")
>    elsif current_page =3D 2 then
>        current_page +=3D 1
>        setText(MLText,"Here is the text for page 3")
>    end if
>end procedure
>
>Anyway, these are the two ways I thought of to do this sort of thing.  I=
=20
>have opted for the first.  What do other Eu programmers out there think,=
=20
>and what would/did you do about this sort of program?
I'd definitely go for the second, and have a table of the required
texts, so I could just code:
	if current_page<max_pages then
		current_page+=3D1
		setText(MLText,texttable[current_page])
	end if
end procedure.

If you put several buttons at the same place, without calling
SetVisible() like a maniac, then (I haven't tested this) Windows won't
know which one to pass the click message to, and will always send it
to the first or the last, or maybe even all the buttons.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu