Page 2 of 3
Posted: Thu Jun 10, 2004 6:56 pm
by User Mike
Thanks for your advice everyone.
blueznl: Hmm, I'll take a look into that. Might make things a little more difficult than they already are, but I'll definitly look into it.
BalrogSoft: Yeah, the source I posted for what I'm trying to do makes things complicated. In short, it's 2 commands in 1 command utilizing 2 commands. It's confusing and I don't know if that counts as a wrapper.
I sent the e-mail yesterday night so hopefully I can get a reply within the next few days. Whatever the matter, I think I might have to get dirty with the winapi rather than my method below. Though, I respect that and don't want to take away anything from the PB team.

Posted: Thu Jun 10, 2004 10:36 pm
by User Mike
Alright, 1 last post. (Sorry for all the rapid posting. I'm just needing to finish this DLL soon for a few projects)
To boil everything down nice and simple, tell me if these commands are legal to distribute in a DLL.
Returns properties of the current gadget selected.
Code: Select all
ProcedureDLL ReturnGadgetLocation(Gadget,Flag)
X=GadgetX(Gadget)
Y=GadgetY(Gadget)
Height=GadgetHeight(Gadget)
Width=GadgetWidth(Gadget)
Items=CountGadgetItems(Gadget)
If Flag=1
MessageRequester("Gadget: "+Str(Gadget)+" Properties ", "Position: "+Str(X)+","+Str(Y)+" Size: "+Str(Width)+","+Str(Height)+" Items in Gadget: "+Str(Items) )
Else
EndIf
EndProcedure
Sets the gadget to be invisible, delete, show, enable, etc.
Code: Select all
ProcedureDLL SetDisplayGadget(Gadget,Flag)
If Flag=1
FreeGadget(Gadget)
EndIf
If Flag=2
HideGadget(Gadget, 1) ;1= hidden 0 = show
EndIf
If Flag=3
HideGadget(Gadget, 0) ;1= hidden 0 = show
EndIf
If Flag=4
ClearGadgetItemList(Gadget)
EndIf
If Flag=5
DisableGadget(Gadget, 1) ; 1 be disabled, 0 it will be enabled
EndIf
If Flag=6
DisableGadget(Gadget, 0) ; 1 be disabled, 0 it will be enabled
EndIf
EndProcedure
Tells which file requester to use
Code: Select all
ProcedureDLL FileRequeste(Title$,Text$,Pattern$,PatternPosition,Flag,Retrieve)
If Flag=1
Filename$=SaveFileRequester(Title$, DefaultFile$, Pattern$, PatternPosition)
If Retrieve=1
Path$ = GetPathPart(Filename$)
Extension$ = GetFilePart(Filename$)
Size = FileSize(FileName$)
MessageRequester("Retrieved Data","Filepath: "+Path$+""+Extension$+" "+"File Size: "+Str(Size) )
EndIf
EndIf
If Retrieve=2
Filename$=OpenFileRequester(Title$, DefaultFile$, Pattern$, PatternPosition)
If Flag2=1
Path$ = GetPathPart(Filename$)
Extension$ = GetFilePart(Filename$)
Size = FileSize(FileName$)
MessageRequester("Retrieved Data","Filepath: "+Path$+""+Extension$+" "+"File Size: "+Str(Size) )
EndIf
EndIf
EndProcedure
Assuming all of my functions in my DLL's were like this (many commands put into a function determined by flags which to use), is this legal to distribute a DLL?
Posted: Fri Jun 11, 2004 12:44 am
by Kale
ReturnGadgetLocation(Gadget,Flag) looks ok to me because its actually doing something but the other 2 just look like illegal wrappers imo.
Posted: Fri Jun 11, 2004 1:06 am
by User Mike
Hmm, I was hoping that wouldn't be the case. Return Gadget isn't going to be too helpful if I don't have any gadgets.
How about this one?
(A button/image gadget function. Read documentation if you'd like to use it.)
Code: Select all
;This command will create a button. Gadget specifies the gadget number.X and Y specify
;the positions and Width and Height specify the dimensions of the gadget.
;If the Flag is set to 1 then you can replace Text$ with any value. For this instance,
;the image ID doesn't apply.
;If the Flag is set to 2, then the Text$ doesn't apply to the button, yet you must specify an
;image for the button to use.
;For either flag, you may set up a tooltip by Replacing the ToolTip$ with a string. If
;no value is set, no tool tip will be displayed.
ProcedureDLL CreateButton(Gadget, x, y, Width, Height, Flag,Text$,ImageID,ToolTip$)
If Flag=1
ButtonGadget(Gadget, x, y, Width, Height, Text$ , #PB_Button_Default)
EndIf
If Flag=2
ButtonImageGadget(Gadget, x, y, Width, Height, ImageID)
EndIf
If ToolTip$ <>""
GadgetToolTip(Gadget, ToolTip$)
EndIf
EndProcedure
Posted: Fri Jun 11, 2004 1:16 am
by Paul
Why not just use common sense??
Your procedure is to create a button... and you then use native PB commands to create a button. All you have done is wrap PB commands (which is basically giving people who have not purchased PB, access to PB commands).
Regardless, you are asking the wrong people for legal advice about this. The only true and absolute answer can come from Fred himself at Fantaisie Software, who creates PB and makes the rules. The rest of us here are just users/customers who can only give out own personal opinions, interpretation or beliefs.
Danilo has already pointed this out to you...
Contact Fantaisie Software at
alphasnd@purebasic.com
and ask there - they can answer it for your specific product
if you show them source examples.
Posted: Fri Jun 11, 2004 1:54 am
by PolyVector
haha, finally! :roll:
Just use the WinAPI and everything will be legit... Then you can feel proud that you did it yourself
Mike, if you take a minute to think about the years of work that have gone into purebasic, and the miles of code that comprise the gadget system alone... This shouldn't even be a question...
Now if PB was freeware that might be a different story, but Fred is doing this to make some money, so let's not short-change him by giving away or selling
his work.
Posted: Fri Jun 11, 2004 2:01 am
by User Mike
Argh, I was hoping it wouldn't come to that.
*Smacks self*
I guess I might as well start now.

If Fred gets my e-mail I'm sure he'll be able to clarify this.
No need to reply any more.
***Thread Locked Problem Solved***
[Edit] PolyVector by all means, I don't want to short change Fred at all. That's why I created to clarify to myself what would be legal or not.
Posted: Fri Jun 11, 2004 5:49 am
by PolyVector
I know that wasn't your intentions... it's always good to stop and think about these things tho'

Posted: Fri Jun 11, 2004 7:56 am
by User Mike
Hehe, already getting my hands dirty and mangled into the WinAPI.
<----- First time messing with WinAPI.
Posted: Fri Jun 11, 2004 10:46 am
by LarsG
atleast the API should keep you out of the legal mumbo jumbo...

Posted: Fri Jun 11, 2004 12:54 pm
by blueznl
maybe the mental institution you end up in can charge fred for yout future state?

Posted: Fri Jun 11, 2004 3:23 pm
by thefool
user mike,
you can not do like this:
proceduredll msgbox(title.s,msg.s)
messagerequester(title.s,msg.s)
endprocedure
thats a wrapper.
But, if you use VD to make a gui that does exactly like a messagerequester (design a window that can show a message), that is legal.
I think you can use the messagebox_() api also,
thats what i know. I have contacted fred about this before, and this is what i remember.
Regards, Daniel.
Posted: Fri Jun 11, 2004 6:06 pm
by User Mike
Hehe, I may be in a mental institution at 20 worrying about all the legal junk these days.
Thanks everyone for your help. Fred has contacted me, and everyone of these code snippets would not be legal to distribute. I respect that, so as mentioned before I'll have to use the winapi.

Posted: Fri Jun 11, 2004 7:21 pm
by ricardo
Why don't you code you app all in PureBasic and then forget about all this complications?
Posted: Fri Jun 11, 2004 7:23 pm
by RJP Computing
I am all for giving credit to those how deserve it, but I have to be the devils advocate here. What about the commands in PureBasic that our direct wrappers of the WinAPI. You don't have a problem there, so I almost don't see the issue.
For example,
Code: Select all
PB WinAPI
-----------------------------------------
MessageRequester -> MessageBox
GadgetID -> GetDlgItem
HideWindow -> ShowWindow
Please don't flame me.

I am just tring to look at the problem differently.