PureBasic - форум

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » PureBasic - форум » Вопросы по PureBasic » DRAG DROP


DRAG DROP

Сообщений 1 страница 6 из 6

1

Можно ли текст перетаскивать в чужие проги(точнее в браузер)? Я подозреваю что надо postmessage  задействовать, но может есть проще способ.

0

2

Браузер работает в режиме "только чтение" это ведь не редактор текста!

0

3

Пётр написал(а):

Браузер работает в режиме "только чтение" это ведь не редактор текста!

Ты прости, но из этого ответа я ничего не понял.  :disappointed:    Мне не нужно туда впехивать кучу текста, но данные для входа на некоторые часто посещаемые сайты. Проще говоря логин и пароль.

0

4

Прошу прощения если не в ту тему пишу. По названию судил. Вопрос: в Delphi я в свое время делал такой эффект как DRAG and DROP, то есть возможность за края тул бара отрывать его от своего места и переносить на новое. То же самое проделывал с меню. Как такой эффект осуществить в PB или может это не реально. Вот как с этими тремя тул барами на скрине:
http://s14.radikal.ru/i187/1004/e2/5eeb990b04a9.jpg

0

5

daiomik написал(а):

Как такой эффект осуществить в PB

Сам ничего подобного не делал, но на оф. форуме нашёл этот код.

Код:
; Rebar Control by Sparkie 07/22/2004 

#TB_GETBUTTONSIZE = #WM_USER + 58 

Structure myINITCOMMONCONTROLSEX 
dwSize.l 
dwICC.l 
EndStructure 

Procedure.l CreateRebar(hwndOwner, hwndST, hwndTB, hwndCB) 
  rbi.REBARINFO 
  rbBand.REBARBANDINFO 
  rc.RECT 
  icex.myINITCOMMONCONTROLSEX 
    
  icex\dwSize = SizeOf(myINITCOMMONCONTROLSEX) 
  icex\dwICC  = #ICC_COOL_CLASSES | #ICC_BAR_CLASSES 

  InitCommonControlsEx_(@icex) 

  hwndRB = CreateWindowEx_(#WS_EX_TOOLWINDOW, "ReBarWindow32", #Null, #WS_CHILD | #WS_VISIBLE | #WS_CLIPSIBLINGS | #WS_CLIPCHILDREN | #RBS_VARHEIGHT | #CCS_NODIVIDER, 0, 0, 0, 0, hwndOwner, #Null,  GetModuleHandle_(0), #Null) 
  rbi\cbSize = SizeOf(REBARINFO) 
  rbi\fMask  = 0 
  rbi\himl = #Null 
  SendMessage_(hwndRB, #RB_SETBARINFO, 0, @rbi) 
  rbBand\cbSize = SizeOf(REBARBANDINFO) 
  rbBand\fMask  = #RBBIM_COLORS | #RBBIM_TEXT | #RBBIM_STYLE | #RBBIM_CHILD  | #RBBIM_CHILDSIZE | #RBBIM_SIZE; 
  rbBand\fStyle = #RBBS_CHILDEDGE 
;/ turn off XP Skin support to see your color choices in the Rebar here 
  rbBand\clrBack = RGB(200, 200, 128) 
  rbBand\clrFore = RGB(64, 100, 0) 

;/ Set values for band with the StringGadget 
  GetWindowRect_(hwndST, @rc) 
  sttext$ = "String" 
  rbBand\lpText = @sttext$                  ; text to display for StringGadget 
  rbBand\hwndChild = hwndST                 ; handle to our STringGadget 
  rbBand\cxMinChild = 100                   ; min width of band (0 hides gadget) 
  rbBand\cyMinChild = rc\bottom - rc\top    ; min height of band 
  rbBand\cx = 200                           ; width of band 
          
;/ Add the band with the StringGadget 
  SendMessage_(hwndRB, #RB_INSERTBAND, -1, @rbBand) 
        
;/ Get the height of the ToolBar we created earlier 
  dwBtnSize = SendMessage_(hwndTB, #TB_GETBUTTONSIZE, 0,0) 
          
;/ Set values for band with the ToolBar 
  tbtext$ = "ToolBar" 
  rbBand\lpText = @tbtext$                  ; text to display for ToolBar 
  rbBand\hwndChild = hwndTB                 ; handle to our ToolBar 
  rbBand\cxMinChild = 100                   ; min width of band (0 hides ToolBar) 
  rbBand\cyMinChild = dwBtnSize>>16         ; min height of band set to button height 
  rbBand\cx = 200                           ; width of band 
          
;/ Add the band that has the toolbar. 
  SendMessage_(hwndRB, #RB_INSERTBAND, -1, @rbBand); 

;/ Set values for the band with the ComboBox 
  GetWindowRect_(hwndCB, @rc); 
  cbtext$ = "ComboBox" 
  rbBand\lpText = @cbtext$                  ; text to display for ToolBar 
  rbBand\hwndChild = hwndCB                 ; handle to our ComboBOxGadget 
  rbBand\cxMinChild = 100                   ; min width of band (0 hides ComboBox) 
  rbBand\cyMinChild = rc\bottom - rc\top    ; min height of band 
  rbBand\cx = 300                           ; width of band 
          
;/ Add the band that has the combobox 
  SendMessage_(hwndRB, #RB_INSERTBAND, -1, @rbBand); 

  ProcedureReturn hwndRB; 
EndProcedure 
        
If OpenWindow(0, 50, 50, 700, 200,"", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) 
  If CreateGadgetList(WindowID(0)) 
    hStGad = StringGadget(0, 10, 50, 150, 20, "Hello World") 
    hTbGad = CreateToolBar(0, WindowID(0)); 
    ToolBarStandardButton(0, #PB_ToolBarIcon_New) 
    ToolBarStandardButton(1, #PB_ToolBarIcon_Open) 
    ToolBarStandardButton(2, #PB_ToolBarIcon_Save) 
    SetWindowLong_(hTbGad, #GWL_EXSTYLE, 128)       ; best I can do for now 
    SetWindowLong_(hTbGad, #GWL_STYLE, 1442879821)  ; best I can do for now 
    hCbGad = ComboBoxGadget(1, 10, 100, 100, 20) 
      For a=1 To 5 
        AddGadgetItem(1, -1, "ComboBox item " + Str(a)) 
      Next 
    SetGadgetState(1,0) 
    TextGadget(2, 200, 100, 400, 20, "Clicking on any of the text labels in the Rebar also resizes the band.") 
    TextGadget(3, 200, 130, 400, 20, "Click and drag on any of the text labels to reposition the bands.") 
    CreateRebar(WindowID(0), hStGad, hTbGad, hCbGad) 
  EndIf 
EndIf 
      
Repeat 
          
  Event = WaitWindowEvent() 
  
    Select Event 
      
      Case #PB_Event_Menu 
        
        If Event = #PB_Event_Menu 
          SetGadgetText(0, "ToolBar ID: " + Str(EventMenu())) 
        EndIf 
      
      Case #PB_Event_Gadget 
        
        If EventGadget() = 1 
          SetGadgetText(0, GetGadgetText(1)) 
        EndIf 
        
        
      Case #PB_Event_CloseWindow 
        Quit = #True 
              
    EndSelect 
          
Until Quit = #True 
        
End

0

6

То, что нужно :) Щас разбираться буду

0


Вы здесь » PureBasic - форум » Вопросы по PureBasic » DRAG DROP