Page 2 of 2 <12
Topic Options
#204805 - 2012-04-20 02:15 AM Re: OnClick not returning value [Re: KIXKicks]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I can't get the location of the label right...
don't remember so many years back, but I bet you can take it from:
 Code:
[postprep]
  global $labeles
  $labeles = $buttonexit.label
  $labeles.forecolor = red
  $labeles.text = "Quit Program"
  $labeles.ONCLICK = "Quit()"


Edited by Lonkero (2012-04-21 03:37 PM)
_________________________
!

download KiXnet

Top
#204806 - 2012-04-20 02:21 AM Re: OnClick not returning value [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
something like this maybe:
 Code:
  $labeles.width = len($labeles.text)*6
  $labeles.height=25
  $labeles.left = ($buttonexit.width-$labeles.width)/2
  $labeles.top = 5


I just can't remember what the alignment keywords were.
and the button looks a bit funky now.
could remove it and use just a label instead.
_________________________
!

download KiXnet

Top
#204808 - 2012-04-20 04:06 AM Re: OnClick not returning value [Re: Lonkero]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
If I remember correctly, the ToolButton object gives much more control than the regular Button. I would recommend changing to ToolButton, this may be why you cant get color to work.
Top
#204809 - 2012-04-20 04:08 AM Re: OnClick not returning value [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Use the .BackColor and .ForeColor properties for toolbuttons to change the colors.
Top
#204811 - 2012-04-20 04:56 AM Re: OnClick not returning value [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I totally forgot that. indeed, toolbutton works great.
_________________________
!

download KiXnet

Top
#204816 - 2012-04-20 01:15 PM Re: OnClick not returning value [Re: KIXKicks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
 Originally Posted By: KIXKicks
Kinda...just takes so long to change/remove/format the code for the kixtart.org; I was trying to just provide what I thought was necessary.
Have you tried PostPrep? First (sticky) post in the Advanced Topics forum. Just save the block of code to a file, run PostPrep, then post here using "HTML Only" format.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204817 - 2012-04-20 01:23 PM Re: OnClick not returning value [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't understand what "change/remove/format" contains other than removing sensitive information from the code.
I mean, there is nothing easier than put on the code tags and just drop the code between.
postprep is nice but in this case it would just be an extra step. and might actually hit postsize limit with this code already.
_________________________
!

download KiXnet

Top
#204818 - 2012-04-20 03:10 PM Re: OnClick not returning value [Re: Lonkero]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
toolbutton sounds like the code I need. Thanks!

It is just my coding style I guess (I use tabs but for posting on kixtart.org it looks better to use two space indent).

The post window is very small and moving around larger code is a pain (thus the initial reason not to post a lot of the code, sorry Lonkero). Not that I post big code sections a lot but it seems that may be the website could have a code button that would pop up a big window where you could paste and make your changes and then drop it into the post window with code tags. Small complaint...probably not worth the effort.

Glen, I didn't know about PostPrep (tend to post in the Basic Section as Advanced is Guru/Master territory). Maybe it would work, but seems just as much work for the occasional long code post.

Top
#204819 - 2012-04-20 03:37 PM Re: OnClick not returning value [Re: KIXKicks]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so...
what is wrong with firing up a notepad with your code and doing the required/wanted changes?
only paste the code inside the code tags once you are done.

yes, editing code inside the tiny window is painful and thus I really rarely do it just for that fact.
_________________________
!

download KiXnet

Top
#204820 - 2012-04-20 03:40 PM Re: OnClick not returning value [Re: Lonkero]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
yes, I should have done that...
Top
#204821 - 2012-04-20 04:55 PM Re: OnClick not returning value [Re: KIXKicks]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, and I don't know what browser you use but at least for me, the box is resizable on firefox.
_________________________
!

download KiXnet

Top
#204823 - 2012-04-20 05:38 PM Re: OnClick not returning value [Re: KIXKicks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Postprep is actually a good diagnostic tool - weird color blocks will quickly identify mismatched or unterminated paired objects.. definately worth looking at, just for that. Of course, Sanity (built into KGen) goes several steps further to identify common syntax errors, but PPrep is a nice visual.

The ZIP has two versions - GUI and command line. GUI has a sample screen, while the CL version lets you PostPrep an entire folder worth of files. It's how we publish our dev library to our web site every night.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204825 - 2012-04-20 08:05 PM Re: OnClick not returning value [Re: Glenn Barnas]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Lonkero, I use IE9...

Glenn, I use Sanity.

Top
#204829 - 2012-04-20 11:23 PM Re: OnClick not returning value [Re: KIXKicks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
 Originally Posted By: KIXKicks
Glenn, I use Sanity.
Good to hear! I'm just trying to get you to visit the Advanced forum more often! ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#204830 - 2012-04-20 11:41 PM Re: OnClick not returning value [Re: Glenn Barnas]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Glenn,

Sanity hates this code:

 Code:
$ITAPPS = 
      "$Location - $SERVER - $Action1,$Location,$SERVER,$Action1",
      "$Location - $SERVER - $Action2,$Location,$SERVER,$Action2"


Do I change it to this?:

 Code:
$ITAPPS = 
      "' + $Location + '" - "' + $SERVER + '" - "' + $Action1 + '","' + $Location + '","' + SERVER + '","' + $Action1 + '",
      "' + $Location + '" - "' + $SERVER + '" - "' + $Action1 + '","' + $Location + '","' + SERVER + '","' + $Action2 + '"


Ouch!


Edited by KIXKicks (2012-04-20 11:42 PM)

Top
#204832 - 2012-04-20 11:51 PM Re: OnClick not returning value [Re: KIXKicks]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
 Code:
$ITAPPS = $Location+" - "+$SERVER+" - "+$Action1+","+$Location+","+$SERVER+","+$Action1,
          $Location+" - "+$SERVER+" - "+$Action2+","+$Location+","+$SERVER+","+$Action2

Top
#204834 - 2012-04-21 12:50 AM Re: OnClick not returning value [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sanity hates it?
does this mean it works right but blings at you?
or that it doesn't recognize it as being valid?

maybe not perfect practise in some opinion but still totally valid kixtart.
_________________________
!

download KiXnet

Top
#204836 - 2012-04-21 02:32 AM Re: OnClick not returning value [Re: Lonkero]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Sanity complains about variables being inside quotes.

Yes, the script works as expected with the variables inside the quotes. I haven't tried it the other way.

Top
#204837 - 2012-04-21 03:01 AM Re: OnClick not returning value [Re: KIXKicks]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh. yes, sanity is smart then. it is considered bad practise to have vars in strings by some, like me \:\)
_________________________
!

download KiXnet

Top
#204840 - 2012-04-21 01:04 PM Re: OnClick not returning value [Re: KIXKicks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Kicks

Sanity doesn't hate anything.. it warns you when it finds a syntax error such as mismatched paren or quote, or an unterminated clause. Then, it will prod you when your code doesn't follow some well recognized best practices, such as placing vars or macros inside strings.

Sometimes it's not possible to eliminate every Sanity warning without code changes. For example, Sanity doesn't handle quoted strings spread across multiple lines. This is by design, as we want you to be warned of the condition - we'd have no way to know for sure. It's entirely legitimate to put "$" in a string. Sanity will warn simply because it COULD cause a problem, not because it WILL. You need to interpret the output of Sanity and decide if the warning applies to your code. KixForms and Execute statements will particularly throw these warnings for valid code.

The warning was valid - you had strings inside quotes. You can choose to ignore the warning because the code works as intended, or modify it as Allen has shown to eliminate the warnings, but verify that the code still works. It really depends on whether you want your string to have variable data or variable names in it, depending on the setting of NoVarsInStrings.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 494 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.078 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org