Well, I guess its time i opened a Q&A and Announcement Thread...
So i guess are there any Questions or Comments about the new version, WZGUILIB V2.1?
jwalker wrote:
So i guess are there any Questions or Comments about the new version, WZGUILIB V2.1?


Well, to start this out, what is WZGUILIB? I can't formulate an opinion on something without a description whatsoever, and therefore definitely cannot provide any feedback. Could you perhaps inform us about this project of yours (without throwing us a link to a description of it elsewhere?)
Ashbad, perhaps this will help clarify you? It seems to be a GUI API of sorts:

http://www.cemetech.net/programs/index.php?mode=file&id=731
So i can clear this up...
Work Zone GUI Lib is a library of GUI controls written in Lua, such as Forms(Window), textboxes, checkboxes, pictureboxes, radiobuttons, dialog boxes, lables and as of 2.1, a beta tabcontrol.
I update it quite freaquently, and in V3 i will add more controls and "Style Packs".
The idea is to ease the difficulty of createing a GUI like application, and to brieng controls that arent native on the nspire.
As you noticed in SAX, we're particularly harsh on spelling and grammar. It may be annoying at first, but as you spend more time on Cemetech you'll find that you'll speak more properly and seem more intelligent as a result. Smile Many people like Ashbad and Qazz can vouch for how my grammar sticklerism has helped them.
*I *tab control *frequently *I *creating *GUI-like *bring *aren't *Nspire.

Out of curiousity, have you looked at the Doors CS GUI API for an idea of what a full set of GUI controls in a currently-used GUI look like? I see quite a few important items missing from your list, but presumably you plan to expand it more over time?
Right when i thought i got out of English Smile
And also I am planning to expand more over time.
Right now in development there is list boxes, progress bars, track bars, scroll bars, a better tab control, menus that have buttons/icons in them.
I also plan to add events and icons to the form control.
Here are some ideas that I plan to add:
1. A status bar that would have a progress bar in it(Forms:optional).
2. A group box that would contain other controls and their properties would inherit from the group box.
3. A Track Bar
4. Scroll bars, when I add a multiline text box this will be necessary, this could be used in other controls as well.
5. A "Tool Tip". When you hover the mouse over a control, a box would apear with information in it(All:Optional)
6. Form Events, when you close, maximize or minimize a form, it would call a function given in an event table(Forms:Optional).
Yesterday I added icon support to forms, created an alpha status bar, and started working on a progress bar.
jwalker wrote:
Yesterday I added icon support to forms, created an alpha status bar, and started working on a progress bar.
Sounds great! I noticed you don't seem to have mentioned text input, in single-line, single-line password, or multi-line formats. Is this something you have planned, or will you be avoiding it. From my experience with Doors CS, it's a relatively challenging proposition (although easier if you're using a higher-level language like Lush, for sure), but I'd say it's almost a requirement for a GUI people will actually use.
Right now, in this release and all previouse releases, there is a textbox that allows single line inputs. I plan to add both password char and multi-line, but multil-ine probably will come first.
There are also alot more things planned for the future, I would like to create scroll bars befor I make multi-line textboxes, but i dont think this will happen in this next release.
Sounds good; good luck with it. You mentioned that you might consider porting it to C either before or after you switch to working with it on the Prizm; is that still the plan?
It still is, I probably will start working on it after the release of V3, so some time in may. Untill then i need to start brushing up on my C.
Yesterday I ported the drawing functions of the Form control to Prizm C, It looks okay and I think porting shouldnt be a huge issue.
Although, what would be the best way to draw a mouse Bitmap onto the screen?
I decided to boost my C# experience, so I was wondering, how could I call the make.bat in the prizm-0.3 sdk from my program?
jwalker wrote:
I decided to boost my C# experience, so I was wondering, how could I call the make.bat in the prizm-0.3 sdk from my program?
Does C# have a system or exec call of some sort? I'll defer to one of our C# coders on this, but most languages have one or the other.
It does, but the code I couldn't realy find anything on the internet that was helpful.
Use Process.Start.
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.71%29.aspx

Edit by Kerm: fixed link.
Thanks!, now I just have to figure out why make.bat doesnt work
FWIW, this is what I do for my PrizmSDK GUI (and this is also precisely why it's difficult to get it to run on non-Windows platforms):

Code:
            Directory.SetCurrentDirectory(Path.Combine("PrizmSDK-0.3", "projects", Projects[listBox1.SelectedIndex]));
           
            Process prc = new Process();
            prc.StartInfo.FileName = @"make.bat";
            prc.StartInfo.Arguments = @"> output.txt 2>&1";
            //prc.StartInfo.UseShellExecute = false;
            prc.StartInfo.CreateNoWindow = true;
            prc.Start();
            string[] output;
            try
            {
                output = File.ReadAllLines("output.txt");
                Form3 frm = new Form3(output);
                frm.ShowDialog();
            }
            catch
            {
                MessageBox.Show("Failed to get output");
            }

I have to redirect make.bat's output into a file and read that file since reading standard error and standard output hardly works (although, that might be because I'm not reading the streams correctly).
All right, so it has been a little while since i posted. School just ended so I now have more time to work on my projects.
I have been working on text boxes and now they have a smooth scrolling. I will be working on password char and multiline very soon but until then here is the new code for the text box class:

Code:

----------------------textbox-------------------------------------------

textbox = class()

function textbox:init(x, y, width, text, textcolor, tbcolor, parent, selected)
   self.parent = parent
   self.x = x + parent.x
   self.y = y + parent.y
   self.xoff = x
   self.yoff = y
   self.width = width
   if self.width < 10 then
      self.width = 10
   end
   self.height = 11
   self.text = text
   self.textcolor = textcolor
   self.tbcolor = tbcolor
   self.selected = selected
   self.cury = self.y + 1
   self.curx = self.x + 1
   self.curh = (self.y + self.height) - 1
   self.parent = parent
   self.type = "txt"
   self.stwid = 0

   self.dIndex = 1
   self.initial = true
   self.bsflag = false


   table.insert(parent.controls, self)
end
function textbox:paint(gc)

   self.stwid = gc:getStringWidth(self.text)

   if self.initial == true then
      local dtext = self.text
      while gc:getStringWidth(dtext) >= self.width - 1 do
         dtext = string.sub(dtext, 2)
      end
      self.initial = false
      self.dIndex = string.find(self.text, dtext)
   else
      while gc:getStringWidth(string.sub(self.text, self.dIndex)) >= self.width and self.bsflag == false do
         self.dIndex = self.dIndex + 1
         self.dText = string.sub(self.text, self.dIndex)
      end
      if self.bsflag == true then
         self.text = string.sub(self.text, 1, string.len(self.text) - 1)
         if string.len(self.text) > string.len(string.sub(self.text, self.dIndex)) then
            self.dIndex = self.dIndex - 1
            while gc:getStringWidth(string.sub(self.text, self.dIndex)) >= self.width do
               self.dIndex = self.dIndex + 1
               self.dText = string.sub(self.text, self.dIndex)
            end
         end
      end
   end
   self.bsflag = false

   gc:setColorRGB(unpack(self.tbcolor))
   gc:drawRect( self.x, self.y, self.width + 3, self.height)
   gc:setColorRGB(unpack(self.textcolor))
   gc:setFont("sansserif", "r", 8)
   self.stwid =
   gc:drawString( string.sub(self.text, self.dIndex), self.x + 4, self.y + 3, "middle")
   gc:setColorRGB(unpack(color.black))
   self.cury = self.y + 1
   self.curx = self.x + gc:getStringWidth(string.sub(self.text, self.dIndex)) + 3
   self.curh = (self.y + self.height) - 1
   gc:drawLine(self.curx, self.cury, self.curx, self.curh)
end
function textbox:charIn(ch)
   if self.selected then
      self.text = self.text..ch
   end
   platform.window:invalidate(self.x, self.y, self.width + 2, self.height)
end
function textbox:backspaceKey()
   self.bsflag = true
   platform.window:invalidate(self.x, self.y, self.width + 2, self.height)
end

function textbox:click()
   if self.selected then
      self.selected = false
   else
      for _, tb in pairs(self.parent.controls) do
         if tb.type == "txt" then
            tb.selected = false
         end
      end
      self.selected = true
   end
end
function textbox:checkClick(x, y)
   if y >= self.y and y <= self.y + self.height and x >= self.x and x <= self.x + self.width then
      self:click()
   end
end

Also Thank you flyingfisch for the userbar!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement