PureBasic Visual Designer

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wavemaker.

It works in Win98 if you comment out the SetWindowCallback() line, but then you lose the functionality included in the Callback procedure. You may also -as there have been some problems with IncludeFile- copy the contents of the included file and paste them instead of the IncludeFile commands.

Bye,

Juan Calderón Alonso
Registered user
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.

HI all,

Well I am new to PB as well but after seeing Fred's basic PB editor i have decided to take up his offer to improve upon it and continue to develop it in PB. I will release all the source code with it so all platforms can compile it and everyone can help out in the design of it.

So far it is looking good but needs more work before I release the first version of it here.

Stay tuned,

Peter Webb


Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I will look forward to it .

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

can't wait.... If you have problems, post them to be fixed.



Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.

HI Fred,

Just a quick question, as a registered user of PB for Win, how do I get the Linux ver of the compiler to test this editor on?

Thanks,



Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.
can't wait.... If you have problems, post them to be fixed.



Siggi
Hi.

I do have a question, in the resizing of gadgets i am using the VB trick of using a right mouse click to resize the gadgets. I hold down the right mouse button and move the mouse till the size is correct, then i release the right mouse button.

However in a piece of code such as

Repeat

Event = WaitWindowEvent()

.........
......... other code here,

Until Event = #WM_RBUTTONUP

it never seems to recognise the end of the loop, any ideas?

Thanks


Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
I do have a question, in the resizing of gadgets i am using the VB trick of using a right mouse click to resize the gadgets. I hold down the right mouse button and move the mouse till the size is correct, then i release the right mouse button.
I don't like those right mousebuttons, coz we can do the most stuff with th left one.
Btw, why not use small Buttons on the corners of a gadget like in VB ?


But to your question :
put 'Event = WaitWindowEvent()`into your Repeat loop



Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.

I don't like those right mousebuttons, coz we can do the most stuff with th left one.
Btw, why not use small Buttons on the corners of a gadget like in VB ?


But to your question :
put 'Event = WaitWindowEvent()`into your Repeat loop

Siggi
Thanks, the event line above is in my loop if you check. :) How would I use thesmall buttons on the corners of the gadget like vb then? Sounds like a better idea. I have a routine that detects when I am on the edge of the gadget.



Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
Thanks, the event line above is in my loop if you check. :) How would I use thesmall buttons on the corners of the gadget like vb then? Sounds like a better idea. I have a routine that detects when I am on the edge of the gadget.
If you click an gadget(You receive the ID) move the small Buttons
with 'ResizeWindow(x,y,w,h)' to the Position at the corners.
If you press one of them, you know i which directions the gadget should been stretched.

Oh it is now too late (0:55 AM) i take a sleep.


Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.
If you click an gadget(You receive the ID) move the small Buttons
with 'ResizeWindow(x,y,w,h)' to the Position at the corners.
If you press one of them, you know i which directions the gadget should been stretched.

Oh it is now too late (0:55 AM) i take a sleep.

Siggi
Hi,

I tiied that but ResizeWindow only seems to take an x and y parameter. Nothing in the docs about four parameters. Still no joy on the right mouse button up event, PB doesnt seem to recognise it properly.



Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

Good Morning World !
So My app is now ready, i take a closer look at his fundamentals.
wait until I post some examples.


Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Use ResizeGadget(#Gadget, x,y,Width,Height) instead.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
Use ResizeGadget(#Gadget, x,y,Width,Height) instead.
Yes i'm wrong.
But why have i display-errors after resizing ?
Try the following code:

Code: Select all

 #WindowHeight =  250 
#WindowWidth =  800 

Structure GadgetProperties
 x.l
 y.l
 w.l
 h.l
 Caption.s
 Tooltip.s
 ;etc
 ;etc
EndStructure



Dim GP.GadgetProperties (200)

For I=5 To 9 
 GP(I)\x=100*I -300
 GP(I)\y=10
 GP(I)\w=80
 GP(I)\h=25
 GP(I)\Caption=Str(I)+"-Button"
Next I      
For I=10 To 20 
 GP(I)\x=40*(I-10)+10
 GP(I)\y=120
 GP(I)\w=30
 GP(I)\h=15
 GP(I)\Caption=Str(I)+"-Test"
Next I 
For I=21 To 30 
 GP(I)\x=40*(I-20)+10
 GP(I)\y=140
 GP(I)\w=30
 GP(I)\h=15
 GP(I)\Caption=Str(I)+"-Test"
Next I 
For I=31 To 40 
 GP(I)\x=40*(I-30)+10
 GP(I)\y=180
 GP(I)\w=30
 GP(I)\h=40
 GP(I)\Caption=Str(I)+"-Test"
Next I 

#TestGadget=5
      
hWnd=OpenWindow(0,0,0, #WindowWidth, #WindowHeight, #PB_Window_SystemMenu |#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"XTract Linker")
InitGadget(1000)
If hWnd0 And CreateGadgetList(WindowID())0
 MoveWindow((GetSystemMetrics_(#SM_CXSCREEN)-#WindowWidth)/2,(GetSystemMetrics_(#SM_CYSCREEN)-#WindowHeight)/2)
 ButtonGadget(1,10,10,80,25,"Exit Demo")
 TextGadget(2,10,40,300,20,"Status:")
 TextGadget(3,10,70,300,20,"Status:")
 StringGadget(4,10,100,200,20,"Test.exe")
For I=5 To 10
 ButtonGadget(I,GP(I)\x,GP(I)\y,GP(I)\w,GP(I)\h,GP(I)\Caption)
Next I
For I=11 To 20
 CheckBoxGadget(I,GP(I)\x,GP(I)\y,GP(I)\w,GP(I)\h,GP(I)\Caption)
Next I
For I=21 To 30
 StringGadget(I,GP(I)\x,GP(I)\y,GP(I)\w,GP(I)\h,GP(I)\Caption)
Next I
For I=31 To 40
 ListViewGadget(I,GP(I)\x,GP(I)\y,GP(I)\w,GP(I)\h);,GP(I)\Caption)
Next I




CW=6
 ButtonGadget(101,1,1,CW,CW,"")
 ButtonGadget(102,1,1,CW,CW,"")
 ButtonGadget(103,1,1,CW,CW,"")
 ButtonGadget(104,1,1,CW,CW,"")
 ButtonGadget(105,1,1,CW,CW,"")
 ButtonGadget(106,1,1,CW,CW,"")
 
;-Mouse-Function Test
Repeat 
   EventID.l = WaitWindowEvent()
   UseWindow(0)
   x = WindowMouseX()
   y = WindowMouseY()
   Info1$=Str(EventID)+"("+Str(x)+"/"+Str(y)+")"
   If EventID & 1
    LBD= 1
   Else
    LBD=0
   EndIf  
   If EventID & 2
    LBU=1
   Else
    LBU=0
   EndIf
   If EventID & 8
    RBD=1
   Else
    RBD=0
   EndIf
   If EventID & 4
    RBU=1
   Else
    RBU=0
   EndIf
   If EventID & 512
    MM=1
   Else
    MM=0
   EndIf
  
   Info2$="  LBD="+Str(LBD) + ":  LBU=" +Str(LBU) + ":  RBD" + Str(RBU) + ":  RBU"+ Str(RBD) + ":  MM="  + Str(MM)
   SetGadgetText(2,Info1$ + Info2$)   
   dummy$=""
   P=1
   For I=0 To 15
    If (EventID.l & P)  
     dummy$=dummy$ + "1"
    Else
     dummy$=dummy$ + "0"
    EndIf
    P=P*2
   Next I
   SetGadgetText(3,"EventBits  : "+dummy$ + "     LastID="+Str((LastGadgetID)))   

     ;Move Gadget 
   
   If (EventID.l=513);EventGadgetID()=#TestGadget; And x>GP\x And xGP\y And (y-20)4 And GID<41
        x1=GP(GID)\x
        y1=GP(GID)\y
        ;If EventID.l=#WM_LBUTTONDOWN 
         Gosub UpdateCorners
         SetGadgetText(4,"Info on "+Str(GID))
      ; MessageRequester("Info","",0)

      EndIf
      Select GID
       Case 101
        MessageRequester("Info","Left Up Corner",0)
       Case 102
        MessageRequester("Info","Left Down Corner",0)
       Case 103
        MessageRequester("Info","Right Up Corner",0)
       Case 104
        MessageRequester("Info","Right Down Corner",0)
       Case 1
        x1=x;GP(GID)\x
        y1=y;GP(GID)\y
        Gosub UpdateCorners
       
       Default
 ;       ResizeGadget(101, -CW,-CW,CW,CW);Left Up Corner
 ;       ResizeGadget(102, -CW,-CW,CW,CW);Left Up Corner
 ;       ResizeGadget(103, -CW,-CW,CW,CW);Left Up Corner
 ;       ResizeGadget(104, -CW,-CW,CW,CW);Left Up Corner
 ;       ResizeGadget(105, -CW,-CW,CW,CW);Left Up Corner
 ;       ResizeGadget(106, -CW,-CW,CW,CW);Left Up Corner
        SendMessage_(WindowID(),#WM_PAINT, 1,0)
       EndSelect
   EndIf 
 Until EventID = #PB_EventCloseWindow
EndIf
End

UpdateCorners:
    ResizeGadget(101, x1-CW, y1-CW,CW,CW);Left Up Corner
    ResizeGadget(102, x1-CW, y1+GP(LastGadgetID)\h,CW,CW);Left down Corner
    ResizeGadget(103, x1+GP(LastGadgetID)\w, y1-CW,CW,CW);right Up Corner
    ResizeGadget(104, x1+GP(LastGadgetID)\w, y1+GP(LastGadgetID)\h,CW,CW);right down Corner
    ResizeGadget(105, x1+(GP(LastGadgetID)\w-CW)/2, y1-CW,CW,CW);right Up Corner
    ResizeGadget(106, x1+(GP(LastGadgetID)\w-CW)/2, y1+GP(LastGadgetID)\h,CW,CW);right down Corner
    SendMessage_(WindowID(),#WM_PAINT, 1,0)
Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pwebb.
Use ResizeGadget(#Gadget, x,y,Width,Height) instead.

Fred - AlphaSND
HI Fred,

Thanks for that, now if I can only find out why this event #WM_RBUTTONUP wont work then i will be well on my way with the editor.



Peter Webb
Registered PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

@pwebb:
tried it with SetWindowCallback() ??

cya,
...Danilo

(registered PureBasic user)
Post Reply