Expand your desktop application Purebasic in 5 minutes

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Expand your desktop application Purebasic in 5 minutes

Post by microdevweb »

I normally developped with windev, but I'm not passionate PureBasic I find really excellent. I start developing an application for automatic generation PB files. Watch the video to see what this application will

I do not put soft online, because there are still too many bugs. But all good sugestion is to take.

The new video 2014/07/16 with a new orientation for simply development
http://youtu.be/ucyxzKID5QE

What time a beta version, 3 of 4 weeks i think
Last edited by microdevweb on Wed Jul 16, 2014 11:31 am, edited 1 time in total.
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Expand your desktop application Purebasic in 5 minutes

Post by IdeasVacuum »

Looks very interesting 8)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Expand your desktop application Purebasic in 5 minutes

Post by microdevweb »

Tahanks IdeasVacuum.... :P
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: Expand your desktop application Purebasic in 5 minutes

Post by Rings »

topic moved....
SPAMINATOR NR.1
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: Expand your desktop application Purebasic in 5 minutes

Post by Num3 »

I like it!
Keep up the good work.
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Re: Expand your desktop application Purebasic in 5 minutes

Post by byo »

Looks great!
One question comes to mind: can you share if you use a CanvasGadget as the modelling area?
I am trying to build a database modeller but not sure what's the best technique.

Keep up the good work on your project. :wink:
Proud registered Purebasic user.
Because programming should be fun.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Expand your desktop application Purebasic in 5 minutes

Post by microdevweb »

Thanks byo,

Yes i use the Canvas for draw a moleling area.

Look the code for the draw

Code: Select all

Procedure  FEN_MAIN_Draw()
      Protected W,H,TG,N,I,Nb_X,Nb_Y,X,Y,W_Txt,Txt$
      W=GadgetWidth(#MAIN_CANVAS)
      H=GadgetHeight(#MAIN_CANVAS)
      TG=Val(GetGadgetText(#MAIN_SPIN))
      Nb_X=Round(W/TG,#PB_Round_Nearest)
      Nb_Y=Round(H/TG,#PB_Round_Nearest)
      GereLink()
      StartDrawing(CanvasOutput(#MAIN_CANVAS))
      Box(0,0,W,H,gColorCanvas)
      If GetGadgetState(#MAIN_BT_GRILLE)=1
            For N=1 To Nb_X
                  For I=1 To Nb_Y
                        X=TG*N
                        Y=TG*I
                        If X<W And Y<H
                              Plot(X,Y,gColorGrille)
                        EndIf
                  Next
            Next
      EndIf
      DrawingFont(FontID(#Font_File))
      ForEach monAnalyse\mesFichiers()
            X=monAnalyse\mesFichiers()\X
            Y=monAnalyse\mesFichiers()\Y
            W=monAnalyse\mesFichiers()\W
            H=monAnalyse\mesFichiers()\H
            Box(X-2,Y-2,W+4,H+4,$000000)
            H=gHeightEntete
            Box(X,Y,W,H,monAnalyse\mesFichiers()\CoulEntete)
            Y+gHeightEntete
            H=monAnalyse\mesFichiers()\H-gHeightEntete
            Box(X,Y,W,H,monAnalyse\mesFichiers()\Coul)
            Y=monAnalyse\mesFichiers()\Y+10
            Txt$=monAnalyse\mesFichiers()\Nom$
            W_Txt=TextWidth(Txt$)
            ;Reduction du titre si plus grand
            While W_Txt>W
                  Txt$=Left( monAnalyse\mesFichiers()\Nom$,Len(Txt$)-4)+"..."
                  W_Txt=TextWidth(Txt$)
           Wend  
           X+(W/2)-(W_Txt/2)
           DrawText(X,Y,Txt$,monAnalyse\mesFichiers()\CoulTxtEntete,monAnalyse\mesFichiers()\CoulEntete)
           ;Impression des rubriques
           X=monAnalyse\mesFichiers()\X
           Y=monAnalyse\mesFichiers()\Y
           X+5
           Y+gHeightEntete
           Y+10
           DrawingMode(#PB_2DDrawing_Transparent)
           SortStructuredList(monAnalyse\mesFichiers()\myRubrique(),#PB_Sort_Ascending,OffsetOf(Rubrique\Order),TypeOf(Rubrique\Order))
           ForEach monAnalyse\mesFichiers()\myRubrique()
                 Txt$=monAnalyse\mesFichiers()\myRubrique()\Name$
                 W_Txt=TextWidth(Txt$)
                  ;Reduction du titre si plus grand
                  While W_Txt>W
                        Txt$=Left( monAnalyse\mesFichiers()\myRubrique()\Name$,Len(Txt$)-4)+"..."
                        W_Txt=TextWidth(Txt$)
                  Wend  
                  If monAnalyse\mesFichiers()\myRubrique()\Type=#TP_PRIMARY_KEY
                        DrawingFont(FontID(#ARIAL_14_BOLD))
                  Else
                        DrawingFont(FontID(#ARIAL_14))
                  EndIf
                  If Y+TextHeight("TESTE")<monAnalyse\mesFichiers()\Y+monAnalyse\mesFichiers()\H
                        DrawText(X,Y,Txt$,$000000)
                  Else
                        Break
                  EndIf
                  Y+TextHeight(Txt$)
           Next
           If monAnalyse\mesFichiers()\Selected=#True
                 DrawPoignee()
           EndIf
     Next
     DrawLink()
      StopDrawing()
EndProcedure

Code: Select all

Procedure DrawLink()
      Protected X2,Y2,X1,Y1,Txt$,Txt2$
      ForEach monAnalyse\mesLink()
            X1=0
            ForEach monAnalyse\mesLink()\myPunt()
                  If X1<>0 
                        X2= monAnalyse\mesLink()\myPunt()\X
                        Y2=monAnalyse\mesLink()\myPunt()\Y
                        LineXY(X1,Y1,X2,Y2,$000000)
                        X1=0
                        Y1=0
                        X2=0
                        Y2=0
                  EndIf
                  If X1=0 
                        X1= monAnalyse\mesLink()\myPunt()\X
                        Y1=monAnalyse\mesLink()\myPunt()\Y
                  EndIf
            Next
      Next
EndProcedure

Code: Select all

Procedure DrawPoignee()
      Protected X,Y
      DrawingMode(#PB_2DDrawing_Default)
      ;Poignée HG
      X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
      Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
      HG\X=X
      HG\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee HD
      X+monAnalyse\mesFichiers()\W
      HD\X=X
      HD\Y=Y
     Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee BG
      X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
      Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
      Y+monAnalyse\mesFichiers()\H
      BG\X=X
      BG\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee BD
      X+monAnalyse\mesFichiers()\W
      BD\X=X
      BD\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee MG
      X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
      Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
      Y+(monAnalyse\mesFichiers()\H/2)
      MG\X=X
      MG\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee MD
      X+monAnalyse\mesFichiers()\W
      MD\X=X
      MD\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee HM
      X=monAnalyse\mesFichiers()\X-(gTaillePoignees/2)
      Y=monAnalyse\mesFichiers()\Y-(gTaillePoignees/2)
      X+(monAnalyse\mesFichiers()\W/2)
      HM\X=X
      HM\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
      ;Poignee BM
      Y+monAnalyse\mesFichiers()\H
      BM\X=X
      BM\Y=Y
      Box(X,Y,gTaillePoignees,gTaillePoignees,gCouleurPoignees)
EndProcedure
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Re: Expand your desktop application Purebasic in 5 minutes

Post by byo »

That's awesome. Thanks for sharing.
I will study the code closely.

Your app runs smoothly from what I can see in the video. Congrats.
Proud registered Purebasic user.
Because programming should be fun.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Expand your desktop application Purebasic in 5 minutes

Post by microdevweb »

New vieo with the new orientation of project

http://youtu.be/ucyxzKID5QE
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
le_magn
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Aug 24, 2005 12:11 pm
Location: Italia

Re: Expand your desktop application Purebasic in 5 minutes

Post by le_magn »

microdevweb wrote:New vieo with the new orientation of project

http://youtu.be/ucyxzKID5QE
Any news? Project is dead? is possible to download latest beta version?
Thank you
Image
Post Reply