Welcome, Guest.
Please login or register.
Vixen
Forum Login
Login Name: Create a new account
Password:     Forgot password

XBLite Forum    General Boards    XBLite Programming  ›  Vixen
Users Browsing Forum
No Members and 1 Guests

Vixen  This thread currently has 7,147 views. Print Print Thread
1 Pages 1 Recommend Thread
the_watchmann
March 20, 2014, 1:53pm Report to Moderator Report to Moderator

Baby Member
Posts: 5
Hi Guy

When I create a gui program with vixen, one of your functions is WapiSetText. Why is it that the following code works:
     WapiSetText (#lblTotal, "0.00")
     WapiSetText (#lblDue, "0.00")
However, this doesn't...
     WapiSetText (#lblTotal, total$)                              
     WapiSetText (#lblDue, taxdue$)
Please excuse me if this is a stupid question. I don't really use Windows much anymore and have not had to much experience with the Windows API.

Regards

David
Logged Offline
Private Message Private message Skype Skype
the_watchmann
March 21, 2014, 10:18am Report to Moderator Report to Moderator

Baby Member
Posts: 5
Oh dear, let me re phrase...
It seems to me the problem lies with the STATIC control. It doesn't appear to be editable? I'm used to being able to edit a label in VB6, Gambas & also Xbasic so this comes as a bit of a surprise to me? Is there a way to make a static control editable or should I use an Editbox. What I need is a non user editable control that can display a calculation, much like a calculator...
Any thoughts?
Logged Offline
Private Message Private message Skype Skype Reply: 1 - 7
Carry
March 26, 2014, 7:13am Report to Moderator Report to Moderator
Baby Member
Posts: 36
I'm not familiar with WapiSetText, but maybe you can use SendMessageA:

SendMessageA (#lblTotal, $$WM_SETTEXT, 0, &total$)
SendMessageA (#lblDue, $$WM_SETTEXT, 0, &taxdue$)

Should be no problem changing the text of a static control.
Logged Offline
Private Message Private message Reply: 2 - 7
the_watchmann
March 26, 2014, 3:32pm Report to Moderator Report to Moderator

Baby Member
Posts: 5
Hi Cally

Nope, not working either. Though somehow I figure it should...
I have changed the STATIC control to EDIT and now it works... Only problem is that the result is editable.
WapiSetText is a function created by vixen to make it easier to set the text in the editbox. If Guy does get around to the forum, I'm sure he will be checking in on this, once he reads/ if he gets to read it. And knowing me, the answer is somewhere in the code, ready to bite me on the nose...

Anyway, thanks. I had forgotten about SendMessageA.

Regards
Logged Offline
Private Message Private message Skype Skype Reply: 3 - 7
Guy1954
April 6, 2014, 1:29pm Report to Moderator Report to Moderator

Medium Member
Posts: 187
Hi David "The Watchman".

Since viXen is User-driven, I welcome any feature request.
Please, post here your viXen project, along with your expended source and I will study a way to simplify your life as a Vixener.

Anyway, thanks for a good User feedback.

Bye! Guy
Logged Offline
Site Site Private Message Private message Reply: 4 - 7
the_watchmann
April 9, 2014, 10:09am Report to Moderator Report to Moderator

Baby Member
Posts: 5
Hi Guy
Good to hear from you again.
Would you like to have the full source or just the relevant functions? Where do I upload to?

https://drive.google.com/file/d/0B1ur8bUaXrpDTFNBR2JkWFB0VTQ/edit?usp=sharing

I've uploaded the source file to my google drive. Link above.

It's a local tax calculator, so nothing fancy, but wow. I still haven't been able to figure out how to make the static control (label) editable...

Regards
David
Logged Offline
Private Message Private message Skype Skype Reply: 5 - 7
Guy1954
August 15, 2014, 3:41pm Report to Moderator Report to Moderator

Medium Member
Posts: 187
Hi David,

I decided that static fields would keep their initial value; so viXen does not generate a global handle.

1.You can override viXen's default behaviour by checking menu option Options/Generation/All Handles Global
2.You can also use WinAPI SetDlgItemTextA (hwndDlg, $$..., &text$)
3.My prefered solution is to add an edit field and to prevent any User Entry with style $$ES_READONLY

Bye! Guy

PS. I reversed your XBLite code to a viXen project that I can post for you here if you'd like to review it.
Logged Offline
Site Site Private Message Private message Reply: 6 - 7
Guy1954
August 15, 2014, 9:15pm Report to Moderator Report to Moderator

Medium Member
Posts: 187
Hi David,

Attached is your iXen project taxcalculator.vxn; enjoy!

Bye Guy



This post contains attachments; to download them you must login.

Logged Offline
Site Site Private Message Private message Reply: 7 - 7
1 Pages 1 Recommend Thread
Print Print Thread

XBLite Forum    General Boards    XBLite Programming  ›  Vixen

Thread Rating
There is currently no rating for this thread