MindMap

Share your advanced PureBasic knowledge/code with the community.
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

You provide a great coding project to learn from falsam, thanks for sharing. :)
Are you planning on implementing Snap to Grid option at some stage. :?:
PureBasic! Purely the best 8)
MicroByte
New User
New User
Posts: 8
Joined: Tue May 08, 2012 11:06 pm

Re: MindMap

Post by MicroByte »

@falsam, i have tested this code on Windows 7 x86 and in my test all was working fine, and i agree, this is great code to learn from

Loving the new Canvas gadget, it has really spured the imagination of the forum gurus and some real nice stuff has come out of it, and going back to a comment on the first page of this thread ..... whos going to make us a nice new shiny Visual IDE lol

As the current visual editor is somewhat out-of-date, would the PB team consider releasing the source in the members area for a willing party to take up the challenge ..... My wife always tells me to "keep my silly ideas to myself" bet Fred says the same, lmao :wink:
User avatar
falsam
Enthusiast
Enthusiast
Posts: 632
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: MindMap

Post by falsam »

@electrochrisso : Implementing Snap to Grid option is planned but I have display problems when this option is enabled.

@MicroByte : A visual designer ? why not. Maybe using a drawing before you generate the final source.

Version 1.70 is enabled.

Add:
-Automatic calculation of the anchor point of the entity son.
For example, try to place the entity son above the parent entity.

➽ Windows 11 64-bit - PB 6.21 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect 🤪
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

@electrochrisso : Implementing Snap to Grid option is planned but I have display problems when this option is enabled.
I was thinking while lying in bed last night, how it might be easy to implement. Rather than snapping all objects each time one has moved, have the one or group that has been created/moved snapped, this will cut down on the amount of processing required. You could also have an option to snap (only when the option has been manually selected) to snap all of the objects in one go.
PureBasic! Purely the best 8)
User avatar
falsam
Enthusiast
Enthusiast
Posts: 632
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: MindMap

Post by falsam »

electrochrisso wrote:I was thinking while lying in bed last night, how it might be easy to implement. Rather than snapping all objects each time one has moved, have the one or group that has been created/moved snapped, this will cut down on the amount of processing required. You could also have an option to snap (only when the option has been manually selected) to snap all of the objects in one go.
Paris, 8:30 Am, hot coffee. I added some lines in this Nightly version 1.75.

:arrow: download:
MindMap V1.75 (Source)

Add
Line 377
Procedure GetNearPoint(x, SnapGrid) - returns the number nearest to another number.

Line 2283
Call GetNearPoint() for every entity that nested in another.

You can disable the snap to grid since the preference dialog (Ctrl + P)

Line 2371
Call GetNearPoint() to the parent entity.

Problem when moving the entity by pulling the top edge or the left edge.
I hoped you read soon. Maybe get a workaround for this bug.

See you soon.

➽ Windows 11 64-bit - PB 6.21 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect 🤪
MicroByte
New User
New User
Posts: 8
Joined: Tue May 08, 2012 11:06 pm

Re: MindMap

Post by MicroByte »

-Automatic calculation of the anchor point of the entity son.
For example, try to place the entity son above the parent entity.
Wow, perfect, i was making a bunch of small flowcharts with MindMap that shows my boss the basic workings of a web app im working on (template/database structure and such) as they like to have everything documented in case he fires me!!, in the previous version you had to be very careful where you placed new objects and it used quite a lot of space, with this automatic system i can save space and and have it look the way i wanted it to the first time round

i reckon this could be developed into a really useful commercial tool, if it was on sale i would have purchased it just for this task alone without considering what else it can be used for.

i do have some requests/suggestions, entity default border, back and text color options in preferences dialog so if im doing stuff for a particular project i dont have to set the color of every entity as i add it, and would it be possible to allow an option to draw the arrows on both entity anchor points and along the anchor line, and maybe an option to set the height of the anchor spigot and width of spigot and line

i have only used this tool, i have not had a good look at the source yet so im unsure if i will be able to contribute but i will look later and see if i can understand what your doing, hopefully i can add some of my own ideas
Problem when moving the entity by pulling the top edge or the left edge.
I hoped you read soon. Maybe get a workaround for this bug.
i see what you mean, not to pretty but just a calculation issue, sure we can fix it :)

and again, thanks for all your hard work :)
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

I have bookmarked the lines and am going through some of your code to get an understanding, looks like I will have to learn a bit of French, off to bed soon, I will work on it with a fresh mind in the morning, hope I can help out there. :)
PureBasic! Purely the best 8)
User avatar
falsam
Enthusiast
Enthusiast
Posts: 632
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: MindMap

Post by falsam »

Mindmap 1.76 is available

Add :
-Tools Preference Project (Ctrl + P).
Changing the default size of the clip (the clip horizontally or vertically)
Changing the width and height of the arrows.
Changing the diameter of the anchor point.

If you open a project prior to this version of MindMap you will not see the arrows and the clips.
Open preference dialog (Ctrl + P) and change the settings. Save your work.


-Entity Inspector.
You can change the border color of an entity.

➽ Windows 11 64-bit - PB 6.21 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect 🤪
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 796
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: MindMap collaboration

Post by Zebuddi123 »

Have you thought about a community collaboration for this project of your`s, maybe enhance the software to reverse engineer source to flow charts, create source from the flow chart created in the mindmap to create the basic flow of the code etc.

I think you have started some thing really good and expandable. there are some great programmers in our community and have not yet seen anything with a collaboration of members, maybe it would also be good to start sub classes of collaboration teams where the team leader would be the most advanced of the programmers who would mentor the other members it would be a great way to improved member skills and show off what pb can really do. :D

I for one would be really gutted if pb died or ceased, and the bigger and stronger the community is the better its survival and pb`s improvement as a programming system.

Anyone in arrangement ?

Note Fred and team!!! and you can hold me to this. should i win the lottery (which i do play) i would sponsor the pb team to work full time on pb and promote it, i do think its that good of a learning and teaching tool and capable of much much more.

I have looked at all sorts of programming systems since around 1986 from amos amiga e blitzbasic c delphi all the way up to the current offering and still think nothing touches pb for the things in respect mentioned above and would love to realize what pb is really capable of.

Zebuddi. :D :D
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

I think I have come up with a solution to the Snap to Grid problem. :)
Replace the block of code starting at 1700 in v175, I have not tested everything and a few tweaks may need to be made, but it seems to work fine here.

Code: Select all

        ;Dessin du cadre de sélection
        If \Current = #True
          DrawingMode(#PB_2DDrawing_Outlined)
          \Width = Int(Round(\Width / 10, #PB_Round_Nearest) * 10) -1
          \Height = Int(Round(\Height / 10, #PB_Round_Nearest) * 10) -1
          Box(\Left-1, \Top-1, \width+2, \Height+2, SelectBorderColor)
        EndIf
PureBasic! Purely the best 8)
MicroByte
New User
New User
Posts: 8
Joined: Tue May 08, 2012 11:06 pm

Re: MindMap

Post by MicroByte »

Perfect, thanks for that, seems to work pretty well

FYI line 1765 in v1.76
User avatar
falsam
Enthusiast
Enthusiast
Posts: 632
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: MindMap

Post by falsam »

@MicroByte : You are Welcome :)

New version 1.77 is available.
The snap to grid is corrected.
The snap to grid is not enabled by default. Use the project preferences to enable it. (Ctrl + P)

➽ Windows 11 64-bit - PB 6.21 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect 🤪
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

Hi falsam, I changed the code a bit so snap also works on right and bottom handles, but I am not sure how this will effect the other modes, as I had to comment out the If Mode..EndIf to get it to work.
I created a fairly complex flowchart and it seemed to work ok.

Code: Select all

		    ; Déplacement de l'entité parent - Move parent entity
		    If SnapToGrid = #True
		      ;If Mode = 1 Or mode = 3 Or Mode = 13 Or mode = 23
		        ;*ActiveEntity\Height = *ActiveEntity\Height + *ActiveEntity\Top-GetNearPoint(*ActiveEntity\Top, SnapY)
		        *ActiveEntity\Height = Int(Round(*ActiveEntity\Height / 10, #PB_Round_Nearest) * 10) -1
		        ;*ActiveEntity\Width = *ActiveEntity\Width + *ActiveEntity\Left-GetNearPoint(*ActiveEntity\Left, SnapX)		      
		        *ActiveEntity\Width = Int(Round(*ActiveEntity\Width / 10, #PB_Round_Nearest) * 10) -1
		      ;EndIf
		      *ActiveEntity\Left = GetNearPoint(*ActiveEntity\Left, SnapX)
		      *ActiveEntity\Top = GetNearPoint(*ActiveEntity\Top, SnapY)
		    EndIf
PureBasic! Purely the best 8)
User avatar
falsam
Enthusiast
Enthusiast
Posts: 632
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: MindMap

Post by falsam »

Thank you but ...... If you change the spacing points (Preferences Project-> SnapSize), your code no longer works.

I adopt your code like this :)

Code: Select all

; Déplacement de l'entité parent - Move parent entity
If SnapToGrid = #True
   *ActiveEntity\Height = GetNearPoint(*ActiveEntity\Height, SnapY) -1
   *ActiveEntity\Width = GetNearPoint(*ActiveEntity\Width, SnapX) -1
   *ActiveEntity\Left = GetNearPoint(*ActiveEntity\Left, SnapX)
   *ActiveEntity\Top = GetNearPoint(*ActiveEntity\Top, SnapY)
EndIf		    		    
Much simpler than mine.thank you very much:)

➽ Windows 11 64-bit - PB 6.21 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect 🤪
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: MindMap

Post by electrochrisso »

Thank you but ...... If you change the spacing points (Preferences Project-> SnapSize), your code no longer works.
Oh yeh! I forgot to change the 10 for snap var, I was testing for 10 pixels at the time, silly me. :lol:
Just tested your new code out and it works great now, and don't need that extra calculation I threw in, all that was needed was the -1 at the end, one learns something new every day. :wink:
PureBasic! Purely the best 8)
Post Reply