Cross platform GUI project (debugger for FreeBASIC)

User projects written in or related to FreeBASIC.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 22, 2015 8:54

Hello everyone!

SARG wrote:What do you think about opening an other topic in projects ? Just to keep "clean" the current fbdebugger project.

Good idea. Done here.

SARG wrote:Only in the source code menu.

OK, thanks!

Are there any double menu features in the other menus (not related to the toolbar buttons, but to other menus)? Ie. are

  • cmenuwatch: Edit value
  • cmenuvarproc: Edit var value
different routines (entry points) in fbdbg?

SARG wrote:Kill process (button) = Kill debuggee (src code menu) --> to kill the running exe Kill thread (only thread menu) --> to kill only one thread of the running exe. If there is only one thread the debuggee is obviously killed....

From the OS point of view the running debuggee is also a thread, as you said. I just try to learn the fbdbg terminology.

At the current stage I need to know how many callbacks I should prepare for you as entry points in the functional code. If there are two menu options pointing to the same functional code, it'd be beneficial to have just one entry point.

We also can adapt this later. But when we do it now, we both have less work (and less code to handle).

SARG wrote: Nota : Currently the shortcuts can be customized but the change is only made in the text of the menu options not in tooltips....

I don't explain shortcuts in the tooltip (the user can see them in the label). And I don't use abbreviations in the tooltip. Unlike the label, the tooltip can show more text, several lines and paragraphs if needed.

SARG wrote:Is it possible to put each button closer to each other as the main window could be smaller.

The window could get smaller, even with this button distance. (Surplus buttons get shown as a menu in this case.)

It is possible to decrease the distance (when we use a ToolPalette instead of a ToolBar). GTK+ uses a minimal size for toolbar buttons (based on studies on user preferences). Your images are smaller than this minimal size and they get expanded.

I'd prefer to enlarge the images.

SARG wrote:Is it possible to regroup the buttons by use as it's showed in mainwind.jpg ?

You mean separators between button groups? That's possible. (Visible or invisible?)

SARG wrote: Is it possible to put a border to all of them ?

I could enclose them by a frame. But it'd be better for faster execution, when the border is in the image.

SARG wrote:The about box/dialog is also an option in the tools menu so keep or remove the star ?

It's common practise to have this feature in the Help menu, or, when missing, in the toolbar. (Not every user is used to use the right mouse button and may not find this important information.) Anyway, it's easy to remove it later on.


Some questions:

1)
In the tools2.jpg menu I see two entries

  • Show log file
  • Hide log file
Wouldn't it be better to use just one menu entry with a checkmark? Or drop both entries and enclose the log file widget by a paned container, so that the user can minimize its size without menu action?

2)
In the right notebook there are five tabs. I couldn't find the context of some tabs. Here's what I found:

  • Proc/Var: TreeView, one text column
  • Procs: ListView, one bool and one text columns (shouldn't it be three text columns?)
  • Threads: TreeView, one text column (shouldn't it be four text columns for place, name, type and value?)
  • Watched var: ???ListView, one text column
  • Mem: ???ListView, ??? columns ???
Could you please clearify?

[Edit]Subject precisized.[/Edit]
Last edited by TJF on Jan 23, 2015 20:18, edited 2 times in total.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project

Postby TJF » Jan 22, 2015 19:58

Hi all!

@SARG

This is the smallest size I could get the toolbar (containing visible separators here). The width shrinked from 1040 to 860 pixel. Note the quadrate under the mouse pointer. It's the minimal size of a toolbar button.

Image

Toolbar, tooltips, source view and menus are working (we only need FreeBASIC and ASM syntax highlighting?). 68 entry points from the GUI to the functional code?

I'd like to get input on how to design the context of the right notebook tabs. And it seems that the area between the notebooks and the status bar may contain further widget (log, variables, ...). Please provide a list of all possible widgets, preferably with images.

I'd like to send you a source package for testing. Do you have a working GTK+-3 installation? Can you compile the example GNOME Header Set:examples/GUI/GTK+/FB_Calc/FB_Calc.bas on your box?
SARG
Posts: 1160
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Cross platform GUI project

Postby SARG » Jan 23, 2015 1:19

Hi,

You go too fast for me but that's a good thing. ;-)

TJF wrote:
SARG wrote:What do you think about opening an other topic in projects ? Just to keep "clean" the current fbdebugger project.

Good idea. Done here.
Fine. I would have put a precision in the title : "(debugger for FreeBasic)"

TJF wrote:Are there any double menu features in the other menus (not related to the toolbar buttons, but to other menus)? Ie. are

  • cmenuwatch: Edit value
  • cmenuvarproc: Edit var value
different routines (entry points) in fbdbg?
These are same entries, knowing the current (displayed) tab is possible to retrieve the concerned variable or memory area.
proc/var tab and watch tab : edit value, variable or memory dump, show/expand ,show z/w/string
proc/var tab and proc tab and thread tab : locate or show proc (source)
proc/var tab and thread tab : proc call backtracking, proc call chaining

TJF wrote:
SARG wrote:Kill process (button) = Kill debuggee (src code menu) --> to kill the running exe Kill thread (only thread menu) --> to kill only one thread of the running exe. If there is only one thread the debuggee is obviously killed....

From the OS point of view the running debuggee is also a thread, as you said. I just try to learn the fbdbg terminology.
It is not a fbdebg terminology. Under Windows when the debuggee is launched the debugger receives the signal CREATE_PROCESS_DEBUG_EVENT then for each thread CREATE_THREAD_DEBUG_EVENT.

TJF wrote:At the current stage I need to know how many callbacks I should prepare for you as entry points in the functional code. If there are two menu options pointing to the same functional code, it'd be beneficial to have just one entry point.

We also can adapt this later. But when we do it now, we both have less work (and less code to handle).
See above.

TJF wrote:
SARG wrote: Nota : Currently the shortcuts can be customized but the change is only made in the text of the menu options not in tooltips....

I don't explain shortcuts in the tooltip (the user can see them in the label). And I don't use abbreviations in the tooltip. Unlike the label, the tooltip can show more text, several lines and paragraphs if needed.
Ok remove the abbreviations.

TJF wrote:
SARG wrote:Is it possible to put each button closer to each other as the main window could be smaller.

The window could get smaller, even with this button distance. (Surplus buttons get shown as a menu in this case.)

It is possible to decrease the distance (when we use a ToolPalette instead of a ToolBar). GTK+ uses a minimal size for toolbar buttons (based on studies on user preferences). Your images are smaller than this minimal size and they get expanded.

I'd prefer to enlarge the images.


TJF wrote:
SARG wrote: Is it possible to put a border to all of them ?

I could enclose them by a frame. But it'd be better for faster execution, when the border is in the image.
They are a bit ugly. I'll redraw them adding also a border. What is the minimal W x H size ?
By the way, some buttons could be deactivated.

TJF wrote:
SARG wrote:Is it possible to regroup the buttons by use as it's showed in mainwind.jpg ?

You mean separators between button groups? That's possible. (Visible or invisible?)
Choose the easiest way (separator or space). Separators in the new screenshot seems ok.

TJF wrote:
SARG wrote:The about box/dialog is also an option in the tools menu so keep or remove the star ?

It's common practise to have this feature in the Help menu, or, when missing, in the toolbar. (Not every user is used to use the right mouse button and may not find this important information.) Anyway, it's easy to remove it later on.
No right click : it's an entry in tools menu gotten when left click on the tools button.

TJF wrote:1)In the tools2.jpg menu I see two entries

  • Show log file
  • Hide log file
Wouldn't it be better to use just one menu entry with a checkmark? Or drop both entries and enclose the log file widget by a paned container, so that the user can minimize its size without menu action?
To be logical as the log file could unexist if it has been deleted the 2 entries should be kept. All grayed means no log file.
Currently the log is written on a console window and/or in a file. Perhaps it will be better to replace the console by a "floating" GTK window with a button to clear it. I have to think about that point.

TJF wrote:2)In the right notebook there are five tabs. I couldn't find the context of some tabs.

  • Proc/Var: TreeView, one text column
  • Procs: ListView, one bool and one text columns (shouldn't it be three text columns?)
  • Threads: TreeView, one text column (shouldn't it be four text columns for place, name, type and value?)
  • Watched var: ???ListView, one text column
  • Mem: ???ListView, ??? columns ???
Could you please clearify?
The 4 first are treeviews with only one column of text. It's easier for me to update them.

Mem is a listview containing 4, 6, or 8 columns. The left one shows the addresse in memory and the right one the ascii character for the 16 bytes >31 of the line.
Columns in the middle are used for numeric values ie 2 columns if ulongint or longint or double. 4 columns if integer (32b) or uinteger or single. And son on.


TJF wrote:Toolbar, tooltips, source view and menus are working
Looks very good. Good job. An aera for the next executed line is missing between the buttons and the code window. The most area in status bar is dedicated to the fast run counter.
TJF wrote:we only need FreeBASIC and ASM syntax highlighting?
Yes
TJF wrote:68 entry points from the GUI to the functional code?
I don't know : the way I coded with Windows's API is different. However there are about 125 constants used to call procs from buttons and menu entries. I'll list them later.

TJF wrote:I'd like to get input on how to design the context of the right notebook tabs. And it seems that the area between the notebooks and the status bar may contain further widget (log, variables, ...). Please provide a list of all possible widgets, preferably with images.
If you can't open chm file I upload a zip file with all the html files used to create the chm.
http://users.freebasic-portal.de/sarg/help_fbdbg_files.zip There is no a main page so you have to access one by one, sry.

TJF wrote:I'd like to send you a source package for testing. Do you have a working GTK+-3 installation? Can you compile the example GNOME Header Set:examples/GUI/GTK+/FB_Calc/FB_Calc.bas on your box?
I'll test and tell you.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: Cross platform GUI project

Postby AGS » Jan 23, 2015 1:44

Good to see things moving along.

@TJF
I have a question/request.

Are you going to put the gui code online at http://users.freebasic-portal.de/tjf ? That way SARG and I (and other interested programmers) can have a look at it.

Looking forward to trying out the new gui. Your efforts to port fbdebugger to gtk are much appreciated.

@SARG
Regarding documentation: what would be an acceptable document format? I could create a manual using some kind of markup language. And then generate the final documentation using that markup language as input and a program to transform markup language into the final format.

Apache fop is an example of a program that can be used to generate a pdf file (Latex can be used to do the same). There are quite a few programs out there that can create documentation in some format using input written in some other format (usually a markup-like language is used as input format).

Plain html is always an option (using a html editor). Or writing documentation using libre office, abiword or some other 'free' word processor.

I leave you with an example of a large manual written for a debugger years ago. The following link http://www.gnu.org/software/ddd/manual/ is a link to documentation for the Data Display Debugger (DDD). DDD is one of the first (and best) GDB front ends ever created (though it's use of the Motif - tool kit makes it look a bit dated). The DDD developers have used texinfo as input format and latex to create documentation in html/postscript/pdf format.

The pdf version of the ddd manual looks very nice http://www.gnu.org/software/ddd/manual/pdf/ddd.pdf
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project

Postby TJF » Jan 23, 2015 20:16

Hi all!

AGS wrote:Are you going to put the gui code online at http://users.freebasic-portal.de/tjf ? That way SARG and I (and other interested programmers) can have a look at it.

Looking forward to trying out the new gui.

Yes, I'm going to upload the source ASAP (got the images from SARG and started coding the day before yesterday). Since the source will change a lot the next days, I'll take some more days before I upload (finetuning the API for easy access, first).

The downside at FBP server is that I've to pack the source tree and upload the complete archive. This may be a lot of data when the project grows. And, more important, it's a lot of manual action (including usage of Filezilla, which is a pain in the rear).

Rather than uploading on FBP, I'd prefer a (newly created) GIT repository. This may be on github.com, sourceforge.com, gitorius.com or wherever. Downloading should be possible for everyone. SARG, you and me should have write access. Uploading would then be a single command at my side.

Can you care about that topic, select a good hoster and create such a repository, please? (I'd prefer a hoster that allows to also remove the repository, ie. for the case when the hoster starts to add commercials to the download, or when the project fails.)


Regarding documentation:

Could you please also consider to use Doxygen for generating the tutorial? Output can be in html (->chm), tex (->pdf) and xml. The tutorial input could be markup language (, or plain html). SARG could also use it to document the source code. In that case hyper-links between the source docs and the tutorial could get auto-generated in a single html tree (or pdf file).

Doxygen isn't perfect, but it has a lot of features and its documentation is good, IMHO. And it's pretty fast. (And it's written by a fellow-countryman of yours ;-)


SARG wrote:proc/var tab and watch tab : edit value, variable or memory dump, show/expand ,show z/w/string
proc/var tab and proc tab and thread tab : locate or show proc (source)

Done. Is it OK to use the same text for all labels, in order to make it more transparent to the user?

SARG wrote:proc/var tab and thread tab : proc call backtracking, proc call chaining

I couldn't find these in cmenuvarproc.jpg?

SARG wrote:Ok remove the abbreviations.

I'll make minimal text changes, just to make it work. The next step is to cross-check the tooltips by you and AGS, and then by the translators.

SARG wrote:They are a bit ugly. I'll redraw them adding also a border. What is the minimal W x H size ?

The current size is 16x16. I made a test with a slightly bigger icon (28x28). It gets downscaled and also shown as 16x16 icon.

I'd like to postpone that issue. First, I'd like to know if the GUI API is OK for you, before I care about details. (Later, I may do some tests to replace the toolbar by an IconView, where we'll have full control over the icon sizes, but this may need additional code.)

SARG wrote:By the way, some buttons could be deactivated.

I made GtkActions to trigger the callbacks. The action contains (if any)

  • the label (and short label) text
  • the icon
  • the tooltip
  • a keyboard shortcut (=accelerator)
and proxies the appearance of the connected GUI widgets. When you make the action non-activatable, all proxied widgets (ie. a ToolButton and several MenuItems in different menus) gets insensitiv (greyed out) at the same time. (You can also group the actions, in order to change a complete set in one go.)

SARG wrote:Choose the easiest way (separator or space). Separators in the new screenshot seems ok.

Done.

SARG wrote:No right click : it's an entry in tools menu gotten when left click on the tools button.

Done.

SARG wrote:The 4 first are treeviews with only one column of text. It's easier for me to update them.

Easy update, OK. But the user may want to sort by type, place, value?

Realy one column? What about

  • Procs: the quadrate on the left side (ie. proc.jpg)?
  • Watch: the 'T' character on the left side (tracewatch.jpg)?

SARG wrote:Mem is a listview containing 4, 6, or 8 columns.

This means 5 to 9 columns including the prepended line number (or offset)?

SARG wrote:The left one shows the addresse in memory and the right one the ascii character for the 16 bytes >31 of the line.
Columns in the middle are used for numeric values ie 2 columns if ulongint or longint or double. 4 columns if integer (32b) or uinteger or single. And son on.

I'll prepare 8 data columns with text renderer (plus line number column). You can make surplus columns invisible, when filling the list store.

SARG wrote:Looks very good. Good job. An aera for the next executed line is missing between the buttons and the code window. The most area in status bar is dedicated to the fast run counter.

Thanks!

I omitted this line knowingly, because the current line gets marked in the source view.

You need it? A single line, not expanding? Only cursor driven scrolling for an overlength line (char or word wrapping)? Monospace font? Syntax highlighting?

SARG wrote:I don't know : the way I coded with Windows's API is different. However there are about 125 constants used to call procs from buttons and menu entries. I'll list them later.

I miss-counted, sorry. Currently I have 103 entry points.

The list is well appreciated. It'll help me to cross-check the API.

Please add the names of your SUBs/FUNCTIONs to that list, so I can adapt the naming of the callback files, in oder to make it easy for you to find the connecting points.

SARG wrote:Fine. I would have put a precision in the title : "(debugger for FreeBasic)"

Done.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 24, 2015 12:05

Hi all!

Proposal for new Settings dialog:

Image
I shortened some labels. A more detailed description will come up in the tooltip (ie. for the pause value (delay) for auto step mode).

Instead of line limits I made a slider. The current line will appear at this position (source window will scroll, if possible).

I'd like to separate the keyboard shortcuts to an extra window (like shcutlist.jpg, but editable). The user can edit in a list view seeing all other shortcuts (in order to avoid double defines).

Just noticed: the foreground color is missing.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 24, 2015 16:12

It's my GtkThemingEngine that limits the minimal icon size in the tollbar. Using a different theme we can get smaller icons:

Image
SARG
Posts: 1160
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby SARG » Jan 24, 2015 21:20

Hi happy coders,

Sorry for this late reply, it takes me a lot of time to write this kind of answer (finding/preparing information, writing understandable things, in english).

AGS wrote:@SARG
Regarding documentation: what would be an acceptable document format? I could create a manual using some kind of markup language. And then generate the final documentation using that markup language as input and a program to transform markup language into the final format.

Apache fop is an example of a program that can be used to generate a pdf file (Latex can be used to do the same). There are quite a few programs out there that can create documentation in some format using input written in some other format (usually a markup-like language is used as input format).

Plain html is always an option (using a html editor). Or writing documentation using libre office, abiword or some other 'free' word processor.

I'm totally noob about all these tools. On Windows CHM files are the standard (I guess). I have made HTML pages then use of "HTML Help Workshop" creates the chm file.
On Linux what is the most used ? The easiest and the most universal is the better.
However as for coding using tools I don't control could be a problem (for me) later. The final product should be in a format I can reuse even without all markups you are talking.

It would be great to be able to call a selected page from the debugger : a functionnality to display the mouse cursor as a question mark and when cliking on an area the help file is opended and the corresponding information is displayed.

AGS wrote:I leave you with an example of a large manual written for a debugger years ago. The following link http://www.gnu.org/software/ddd/manual/ is a link to documentation for the Data Display Debugger (DDD).

DDD is one of the first (and best) GDB front ends ever created (though it's use of the Motif - tool kit makes it look a bit dated). The DDD developers have used texinfo as input format and latex to create documentation in html/postscript/pdf format.

The pdf version of the ddd manual looks very nice http://www.gnu.org/software/ddd/manual/pdf/ddd.pdf

I just look at some pages. Although most of features are already in fbdbg I guess I could find here some ideas of new ones.
217 pages : a bit too much. ;-)

A doc like the existing user's manual (synthetic but exhaustive if up to date...) seems better but I'm a not good judge of my work.
A tutorial to explain the principles and how to use the basic features is currently an important missing. Casual coders may not have an idea of the help brought by a debugger and how to use it. Regular coders need only explanations on 'advanced' features.

@TJF
No problem for compiling the fb_calc example. Although I had to move the "with" statement otherwise t and disp were not declared.

Code: Select all

 VAR disp = GTK_ENTRY(GUI.EntDisplay)
VAR t = *gtk_entry_get_text(disp)
IF t = "0" ORELSE CLEAR_DISPLAY THEN t = ""
WITH GUI


TJF wrote:
SARG wrote: wrote:
Fine. I would have put a precision in the title : "(debugger for FreeBasic)"

Done.

Thanks.

Sorry for repeating, look at the user's manual (or the html files) it's full of information and you'll faster have answers for some of yours questions :-)

AGS wrote:Are you going to put the gui code online at http://users.freebasic-portal.de/tjf ? That way SARG and I (and other interested programmers) can have a look at it.Looking forward to trying out the new gui.

TJF wrote:Yes, I'm going to upload the source ASAP (got the images from SARG and started coding the day before yesterday). Since the source will change a lot the next days, I'll take some more days before I upload (finetuning the API for easy access, first).

However (I like this word..) could you quickly do it (even if the compilation can not be achieved) so that I could have an overview of all the types of elements generated by the project (except bas file).

TJF wrote:
SARG wrote:proc/var tab and watch tab : edit value, variable or memory dump, show/expand ,show z/w/string
proc/var tab and proc tab and thread tab : locate or show proc (source)

Done. Is it OK to use the same text for all labels, in order to make it more transparent to the user?

In fact an item in watch tab could be a variable or a memory area, this is why the labels are not identical...

TJF wrote:
SARG wrote:proc/var tab and thread tab : proc call backtracking, proc call chaining

I couldn't find these in cmenuvarproc.jpg?

Old version, my fault, see new options.jpg in the first zip file.
The two last entries:
"List to log" with subentries "List all proc/var" and "List selected proc/var"
"Copy to clipboard" with subentries "Copy all proc/var" and "Copy selected proc/var"

TJF wrote:
SARG wrote:Ok remove the abbreviations.

I'll make minimal text changes, just to make it work. The next step is to cross-check the tooltips by you and AGS, and then by the translators.

No comment except put more information ? We'll see later.

TJF wrote:
SARG wrote:They are a bit ugly. I'll redraw them adding also a border. What is the minimal W x H size ?

The current size is 16x16. I made a test with a slightly bigger icon (28x28). It gets downscaled and also shown as 16x16 icon.

I'd like to postpone that issue. First, I'd like to know if the GUI API is OK for you, before I care about details. (Later, I may do some tests to replace the toolbar by an IconView, where we'll have full control over the icon sizes, but this may need additional code.)

Not sure to understand : in a previous you wrote that the images are too small but they are 23 x 19. Anyway it could be seen later.

TJF wrote:
SARG wrote:By the way, some buttons could be deactivated.

I made GtkActions to trigger the callbacks. The action contains (if any)

the label (and short label) text
the icon
the tooltip
a keyboard shortcut (=accelerator)
and proxies the appearance of the connected GUI widgets. When you make the action non-activatable, all proxied widgets (ie. a ToolButton and several MenuItems in different menus) gets insensitiv (greyed out) at the same time. (You can also group the actions, in order to change a complete set in one go.)

Good thing, effectively a group of buttons and menuentries are in this case, when no running debuggee.

TJF wrote:
SARG wrote:The 4 first are treeviews with only one column of text. It's easier for me to update them.

Easy update, OK. But the user may want to sort by type, place, value?

The procs updating labels and values are obviously already coded no need to redo them. And I dont' see a reason to sort the proc/var items except to find one quickly. I have thought about a dialog to do this when there are a lot of items. However you are right for procs tab a sort is used : by proc name or by file name but just by putting the file name of proc before or after the proc name...
In the future having a separate column for the value of variables could allow to edit them without need of a external dialog box.

TJF wrote:Realy one column? What about
Procs: the quadrate on the left side (ie. proc.jpg)?
Watch: the 'T' character on the left side (tracewatch.jpg)?

Procs : you're right the checkbox to indicate that the proc is not to be debugged.
watch : There is always a space for the "T" and the letter is added when needed.

TJF wrote:
SARG wrote:Mem is a listview containing 4, 6, or 8 columns.

This means 5 to 9 columns including the prepended line number (or offset)?

SARG wrote:The left one shows the address in memory and the right one the ascii character for the 16 bytes >31 of the line.
Columns in the middle are used for numeric values ie 2 columns if ulongint or longint or double. 4 columns if integer (32b) or uinteger or single. And son on.

I'll prepare 8 data columns with text renderer (plus line number column). You can make surplus columns invisible, when filling the list store.

Sorry, I was tired : 4, 6, 10 and 18 columns.... : 8 bytes x 2, 4 bytes x 4, 2 bytes x 8, 1 bytes x 16 + address and the ascii values.
Caution the size of inside columns must be fixed Byte or Ubyte don't need the same space than Uinteger. And the display could be in hexa shorter than dec. See memory.jpg displaying integers.

TJF wrote:
SARG wrote:An area for the next executed line is missing between the buttons and the code window. The most right area in status bar is dedicated to the fast run counter.

I omitted this line knowingly, because the current line gets marked in the source view.
You need it? A single line, not expanding? Only cursor driven scrolling for an overlength line (char or word wrapping)? Monospace font? Syntax highlighting?

It's necessary : imagine a debuggee written with a lot of files or the current file is big. You are looking anywhere and want to return quickly to the current line.
A simple area to show the first characters (single line, left spaces and tabs are removed,no highlighting, no wrapping). Click on it to display the current line.

TJF wrote:
SARG wrote:I don't know : the way I coded with Windows's API is different. However there are about 125 constants used to call procs from buttons and menu entries. I'll list them later.

I miss-counted, sorry. Currently I have 103 entry points.
The list is well appreciated. It'll help me to cross-check the API.
Please add the names of your SUBs/FUNCTIONs to that list, so I can adapt the naming of the callback files, in oder to make it easy for you to find the connecting points.

I extract the code and add comment. I hope you'll find all you need. If not I'm still there. See point just below.

Nota : in fbdebugger there are 2 areas not yet ported in fltk version (no visible in the main window) : bookmarks and "breakpoint on var" (a test is done on ONE value stopping the debuggee is true).
@AGS/TJF : Are bookmarks an interesting feature (to be kept) ? More than one breakpoint on variable value needed ? How do you imagine the handle (not technically) for users ?

Code: Select all

           Case IDBUTSTEP 'STEP
                        stopcode=0
                        bcktrk_close
                        SetFocus(windmain) 'just to lose focus
                        thread_rsm()
            Case IDBUTSTEPP 'STEP+ over
                        procin=procsk
                        runtype=RTRUN
                        but_enable()
                        bcktrk_close
                        SetFocus(windmain)
                        thread_rsm()
            Case IDBUTSTEPM 'STEP- out
                        If proc_find(thread(threadcur).id,KLAST)<>proc_find(thread(threadcur).id,KFIRST) Then 'impossible to go out first proc of thread
                            procad=procsv
                            runtype=RTRUN
                            but_enable()
                        End If
                        bcktrk_close
                        SetFocus(windmain)
                        thread_rsm()
            Case IDBUTSTEPB 'STEP at bottom of proc 27/02/2013
                           If rline(thread(threadcur).sv).ad<>proc(procsv).fn Then 'if current line is end of proc simple step   26/02/2013
                             procbot=procsv
                             runtype=RTRUN
                             but_enable()
                           EndIf
                           bcktrk_close
                        SetFocus(windmain)
                        thread_rsm()
            Case IDBUTSTEPT 'STEP at top of proc 09/03/2013
                        If rline(thread(threadcur).sv).ad<>proc(procsv).fn Then 'if current line is end of proc simple step   26/02/2013
                             proctop=TRUE
                             runtype=RTRUN
                             but_enable()
                        EndIf
                        bcktrk_close
                        SetFocus(windmain)
                        thread_rsm()
            Case IDBUTAUTO,IDTHRDAUT 'simple and multi thread auto
                        threadaut=0
                        If LoWord(wparam)=IDTHRDAUT Then
                           For i As Integer =0 To threadnb
                              If thread(i).exc Then threadaut+=1
                           Next
                           If threadaut<2 Then fb_message("Automatic execution","Not enough selected thread so normal auto")
                        EndIf
                        runtype=RTAUTO
                        but_enable()
                        bcktrk_close
                        SetFocus(windmain)
                        thread_rsm()
            Case IDBUTRUN 'run debuggee
                        runtype=RTRUN
                        but_enable()
                        bcktrk_close
                        SetFocus(windmain)
                        fasttimer=Timer
                        thread_rsm()
            Case IDFASTRUN 'fast run
                        bcktrk_close
                        but_enable()
                        SetFocus(windmain)
                        fastrun()
            Case IDBUTSTOP 'halt running
                        If runtype=RTFREE Or runtype=RTFRUN Then
                           runtype=RTFRUN 'to treat free as fast
                           For i As Integer = 1 To linenb 'restore old instructions
                               WriteProcessMemory(dbghand,Cast(LPVOID,rline(i).ad),@breakcpu,1,0)
                            Next
                        Else
                           runtype=RTSTEP:procad=0:procin=0:proctop=FALSE:procbot=0
                        EndIf
                        Stopcode=CSHALTBU
                        SetFocus(dbgrichedit)
           Case IDBUTMINI 'mini windows
                        If dsptyp>99 Then 'set full screen
                           dsptyp-=100
                           DeleteObject(Cast(HGDIOBJ,hbrsh))
                           fb_ModStyle (windmain,WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_SIZEBOX Or WS_CAPTION Or WS_SYSMENU, 0,FALSE)
                           SetWindowPos(windmain,HWND_NOTOPMOST,recsav.left,recsav.top,recsav.right-recsav.left,recsav.bottom-recsav.top,SWP_NOACTIVATE)' OR SWP_NOSIZE OR SWP_NOMOVE
                        Else 'set mini screen
                           dsptyp+=100
                           GetWindowRect(windmain,@recsav)
                           fb_ModStyle (windmain,0,WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_SIZEBOX Or WS_CAPTION Or WS_SYSMENU, FALSE)
                           hbrsh=createsolidbrush(&h0000FF) 'red background
                           SetClassLong(windmain,GCL_HBRBACKGROUND,Cast(Long,hbrsh))
                           SetWindowPos(windmain,HWND_TOPMOST,50,50,456,45,SWP_NOACTIVATE ) ' OR SWP_NOSIZE OR SWP_NOMOVE
                        End If
                        SetFocus(windmain)
           Case IDBUTTOOL 'tools button
               GetCursorPos(@pnt)
               If Dir(ExePath+"\dbg_log_file.txt")="" Then 'the file can be deleted by user outside
                  EnableMenuItem(menutools,IDSHWLOG,MF_GRAYED)
                  EnableMenuItem(menutools,IDDELLOG,MF_GRAYED)
               Else
                  EnableMenuItem(menutools,IDSHWLOG,MF_ENABLED)
                  EnableMenuItem(menutools,IDDELLOG,MF_ENABLED)
               End If
               TrackPopupMenuEx(menutools, TPM_LEFTALIGN Or TPM_RIGHTBUTTON, pnt.x, pnt.y, hWnd,ByVal NULL)
               PostMessage(windmain, WM_NULL, 0, 0)
               SetFocus(windmain)
           Case IDBUTFILE 'selct file button
                treat_file("£$_NO$FILE_$£") 'hope that nobody uses a such name ;-)
                SetFocus(windmain)
           Case IDRICHWIN  'NOT USED  click sur dbgrichEdit prévoir remettre ligne en cours
                       'tester pour uniquement mouse sur client area
           Case IDNOTEWIN 'notes button
               If HiWord(wparam)=EN_CHANGE Then
                  If SendMessage(dbgedit1,EM_GETMODIFY,0,0) Then
                     SendMessage(butnotes,BM_SETIMAGE,IMAGE_BITMAP,Cast(LPARAM,bmb(21)))
                  EndIf
               EndIf
               'SetFocus(windmain)
            Case IDBUTRRUNE  'restart exe
                 Dim As Double dtempo=FileDateTime(exename)'21/07/2013
                 If exedate<>0 AndAlso exedate=dtempo Then
                    flagrestart=sourcenb
                 EndIf
                 If wtchcpt Then flagwtch=1
               treat_file(exename)
            Case IDLSTEXE 'last 10 EXE(s)   
               GetCursorPos(@pnt)
               Dim exelist As HMENU
               exelist = CreatepopupMenu()
               For i As Byte =0 To 9
                  If savexe(i)<>"" Then AppendMenu(exelist, MF_STRING,1200+i,savexe(i)):If i=0 Then AppendMenu(exelist, MF_SEPARATOR, 0, "")
               Next
               TrackPopupMenuEx(exelist, TPM_LEFTALIGN Or TPM_RIGHTBUTTON, pnt.x, pnt.y, hWnd,ByVal NULL)
               destroymenu(exelist)
               PostMessage(windmain, WM_NULL, 0, 0)
           Case 1200 To 1209  'popup menu showing all the 10 last debugged exes
                exename=savexe(LoWord(wparam)-1200)
                treat_file(exename)
            Case IDBUTATTCH  'attach running process
                If prun AndAlso kill_process("Trying to attach but debuggee still running")=FALSE Then
                        'nothing to do but better algo
               Else
                  GetCursorPos(@pnt)
                   fb_MDialog(@attach_box,"Attachment to a running process",windmain,pnt.x-300,pnt.y,100,150)
                End If
            Case IDBUTFREE 'release debuggee
                If fb_message("FREE","Release debugged prgm",MB_YESNO Or MB_ICONQUESTION)=IDYES Then
                   For i As Integer = 1 To linenb 'restore old instructions
                      WriteProcessMemory(dbghand,Cast(LPVOID,rline(i).ad),@rLine(i).sv,1,0)
                   Next
                   runtype=RTFREE
                   but_enable()
                   thread_rsm()
                End If
            Case IDBUTKILL  'kill process
                  kill_process("Terminate immediatly no saved data, other option Release")
            Case IDCMDLPRM   'open settings
                fb_MDialog(@settings_box,"Settings",windmain,50,25,337,196)
            Case IDABOUT 'about
               fb_message("FB DEBUGGER",fbdebuggerversion+Chr(13)+__DATE__+Chr(13)+"(C) L.GRAS"+Chr(13)+"sarg @ aliceadsl . fr")
            Case IDCMPINF 'show compilation information
               compinfo_sh
            Case IDINFOS 'proceess list
               If helpbx=0 Then helptyp=2:fb_Dialog(@help_box,"PROCESS LIST",windmain,2,2,400,250)
            Case IDLSTDLL 'DLL list (so on linux)
               If helpbx=0 Then helptyp=7:fb_Dialog(@help_box,"DLLS LIST",windmain,2,2,400,250)
            Case IDLSTSHC 'shorcut list
               If helpbx=0 Then helptyp=8:fb_Dialog(@help_box,"SHORTCUT KEYS LIST",windmain,2,2,400,250)
            Case IDDBGHELP 'open the help file
               help_manage '05/06/2013
            Case IDFILEIDE 'launch ide
                ide_launch()
            Case IDQCKEDT 'quick edit (use the source code as editor)
               If prun AndAlso kill_process("If YES debuggee is killed then Quick edit is started")=FALSE Then
                        'nothing to do but better algo
               Else
                  If dbgsrc="" OrElse Dir(dbgsrc)="" Then
                    fb_message("Quick internal Editor","No file !!!")
                  Else
                    sendmessage(dbgrichedit,EM_SETREADONLY,FALSE,0)
                    dsp_hide(1)
                    fb_Dialog(@save_box,"Quick edit",windmain,283,25,150,25)
                    setfocus(dbgrichedit)
                    sendmessage(dbgrichedit,EM_HIDESELECTION,1,0)
                    sendmessage(dbgrichedit,EM_SETSEL,1,1)
                  End If
               EndIf
            Case IDCLIPBRD 'copy notes to clipboard
               sendmessage(dbgedit1,EM_SETSEL,0,-1)
               sendmessage(dbgedit1,WM_COPY,0,0)
               sendmessage(dbgedit1,EM_SETSEL,-1,0)
            Case IDDELLOG 'delete log file if exists
                  Dim savflog As Integer=flaglog       'save see below
                  flaglog=flaglog And 1                'change the value but keeps screen output
                  dbg_prt(" $$$$___CLOSE ALL___$$$$ ") 'close the file if needed
                  Kill (ExePath+"\dbg_log_file.txt")   'delete it
                  flaglog=savflog 'restore the value to keep the use of file log
            Case IDSHWLOG'show log
                  log_show
            Case IDHIDLOG 'hide log
                  log_hide
            Case IDSHENUM'list enums
                If helpbx=0 Then helptyp=6:fb_Dialog(@help_box,"LIST ENUMS",windmain,2,2,260,250)
            Case IDCMPNRUN  'recompil bas then run
                 If source(dbgmain)="" Then
                    treat_file("£$_NO$FILE_$£")
                 Else
                    treat_file(source(dbgmain))
                 EndIf
            Case IDWINMSG'translate win message (windows only)
                winmsg()
            Case IDSHWBDH'show value in dec/hexa/bin
                dechexbin()
            Case IDFRTIMER 'show the value of fast timer
                fb_message("Fast run timer","Elapsed Time : "+Str(fasttimer))
            Case IDJITDBG 'set info in case of exception to launch fbdebugger (windows only)
               fb_MDialog(@jit_box,"Set/reset JIT debugger",windmain,283,25,325,60)
            Case IDTUTO 'not really used
               'If tutobx=0 Then fb_Dialog(@tuto_box,"Tutorial",windmain,20,280,325,60) '04/01/2013
               fb_message("Tutorial","Sorry, work in progress !!!")
            Case IDSETBRK 'set breakpoint
               brk_set(1)
            Case IDSETBRT 'set tempo brkp
               brk_set(2)
            Case IDBRKENB 'enable/disable brkp
               brk_set(3) '01/03/2013
              Case IDMNGBRK
               fb_MDialog(@brk_manage,"Manage breakpoints",windmain,500,8,330,170) '27/02/2013
            Case IDCONTHR 'run to cursor
               SetFocus(windmain)
               brk_set(9)
            Case IDEXEMOD 'modify execution from cursor
               exe_mod()
            Case IDSHWVAR 'show var retrieved from code windows
               var_tip(PROCVAR)
            Case IDSETWVAR'set var as watched retrieved from code windows
               var_tip(WATCHED)
              Case IDFNDTXT 'find text from code windows
               If hfindbx=0 Then 'findtext not active ?
                  stext=wtext() 'selected text or ascii text near cursor
                  fb_Dialog(@find_box,"Findtext (Circular)",windmain,283,25,100,25)
               End If
            Case IDACCLINE 'show not executable lines by changing their color
               'dsp_access(shwtab)
               dsp_noaccess
            Case IDFCSSRC 'open focus dialog
               If focusbx=0 Then
                   fb_Dialog(@focus_box,"Focus on some lines from source",windmain,2,2,400,260)
               EndIf   
            Case IDTGLBMK 'toogle on/off bookmark
               bmk_tgl()
            Case IDNXTBMK 'go to next bookmark
               bmk_goto(TRUE) 'bookmark move forward
            Case IDPRVBMK  'go to previous bookmark
               bmk_goto(FALSE)'move backward
            Case IDCURLIG 'display current line
                       exrichedit(curtab)
                       sel_line(curlig-1)
            Case IDBMKCMB 'click on bookmark area
               If HiWord(wparam)=CBN_SELCHANGE Then 'move to bmk
                  x=sendmessage(bmkh,CB_GETCURSEL,0,0)
                  x=sendmessage(bmkh,CB_GETITEMDATA,x,0)
                  If bmk(x).ntab<>shwtab Then exrichedit(bmk(x).ntab) 'change tab
                  sel_line(bmk(x).nline-1)'select line
               EndIf
            Case IDADDNOT 'add notes
               notes_add()
            Case IDGOTO 'goto line
                  line_goto
            Case IDLINEADR 'line address (in memory)
               line_adr
            Case IDLINEASM 'dissassembly line in source
               If helpbx=0 Then helptyp=9:fb_Dialog(@help_box,"Dissassembly line",windmain,2,2,400,250)
            Case IDPROCASM 'dissassembly proc from line in source
               If helpbx=0 Then helptyp=10:fb_Dialog(@help_box,"Dissassembly proc",windmain,2,2,400,250)
              Case ENLRSRC 'enlarge source
                 dsp_hide(1)
              Case ENLRVAR 'enlarge proc/var
                 dsp_hide(2)
            Case IDNOTES 'open or close notes
                 If dsptyp<>0 And dsptyp<>3 Then dsp_hide(dsptyp)'cancel full source or mem or var
                 dsp_hide(3)
              Case ENLRMEM 'enlarge dump
                 dsp_hide(4)
              Case IDVCLPSE 'collapse proc/var
               proc_expcol(TVE_COLLAPSE)
            Case IDLSTVARA 'list all var in log
               procvar_list()
            Case IDLSTVARS'list selected var in log
               procvar_list(1)
            Case  IDCLBVARA 'clipboard all '28/11/2014
               procvar_list(2)
            Case  IDCLBVARS 'clipboard selected var
               procvar_list(3)
            Case IDPTDUMP 'dump pointed data
               var_dump(tviewvar,1)
            Case IDVEXPND 'expand
               proc_expcol(TVE_EXPAND)
            Case IDSELIDX 'select index in prc/var tab
               If hindexbx=0 Then fb_Dialog(@index_box,"Index selection",windmain,283,25,350,250)
            Case IDSTWTCH1,IDSTWTCH2,IDSTWTCH3,IDSTWTCH4 'exchange watch 0 to 3
               watch_exch(LoWord(wparam)-IDSTWTCH1)
            Case IDWCHDEL'delete watch on cursor from watched
               watch_del(watch_find())
            Case IDWCHDALL'delete all watches
               If fb_message("Delete watched vars","Delete all",MB_YESNO Or MB_ICONQUESTION)=IDYES Then
                  watch_del()
               EndIf
            Case IDWCHVAR'show in proc:var window from watched
               watch_sel(watch_find())
            Case IDWCHTTGL 'toggle trace
               watch_trace(watch_find())
            Case IDWCHTTGA 'cancel all traces
               watch_trace()
            Case IDWCHDMP'dump for watched
               var_dump(tviewwch)
            Case IDWCHSTG'shw string from watched
               string_sh(tviewwch)
            Case IDWCHSHW'shw/exp from watched
               shwexp_new(tviewwch)
            Case IDWCHEDT'edit from watched
               If var_find2(tviewwch)<>-1 Then 'not local non-existent
                  fb_MDialog(@edit_box,"Edit var value (Be carefull)",windmain,283,25,350,50)
               End If
            Case IDSETWTCH 'set watched first free slot
               If var_find2(tviewvar)<>-1 Then watch_set()
            Case IDSETWTTR 'set watched + trace
               watch_addtr
            Case IDVARDMP  'var dump
              var_dump(tviewvar)
            Case IDSHSTRG  'show z/w/string
              string_sh(tviewvar)
            Case IDSHCHAR '03/11/2014
               char_sh(tviewvar)
            Case IDCHGZSTR 'change byte <-> zstring type
              zstringbyte_exchange()
            Case IDVAREDT  'edit var value
              If var_find2(tviewvar)<>-1 Then fb_MDialog(@edit_box,"Edit var value (Be carefull)",windmain,283,25,350,50)
            Case IDSHWEXP  'show and expand variables
               shwexp_new(tviewvar)
            Case IDVARBRK  'break on var value
              brkv_set(1) 
            Case IDRSTPRC 'reset all proc
               proc_flw(1)
            Case IDSETPRC 'set all proc
                 proc_flw(2)
            Case IDSORTPRC'toggle type of sort and update display 17/05/201
               procsort=1-procsort:proc_sh 3
            Case IDASMPRC '22/08/2013
               If helpbx=0 Then helptyp=11:fb_Dialog(@help_box,"Dissassembly proc",windmain,2,2,400,250)
            Case IDLOCPRC 'locate proc
               proc_loc()
            Case IDCALLINE 'locate calling line
               proc_loccall(1)
            Case IDPBCKTRK'backtracking from proc/var 22/08/2013
               proc_loccall(2)
            Case IDPCHNING'chaining from proc/var 31/08/2013
               proc_loccall(3)
            Case IDSHWPROC 'locate proc in proc/var treeview
               thread_procloc(1)
            Case IDSHPRSRC 'locate proc in source
               thread_procloc(2)
            Case IDTBCKTRK 'backtracking (from thread) 22/08/2013
               thread_procloc(3)
            Case IDTCHNING 'chaining (from thread) 31/08/2013
               thread_procloc(4)               
            Case IDPRCRADR 'information about running proc
               thread_procloc(5)'20/08/2013
            Case IDTHRDCHG 'change next executed thread
                thread_change
            Case IDTHRDKLL 'kill a thread
               thread_kill
            Case IDEXCLINE 'show line
               thread_execline(1)
            Case IDCREATHR 'show line creating thread
               thread_execline(2)
            Case IDTHRDLST 'list threads
               If helpbx=0 Then helptyp=1:fb_Dialog(@help_box,"THREADS LIST",windmain,2,2,260,250)
            Case IDTHRDEXP 'expand threads
               thread_expcol(TVE_EXPAND) '14/12/2012
            Case IDTHRDCOL   'collapse threads
               thread_expcol(TVE_COLLAPSE)
            Case IDFNDTXUP 'find text backward
               fb_find(0,sfind)
            Case IDFNDTXDW'find text forward
               fb_find(1,sfind)
            Case IDWATCH1,IDWATCH2,IDWATCH3,IDWATCH4 'check adr then select watched variable inside proc/var
               watch_sel(LoWord(wparam)-IDWATCH1)
            Case IDBRKVAR 'update break on var
               If brkv.adr<>0 Then brkv_set(2)


Your last posts, the settings dialog looks cleaner than mine. Over time I added new elements without rearranging them as I don't use a gui designer too much work..... Change "breack" by "break".
TJF wrote:I shortened some labels. A more detailed description will come up in the tooltip (ie. for the pause value (delay) for auto step mode).
Ok.
TJF wrote:Instead of line limits I made a slider. The current line will appear at this position (source window will scroll, if possible).
Ok.
TJF wrote:I'd like to separate the keyboard shortcuts to an extra window (like shcutlist.jpg, but editable). The user can edit in a list view seeing all other shortcuts (in order to avoid double defines).
No problem. Currently when clicking on the "A" button a check is done to control the double defines. It could also be done when the user selects "ok".

TJF wrote:Just noticed: the foreground color is missing.

About current default foreground colors : keywords = light blue, unexecutable lines = green, next executed line = dark blue, permanent breakpoint=red, temporary (one reach)=orange, executed line + breakpoint = mixed color and black for the rest. But we can play with the background color for breakpoints. I think it'll be clearer.

Regarding the log, 4 possibilities : output only on screen, only in a file (I don't know if a changing name is needed, TJF/AGS ?), both screen and file, no output. And the log file is in file append mode.

In the very last post icons looks better. Maybe a frame surrounding all ?

Fyi the 3 most right buttons are used to enlarge
1/the source code window
2/the current treview
3/ memory dump

An idea : is it possible to easily display line numbers. In the past I wanted to do that but as I used low level APIs it was very complicated.
If yes --> a new checkbox in settings and a new element in the ini file. It makes me think to give you information about the ini format.

Whew, enough for today ;-)
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby AGS » Jan 25, 2015 6:35

@SARG
HTML it is then. As far as Linux is concerned: this is what I found on a quick search on the net regarding documentation on Linux
There is no standard help format on Linux like there is on Windows. Most Linux applications provide a bunch of HTML files, or one large HTML file, as documentation.


So html format is good for both windows and linux (as an example: when you choose menu->help when using geany it launches a webbrowser showing the manual in html format).

It would be great to be able to call a selected page from the debugger : a functionnality to display the mouse cursor as a question mark and when cliking on an area the help file is opended and the corresponding information is displayed.


In - program help must involve adding things to the gui as launching the html help program is not an option (not on Linux). And launching the browser from the debugger doesn't sound like a good idea (especially if all the user wants is some context - sensitive information).

Using gtk this can be done using a tooltip. On gtk the tooltip window can be an arbitrary window that contains widgets (not just static text). That window could contain a textview (a widget not unlike a richedit). The text shown by the textview can be tagged (you can associate a tag with parts of the text). The tag associated with a tagged region of text can have an action associated with it. That action could be to launch a second window etc... etc...
So if a piece of text would be displayed as underlined text that could be interpreted as a link.
It is possible to combine the 'normal' tooltip with a more elaborate help - tooltip. Just add a link ("show help") to the tooltip window. If the user does not click the link then all he gets is the normal tooltip. Otherwise some other window opens with context - specific help.

Straight from the gtk manuals I give you this little piece of example code on how to use tags (basicified a bit to make it somewhat more readable)

Code: Select all

#define __USE_GTK3__
#include once "gtk/gtk.bi"

dim view as GtkWidget ptr
dim buffer as GtkTextBuffer ptr
dim start as GtkTextIter
dim end_ as GtkTextIter
dim font_desc as PangoFontDescription ptr
dim rgba_ as GdkRGBA
dim tag as GtkTextTag ptr

view = gtk_text_view_new ()

buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))

gtk_text_buffer_set_text (buffer, "Hello, this is some text", -1)

'' Change default font throughout the widget
font_desc = pango_font_description_from_string ("Serif 15")
gtk_widget_modify_font (view, font_desc)
pango_font_description_free (font_desc)

'' Change default color throughout the widget
gdk_rgba_parse ("green", @rgba)
gtk_widget_override_color (view, GTK_STATE_FLAG_NORMAL, @rgba)

'' Change left margin throughout the widget
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30)

''Use a tag to change the color for just one part of the widget
tag = gtk_text_buffer_create_tag (buffer, "blue_foreground",_
                        "foreground", "blue", NULL)
gtk_text_buffer_get_iter_at_offset (buffer, @start, 7)
gtk_text_buffer_get_iter_at_offset (buffer, @end, 12)
gtk_text_buffer_apply_tag (buffer, tag, @start, @end)


Quite a few things you can do with 'simple' html tags you can do with texttags. A textview can contain images as well.
It should prove possible to turn the manual pages (html) into equivalent textbuffer content. A textbuffer
can be attached to a textview dynamically depending upon the context (the necessary textbuffers could be prepared in advance and attached on demand).
If the user presses "show help" the buffer associated with the current context (a widget) is attached and the textview is shown (in a 'new' window).
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 25, 2015 15:27

Hi all.

I'm short of time, ATM. Just two more updates (including line numbers). Will comment later.

Image

Image
SARG
Posts: 1160
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby SARG » Jan 26, 2015 0:10

Hi Thomas,AGS,

TJF wrote:I'm short of time, ATM.
No problem it's not a race,.

- Change breack by break.
- "Break on var" is just a textbox to display something like "Stop if myvar<integer>=17 becomes <>17".
Clicking on it open the dialog to define/redefine/suppress the action.
- Reduce the font size in treeview.
- The log handle must be rethought. I'll give more details later.

The memory dump only in tab and a bookmark list (called by ?) instead the combobox in the main window ?
Give me your opinion.

AGS wrote:Using gtk this can be done using a tooltip. On gtk the tooltip window can be an arbitrary window that contains widgets (not just static text). That window could contain a textview (a widget not unlike a richedit). The text shown by the textview can be tagged (you can associate a tag with parts of the text). The tag associated with a tagged region of text can have an action associated with it. That action could be to launch a second window etc... etc...
So if a piece of text would be displayed as underlined text that could be interpreted as a link.
It is possible to combine the 'normal' tooltip with a more elaborate help - tooltip. Just add a link ("show help") to the tooltip window. If the user does not click the link then all he gets is the normal tooltip. Otherwise some other window opens with context - specific help.
Ok it seems a good way. But if I want to give infomation about the code window the tooltip could be showed too frequently.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 26, 2015 12:11

Hi SARG!

SARG wrote:No problem it's not a race,.

The whole life is a race. You're running against the death. Finally he will catch you.

SARG wrote:- Change breack by break.

I forgot, sorry. (You can do such minor changes later on.)

SARG wrote:- "Break on var" is just a textbox to display something like "Stop if myvar<integer>=17 becomes <>17".
Clicking on it open the dialog to define/redefine/suppress the action.

I implemented a button (with variable label text). That's more easy to handle by connecting to the "clicked" signal.

How to headline the lower table (replacement for ??? in screenshot below).

SARG wrote:- Reduce the font size in treeview.

This is up to the user. He chooses a GtkTheme that sets the font type and size.

We can override this settings, but it's bad practise in GTK+. Better ship the debugger with a default GtkTheme, setting a smaller font. But that's final fine tuning, we shouldn't care about such issues at the current stage.

SARG wrote:- The log handle must be rethought. I'll give more details later.

OK, waiting for input.

SARG wrote:The memory dump only in tab and a bookmark list (called by ?) instead the combobox in the main window ?
Give me your opinion.

I'm the newbie, trying to learn the debugger from looking at the GUI (without reading the docs).

No debugging experience -> no opinion, sorry. (What about discussing with the users in the other thread?)

Here's a new moc-up:

Image

I've a question regarding the status bar:

Do you need a real status bar, including a message stack? Or do you just show some labels (one state at a time)?

BR
Last edited by TJF on Jan 26, 2015 14:14, edited 1 time in total.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 26, 2015 12:42

Hi AGS!

I confirm, all your proposals about tooltips are possible. And even more. Ie. in a signal handler for the "query-tooltip" signal you can start any procedure. Ie. you could bring a background window in front, blick a certain widget, move the mouse pointer to that widget, ...

I'm sure that any newbie will be happy about such a help system -- for two or three days. Then he starts to think that it is bloat.

So from my point of view the most important features of such magic tooltips are

  • make them optional (the user should be able to switch them off and fallback to text/markup tooltips, or none)
  • make them separate (do not pollute the debugger source, instead put all this code in a separate module, loaded at run-time, or not loaded at all)

Another issue:

  • You want me to upload the source.
  • SARG wants me to upload the source.
  • I want to upload the source to a GIT repository.
Could you establish a website with (empty) GIT repository, please?


Aside @Sebastian: Any news about my last email (Nov. 2014, 27th)?
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby TJF » Jan 26, 2015 13:42

Some older topics:

SARG wrote:About current default foreground colors : keywords = light blue, unexecutable lines = green, next executed line = dark blue, permanent breakpoint=red, temporary (one reach)=orange, executed line + breakpoint = mixed color and black for the rest. But we can play with the background color for breakpoints. I think it'll be clearer.

I show moc-up screenshots here. To produce them, I choose any color in the GUI designer (and place any text in entries, treeviews, lists, ...), just to give you a feeling of the GUI look.

The final colors should be set by the fbdbg code regarding the parameters in the ini file (or by default parameters).

SARG wrote:Regarding the log, 4 possibilities : output only on screen, only in a file (I don't know if a changing name is needed, TJF/AGS ?), both screen and file, no output. And the log file is in file append mode.

  • output only on screen -> screen checked, file empty
  • only in a file -> screen unchecked, filename specified
  • both screen and file -> screen checked, filename specified
  • no output -> screen unchecked, filen empty
All 4 possibilities are trapped.

I think it's important that the user can either choose an existing file to append, or can create a new one.

SARG wrote:In the very last post icons looks better. Maybe a frame surrounding all ?

I didn't change my files. Just applied an other GtkTheme.

Finally those design features are up to the user. We could ship the fbdbg package with your prefered theme pre-selected. So we care about this issue when we start packaging.

SARG wrote:If yes --> a new checkbox in settings and a new element in the ini file. It makes me think to give you information about the ini format.

The checkbox is done (and an additional color chooser).

I think it's no good idea to make me handle the ini file, since it takes me too much time to understand the context. Instead it should be up to your code to

  • read the ini file (or set default parameters)
  • populate the dialog (I'll prepare example code for each widget type)
  • evaluate the dialog (I'll prepare example code for each widget type)
  • save the ini file.

SARG wrote:I extract the code and add comment. I hope you'll find all you need. If not I'm still there. See point just below.

Thank you. I tried to prepare the callbacks naming based on this list, but failed. Again, it takes me too much time to understand the context.

Here's how I'd like to go:

  • Some callbacks are finished. (They contain source, ie. to call the pop-up menus. Don't change.)
  • I'll prepare an empty callback for each toolbar button, named after the icon name. (They contain just a PRINT statement to output their name in console. You can use them as example code on how to connect a signal handler.)
  • Further callbacks will be empty and named as actXXX.bas. (Where XXX is the number of the triggering action. They contain a PRINT statement to output their name. To adapt meaningful naming you can rename the file, and then edit the file itself and the .ui file -- three adaptions, details later. Use the icon callbacks as examples.)

Enough for this post.
SARG
Posts: 1160
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Cross platform GUI project (debugger for FreeBASIC)

Postby SARG » Jan 27, 2015 0:08

Hi,

TJF wrote:
SARG wrote:No problem it's not a race,.

The whole life is a race. You're running against the death. Finally he will catch you..

Coder and philosopher ;-)

TJF wrote:
SARG wrote:- "Break on var" is just a textbox to display something like "Stop if myvar<integer>=17 becomes <>17".
Clicking on it open the dialog to define/redefine/suppress the action.

I implemented a button (with variable label text). That's more easy to handle by connecting to the "clicked" signal.

That's perfect.

TJF wrote:How to headline the lower table (replacement for ??? in screenshot below).

This part "was" the memory dump but as it's moved in a tab you could remove it.

TJF wrote:
SARG wrote:- Reduce the font size in treeview.

This is up to the user. He chooses a GtkTheme that sets the font type and size.

We can override this settings, but it's bad practise in GTK+. Better ship the debugger with a default GtkTheme, setting a smaller font. But that's final fine tuning, we shouldn't care about such issues at the current stage.

Ok.

TJF wrote:
SARG wrote:The memory dump only in tab and a bookmark list (called by ?) instead the combobox in the main window ?
Give me your opinion.

I'm the newbie, trying to learn the debugger from looking at the GUI (without reading the docs).

No debugging experience -> no opinion, sorry.

Bookmarks allow to easily jump to any lines (like in a book).
My question was : do you think it's an usefull feature ?
TJF wrote:What about discussing with the users in the other thread?

So readers, your advice is ?

TJF wrote:Here's a new moc-up:

You teach me a new word (mock-up)

TJF wrote:I've a question regarding the status bar:
Do you need a real status bar, including a message stack? Or do you just show some labels (one state at a time)?

Just showing labels :
- current state of the debugger/debuggee (waiting, loading codes, loading debugging data, no program, terminated, etc)
No need to keep an history
- thread id
- current module (file) name
- current proc name
- fastrun timer (elapsed time between a start and a stop)

TJF wrote:Some older topics:

TJF wrote:
SARG wrote:About current default foreground colors : keywords = light blue, unexecutable lines = green, next executed line = dark blue, permanent breakpoint=red, temporary (one reach)=orange, executed line + breakpoint = mixed color and black for the rest. But we can play with the background color for breakpoints. I think it'll be clearer.

I show moc-up screenshots here. To produce them, I choose any color in the GUI designer (and place any text in entries, treeviews, lists, ...), just to give you a feeling of the GUI look.

The final colors should be set by the fbdbg code regarding the parameters in the ini file (or by default parameters).

Clear.

TJF wrote:
SARG wrote:Regarding the log, 4 possibilities : output only on screen, only in a file (I don't know if a changing name is needed, TJF/AGS ?), both screen and file, no output. And the log file is in file append mode.

  • output only on screen -> screen checked, file empty
  • only in a file -> screen unchecked, filename specified
  • both screen and file -> screen checked, filename specified
  • no output -> screen unchecked, filen empty
All 4 possibilities are trapped.

I think it's important that the user can either choose an existing file to append, or can create a new one.

I could by default create/open a file with a name based on the exe name : test.exe --> test_dbg_log.txt changeable by the user.

TJF wrote:
SARG wrote:In the very last post icons looks better. Maybe a frame surrounding all ?

I didn't change my files. Just applied an other GtkTheme.

I was asking if it's possible to put only one frame surrounding all the buttons. Just a detail.

TJF wrote:Finally those design features are up to the user. We could ship the fbdbg package with your prefered theme pre-selected. So we care about this issue when we start packaging.

Ok.

TJF wrote:
SARG wrote:If yes --> a new checkbox in settings and a new element in the ini file. It makes me think to give you information about the ini format.

The checkbox is done (and an additional color chooser).

I think it's no good idea to make me handle the ini file, since it takes me too much time to understand the context. Instead it should be up to your code to

  • read the ini file (or set default parameters)
  • populate the dialog (I'll prepare example code for each widget type)
  • evaluate the dialog (I'll prepare example code for each widget type)
  • save the ini file.

I just wanted to give you the information : what parameters are saved in the ini. Read and save ini are already coded..


TJF wrote:
SARG wrote:I extract the code and add comment. I hope you'll find all you need. If not I'm still there. See point just below.

Thank you. I tried to prepare the callbacks naming based on this list, but failed. Again, it takes me too much time to understand the context.

Sure it was not nice to give you this information in this format, less work for me.... I'll prepare it in a format more usable.

TJF wrote:Here's how I'd like to go:

  • Some callbacks are finished. (They contain source, ie. to call the pop-up menus. Don't change.)
  • I'll prepare an empty callback for each toolbar button, named after the icon name. (They contain just a PRINT statement to output their name in console. You can use them as example code on how to connect a signal handler.)
  • Further callbacks will be empty and named as actXXX.bas. (Where XXX is the number of the triggering action. They contain a PRINT statement to output their name. To adapt meaningful naming you can rename the file, and then edit the file itself and the .ui file -- three adaptions, details later. Use the icon callbacks as examples.)

So lets go. Looking forward to see and I hope I 'll be able to quickly understand.

High time to go to sleep...

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 8 guests