Page 3 of 19

Re: wishlist for BricxCC

Posted: 24 Oct 2010, 03:57
by muntoo
Pre-Defined Macros

Code: Select all

#define STRING(x) #x
TextOut(0,0,STRING(__LINE__),0);
Also, I think you should keep a _COMPILER_VER defined.

Re: wishlist for BricxCC

Posted: 29 Oct 2010, 07:22
by physics-matt
I think the editor colours could be improved.

I've tried numerous times to change the colours of the editor (I mean, it just ain't programming unless it's green text on a black background ;) ) but often find some of the colours revert to default every now and again. I'm also not sure about the fact that there are two places to specify colour: preferences->Color and preferences->Editor->Colors

Any chance of improving? Or am I just not using it right?

Matt

Re: wishlist for BricxCC

Posted: 05 Nov 2010, 21:58
by cghaning
I find it frustrating that the items on the tools menu (i.e. Diagnostics, Send Messages, Nxt Explorer, etc...) get caught behind the editor and at least for the Windows version you can't alt-tab to bring it back to the foreground. I end up having to click twice on the tools menu to get the tool back.

I would like to see either
a) Alt-Tab to cycle through open Tools
-or-
b) Have the Tools open in a tab within Bricx just like when editing files

Re: wishlist for BricxCC

Posted: 05 Nov 2010, 23:18
by muntoo
cghaning wrote:I find it frustrating that the items on the tools menu (i.e. Diagnostics, Send Messages, Nxt Explorer, etc...) get caught behind the editor and at least for the Windows version you can't alt-tab to bring it back to the foreground. I end up having to click twice on the tools menu to get the tool back.
Yeah, I'd like that fixed too. One way could be to create a "new window", then load the NeXTExplorer/etc inside it.

Re: wishlist for BricxCC

Posted: 14 Nov 2010, 00:46
by muntoo
It seems that the values in ID 5 in an .ric file doesn't affect the output of FontTextOut(). I want to make it so that when the height is 0, it will display a character with height 0. If the height is 3, display with height of 3. If 6, display with height of 6. Only the Options parameter makes any difference to the height...

EDIT: My first wish might make the function slower... So instead, I request the following:
  • char FontTextOutEx(int x, int y, int width, int height, string filename, string str, unsigned long options=DRAW_OPT_NORMAL)
    Where width/height define the clipping rectangle not each of the characters.
  • char FontGetProperties(string filename, string str, int &x, int &y, int &width, int &height, unsigned long options=DRAW_OPT_NORMAL)
    Using that function, I can figure out where the cursor will be, once I'm done outputting text
  • The source code for FontTextOut()
  • DRAW_OPT_WORD_WRAP_BY_WORD (instead of the current DRAW_OPT_WORD_WRAP which is equivalent to DRAW_OPT_WORD_WRAP_BY_LETTER)
  • There's probably more, but I can't remember right now

Re: wishlist for BricxCC

Posted: 19 Nov 2010, 12:43
by HaWe
I'd like to have syntax highlighting and test-compile (F5) also for .h files for debugging reasons

Re: wishlist for BricxCC

Posted: 02 Dec 2010, 03:01
by muntoo
afanofosc wrote:I'm glad to see someone using the file seek ability that I added to the enhanced firmware. Have you used it in other programs? Does it appear to work correctly in all the cases where you have used it?
You need to advertise it, or not many will notice. Also, even if someone finds it, they may not know how to use it. The examples could use some work. Maybe you could set up a topic in which people can submit sample code/etc for the help files?

Another thing:
  • (Oh oh, he's making a list!)
  • The BricxCC help comes up when you go to Help->Index, and no files are open. You have to open a file to get the NXC help. But when I need to look up the BricxCC, I either have to:
    • Close the files
    • Open a new BricxCC process
    • Open something like "Find Brick" and click on "Help"
    Not a big problem, but you should have a table of contents, or some window which organizes all the Help stuff, including tutorials.
  • I forgot what the others were... Don't worry, I'll add more.

Re: wishlist for BricxCC

Posted: 19 Dec 2010, 02:10
by muntoo

Code: Select all

bool ButtonPressed(const byte btn, bool  resetCount)
Should be:

Code: Select all

bool ButtonPressed(const byte btn, bool  resetCount = false)
This way, it's much more convenient, and easier for beginners.

Re: wishlist for BricxCC

Posted: 19 Dec 2010, 09:02
by HaWe
hi,
IMHO the current Btn functions are rather weird and actually should be re-designed.
Just for beginners already a 2nd parameter

Code: Select all

bool  resetCount 
in a read-button-function is totally confusing at all, and for advanced members it's not necessarily needed.
To my opinion, the function should be

Code: Select all

char ButtonPressed();
which scans and returns 0 or the Btn code of the currently pressed Btn without waiting for a Btn to be hit or released.
if no button is pressed, it returns 0 (zero) which is equal to FALSE, and if any different value is returned in case there IS a btn pressed, it returns the specific btn code >0 which implements TRUE.

With this design you alternatively may evaluate both the specific Btn-Code and may use it just like a boolean expression

Code: Select all

char BtnValue=ButtonPressed(); // assigns the code of the specific Btn which is pressed
if (ButtonPressed()== Btn1) // asks if just Btn1 is pressed
if (ButtonPressed())   // asks if ANY a Btn is pressed
The other (completely different) counter functionality should be done by the specific 2nd function

Code: Select all

void ButtonResetCount(const byte btn);
which already exists.

BTW:

Code: Select all

char getchar() 
is a stdio function that should not be forgotton in this context.
IIRC getchar() waits until a Btn is pressed and then until it's released again.

With this re-designed function char ButtonPressed() together with char getchar() we would have the functionality and convinence that would be desirable.

Further both functions could be easily extended to be able to read 2 or more Buttons being pressed simultaneously if also the btn scan codes will be adjusted:

Code: Select all

Button ScanCode
btn[1] = 1
btn[2] = 2
btn[3] = 4
btn[4] = 8

5 = btn[1] + btn[3] // pressed simultaneously
14= btn[2]+ btn[3] + btn[4] // pressed simultaneously

an additional function

Code: Select all

char ButtonLongPressed();
may enhance this analogically


ps:
@admins:
both muntoo's post and my widening one are actually NXC issues, not Bricxcc issues. Maybe you can move them to the NXC wishlist if you wish ;)

Re: wishlist for BricxCC

Posted: 19 Dec 2010, 21:20
by muntoo
doc-helmut wrote: ps:
@admins:
both muntoo's post and my widening one are actually NXC issues, not Bricxcc issues. Maybe you can move them to the NXC wishlist if you wish ;)
You're right. I didn't realize I posted on the wrong thread. Oh well, no going back now (unless a admin helps out or something). :)

IMO, the wish I said earlier [bool ButtonPressed(const byte btn, bool resetCount = false)] should remain, in compatibility with legacy programs. Instead, I propose a new API function, GetButtonDirection().

Here's my design:

Code: Select all

/*  Program Name: "GetButtonDirection.nxc"
**  This program was created by "muntoo" on December 18, 2010
**  Created using BricxCC (by John Hansen) and written in NXC (by John Hansen)
**  ( http://bricxcc.sourceforge.net/ )

Description:
A way of calling ButtonPressed() safely (for multiple threads).
*/


#ifndef __GETBUTTONDIRECTION_NXC__
	#define __GETBUTTONDIRECTION_NXC__


#define GETBUTTONDIRECTIOM_SAFECALL


#ifdef GETBUTTONDIRECTIOM_SAFECALL
safecall inline byte GetButtonDirection(bool resetCount = false)
#else
inline byte GetButtonDirection(bool resetCount = false)
#endif
{
	/*
	From NXC Programmer's Guide:

	BTN1, BTNEXIT		0
	BTN2, BTNRIGHT		1
	BTN3, BTNLEFT		2
	BTN4, BTNCENTER		3
	NO_OF_BTNS			4
	*/

//	return((ButtonPressed(BTNCENTER, resetCount) << BTNCENTER) | (ButtonPressed(BTNLEFT, resetCount) << BTNLEFT) | (ButtonPressed(BTNRIGHT, resetCount) << BTNRIGHT) | ButtonPressed(BTNEXIT, resetCount)); // (ButtonPressed(BTNEXIT, resetCount)) << BTNEXIT)
	return((ButtonPressed(BTN4, resetCount) << BTN4) | (ButtonPressed(BTN3, resetCount) << BTN3) | (ButtonPressed(BTN2, resetCount) << BTN2) | ButtonPressed(BTN1, resetCount)); // (ButtonPressed(BTN1, resetCount)) << BTN1)
}


inline bool ButtonDirectionPressed(byte ButtonDirection, byte btn)
{
	/*
	From NXC Programmer's Guide:

	BTN1, BTNEXIT		0
	BTN2, BTNRIGHT		1
	BTN3, BTNLEFT		2
	BTN4, BTNCENTER		3
	NO_OF_BTNS			4
	*/

	return(((ButtonDirection >> btn) & 0x01) != 0);
}
#endif